From 47600ff855e7855ecc8dd812b8f9a6ea08c20278 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sun, 21 Sep 2008 18:56:32 +0000 Subject: [PATCH] Test to show that bug #45492 is invalid git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@697584 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/usermodel/HSSFCellStyle.java | 8 +++- .../poi/hssf/usermodel/HSSFPalette.java | 9 +++++ .../org/apache/poi/hssf/data/45492.xls | Bin 0 -> 13824 bytes .../apache/poi/hssf/usermodel/TestBugs.java | 35 ++++++++++++++++++ 4 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 src/testcases/org/apache/poi/hssf/data/45492.xls diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java index 2afd16d8d1..d71619aaa8 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFCellStyle.java @@ -913,7 +913,9 @@ public class HSSFCellStyle } /** - * get the background fill color + * Get the background fill color. + * Note - many cells are actually filled with a foreground + * fill, not a background fill - see {@link #getFillForegroundColor()} * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short) * @return fill color */ @@ -939,7 +941,9 @@ public class HSSFCellStyle } /** - * get the foreground fill color + * Get the foreground fill color. + * Many cells are filled with this, instead of a + * background color ({@link #getFillBackgroundColor()}) * @see org.apache.poi.hssf.usermodel.HSSFPalette#getColor(short) * @return fill color */ diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java b/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java index 8674904d0c..4c9d63ebc4 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFPalette.java @@ -57,6 +57,15 @@ public class HSSFPalette } return null; } + /** + * Retrieves the color at a given index + * + * @param index the palette index, between 0x8 to 0x40 inclusive + * @return the color, or null if the index is not populated + */ + public HSSFColor getColor(int index) { + return getColor((short)index); + } /** * Finds the first occurance of a given color diff --git a/src/testcases/org/apache/poi/hssf/data/45492.xls b/src/testcases/org/apache/poi/hssf/data/45492.xls new file mode 100644 index 0000000000000000000000000000000000000000..7e044e8977281260534631253073191a8727c436 GIT binary patch literal 13824 zcmeHOU1(fI6#nk!?q)ZC-6S>r!}YRJVv`se6k3rs8?|DQU}(@5RFchRYu2P$*=%eC z!Bt!PQXx{omw*qdtq&G|posdC_RSan1q*H0@0^=!vfaH&6bjnTEa%Lf zGiPSbd~@f{oVjhxtMlDW*7b6vyzYD3Zz z8|G-!PF`7-u-yJYLiJu#9#`H#ZsAic z^PNh%u^DHnUwm;!Zgu>Kpw){UGDu<^*Dp6_Z%2^5vRcuJR{pjTatCodf_f{C`_r+QcxuH;9zZp2TV6>QZCKfga*deXhcIqmtr|azDphz0?YI}# zAp74=L@Hw-xh_Vl>3H?TSt4G7v0I1m1cb-zL)hxy^dN_3kb~nEli?|Ex>QFrMQ5q$ z@_eu9qa5nqO1&PrlVh-svN6_mM{` z%B3~6C$ZSB-J;`OF0b*C*ZIh6o#O!;(Lz;G;>JQqog4sF&l40N{QoSx~b>t&l z1Z9b9BnP6b^YZCmzU~|D?-^8iyUIJ1zpRo1b-Zu~0pU`JmzXneOIx>)UQzAC%1`iN zCK{IhMB57sJ?@pnk5QMk1{zc(QxytIIKYjEUh5u`omht}+FQtGgTYN%Y*$LTsQ_BE zZ8ueg4cw-Bc{Vn35WG~dq?XWP>KhK&bJPKL1)A`Q?rsyBcG<1elNuRZQwb`I0NY72 z6ebu13<3rLgMdNcMnK>ySKpxSX-az|tKY(rw|>3!=xFr)*Td*&`}o^!l${~To<{N$ zBw27DCdtNOh}1-yCdt-ihEz|QB{h>ykz^}!k%eN6Wdm@{p~9;2zDz2Yoy;D{JG-Y- z>2bB8@SeTt^ zNXJNW9`FW9&IeACmY)Ym***OO&SY1vE8B%`@!=b`M6^y``o=LfCg%}yF5$k7K^;X> zwHz}@wfnNUu}OJRGpWb>-q}8LOfU!-1PlTO0fT@+z#w1{FbEg~3<3rLgTPIIfOx{< zD2uNx@ABnaMfu)Md};Y#hxq#P-J3Yk;