From 83bb4b4da5bcaeb980fd74c7580105b92f3116c2 Mon Sep 17 00:00:00 2001 From: Dominik Stadler Date: Fri, 30 Dec 2022 08:11:38 +0000 Subject: [PATCH] Rename method for color from "RBG" to "RGB" It's a protected method that is not intended to be used outside anyway. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1906276 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/poi/xssf/usermodel/XSSFColor.java | 2 +- .../poi/hssf/usermodel/HSSFExtendedColor.java | 10 +++++----- .../poi/ss/usermodel/ExtendedColor.java | 20 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java index 904dba2eed..ad65465671 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFColor.java @@ -217,7 +217,7 @@ public class XSSFColor extends ExtendedColor { } @Override - protected byte[] getStoredRBG() { + protected byte[] getStoredRGB() { return ctColor.getRgb(); } diff --git a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFExtendedColor.java b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFExtendedColor.java index 54390cb59a..f34bc4db4f 100644 --- a/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFExtendedColor.java +++ b/poi/src/main/java/org/apache/poi/hssf/usermodel/HSSFExtendedColor.java @@ -28,16 +28,16 @@ import org.apache.poi.ss.usermodel.ExtendedColor; /** * The HSSF file format normally stores Color information in the * Palette (see PaletteRecord), but for a few cases (eg Conditional - * Formatting, Sheet Extensions), this XSSF-style color record + * Formatting, Sheet Extensions), this XSSF-style color record * can be used. */ public class HSSFExtendedColor extends ExtendedColor { private org.apache.poi.hssf.record.common.ExtendedColor color; - + public HSSFExtendedColor(org.apache.poi.hssf.record.common.ExtendedColor color) { this.color = color; } - + protected org.apache.poi.hssf.record.common.ExtendedColor getExtendedColor() { return color; } @@ -80,7 +80,7 @@ public class HSSFExtendedColor extends ExtendedColor { return argb; } - protected byte[] getStoredRBG() { + protected byte[] getStoredRGB() { return getARGB(); } @@ -108,7 +108,7 @@ public class HSSFExtendedColor extends ExtendedColor { public void setTint(double tint) { color.setTint(tint); } - + protected byte[] getIndexedRGB() { if (isIndexed() && getIndex() > 0) { int indexNum = getIndex(); diff --git a/poi/src/main/java/org/apache/poi/ss/usermodel/ExtendedColor.java b/poi/src/main/java/org/apache/poi/ss/usermodel/ExtendedColor.java index 616a61709d..c481fff7fb 100644 --- a/poi/src/main/java/org/apache/poi/ss/usermodel/ExtendedColor.java +++ b/poi/src/main/java/org/apache/poi/ss/usermodel/ExtendedColor.java @@ -21,7 +21,7 @@ import java.util.Locale; /** * Represents a XSSF-style color (based on either a * {@link org.apache.poi.xssf.usermodel.XSSFColor} or a - * {@link org.apache.poi.hssf.record.common.ExtendedColor} + * {@link org.apache.poi.hssf.record.common.ExtendedColor} */ public abstract class ExtendedColor implements Color { @@ -47,17 +47,17 @@ public abstract class ExtendedColor implements Color { * @return true if the color is RGB / ARGB */ public abstract boolean isRGB(); - + /** * @return true if the color is from a Theme */ public abstract boolean isThemed(); - + /** * @return Indexed Color index value, if {@link #isIndexed()} is true */ public abstract short getIndex(); - + /** * @return Index of Theme color, if {@link #isThemed()} is true */ @@ -77,8 +77,8 @@ public abstract class ExtendedColor implements Color { /** * @return RGB or ARGB bytes or null */ - protected abstract byte[] getStoredRBG(); - + protected abstract byte[] getStoredRGB(); + /** * Sets the Red Green Blue or Alpha Red Green Blue * @param rgb bytes @@ -97,9 +97,9 @@ public abstract class ExtendedColor implements Color { } // Grab the colour - return getStoredRBG(); + return getStoredRGB(); } - + /** * @return index color RGB bytes, if {@link #isIndexed()} == true, null if not indexed or index is invalid */ @@ -110,7 +110,7 @@ public abstract class ExtendedColor implements Color { * Alpha values are ignored. */ public byte[] getRGBWithTint() { - byte[] rgb = getStoredRBG(); + byte[] rgb = getStoredRGB(); if (rgb != null) { if(rgb.length == 4) { byte[] tmp = new byte[3]; @@ -146,7 +146,7 @@ public abstract class ExtendedColor implements Color { } return sb.toString().toUpperCase(Locale.ROOT); } - + /** * Sets the ARGB value from hex format, eg FF0077FF. * Only works for regular (non-indexed) colours