You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/11/19 10:12:37 UTC
DO NOT REPLY [Bug 50299] New: NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
Summary: NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Product: POI
Version: 3.7
Platform: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
AssignedTo: dev@poi.apache.org
ReportedBy: yokoi@bbreak.co.jp
java.lang.NullPointerException
at org.apache.poi.xssf.model.ThemesTable.getThemeColor(ThemesTable.java:54)
at
org.apache.poi.xssf.usermodel.XSSFCellStyle.extractColorFromTheme(XSSFCellStyle.java:1454)
at
org.apache.poi.xssf.usermodel.XSSFCellStyle.getFillForegroundXSSFColor(XSSFCellStyle.java:481)
at
org.bbreak.excella.reports.ReportsTestUtil.getCellStyleString(ReportsTestUtil.java:593)
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
andrei <an...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |NEW
--- Comment #4 from andrei <an...@gmail.com> 2011-02-15 09:43:25 EST ---
XSSFCellStyle.getFillForegroundXSSFColor() throws NPE when the cell background
color is set from two first columns of the theme color palette (ie tints of
white and black colors). СTColor.getSrgbClr() in getThemeColor(int) method
returns null for these colors. It's necessary return
CTColor.getSysClr().getLastClr() in such cases.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #2 from akira yokoi <yo...@bbreak.co.jp> 2010-11-19 09:14:41 EST ---
Created an attachment (id=26317)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=26317)
error xlsx file
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
Yegor Kozlov <ye...@dinom.ru> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
OS/Version| |All
--- Comment #1 from Yegor Kozlov <ye...@dinom.ru> 2010-11-19 08:37:47 EST ---
Please post the complete Java code to reproduce the problem. If your code
requires an .xls template then upload it too.
Yegor
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
Nick Burch <ni...@alfresco.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEEDINFO |RESOLVED
Resolution| |FIXED
--- Comment #11 from Nick Burch <ni...@alfresco.com> 2011-02-25 16:22:12 EST ---
One snag - ctColor.getRGB() almost always returns 4 values, including the
Alpha. It's only theme colours where you only get the 3, and in most cases one
your construct yourself
After trying a few things, the safest thing seemed to be to offer two methods,
one which returns the RGB and one that returns ARGB (assuming that if it wasn't
given, then the alpha if 0xFF). Hopefully that does the right thing?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #9 from andrei <an...@gmail.com> 2011-02-21 13:13:30 EST ---
I found another problem - instead of pure white, Excel returns the black, and
for black - white.
See fix patch in attachment.
I also removed the Alpha for indexed colors from getRgb() as unnecessary
(ctColor.getRgb() returns rgb only).
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #10 from andrei <an...@gmail.com> 2011-02-21 13:14:48 EST ---
Created an attachment (id=26688)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=26688)
XSSFColor patch
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #8 from andrei <an...@gmail.com> 2011-02-21 13:00:44 EST ---
White and black colors are theme colors, not indexed, and
getFillForegroundColor() method returns 0 (index) (as for all theme colors).
And getFillBackgroundColor() returns 64 (default AUTOMATIC color index) for
theme colors. So, it's not a bug.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
Nick Burch <ni...@alfresco.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |NEEDINFO
--- Comment #5 from Nick Burch <ni...@alfresco.com> 2011-02-15 11:49:27 EST ---
Any chance you could work up a patch + unit test based on your findings?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #12 from andrei <an...@gmail.com> 2011-02-28 10:15:09 EST ---
I think this is a good solution
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #7 from Nick Burch <ni...@alfresco.com> 2011-02-18 11:44:43 EST ---
Thanks for the patch and test
I've applied the patch to svn in r1072053, and added the unit test too.
However, one thing I'm not sure on is the values coming back. I added one extra
bit to the test, which was to check the whites and blacks in the first sheet.
They're coming back apparent the same though...
Any chance you could take a look at the test in xssf.usermodel.TestBugs and see
if you can spot why we're not seeing different values?
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #3 from akira yokoi <yo...@bbreak.co.jp> 2010-11-19 09:15:16 EST ---
Created an attachment (id=26318)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=26318)
error java code
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
--- Comment #6 from andrei <an...@gmail.com> 2011-02-16 07:09:56 EST ---
Created an attachment (id=26665)
--> (https://issues.apache.org/bugzilla/attachment.cgi?id=26665)
Patch
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org
DO NOT REPLY [Bug 50299] NullPointer Exception in
XSSFCellStyle.getFillForegroundXSSFColor()
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50299
andrei <an...@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |major
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org