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 2009/12/17 09:56:36 UTC
DO NOT REPLY [Bug 48403] New: Color index is set incorrectly in
PaletteRecord
https://issues.apache.org/bugzilla/show_bug.cgi?id=48403
Summary: Color index is set incorrectly in PaletteRecord
Product: POI
Version: 3.5-FINAL
Platform: PC
OS/Version: Windows Vista
Status: NEW
Severity: normal
Priority: P2
Component: HSSF
AssignedTo: dev@poi.apache.org
ReportedBy: mobject@gmail.com
Color color = Color.decode("#006B6B");
HSSFPalette palette = wb.getCustomPalette();
HSSFColor hssfColor = palette.findColor((byte) color.getRed(), (byte)
color.getGreen(),(byte) color.getBlue());
if (hssfColor == null)
{
palette.setColorAtIndex((short)(PaletteRecord.STANDARD_PALETTE_SIZE -1) ,
(byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue());
hssfColor = palette.getColor((short)(PaletteRecord.STANDARD_PALETTE_SIZE -1)
);
....
This did not return Color that had been set to a specific index because the
setColorIndex() in PaletteRecord picks wrong index. It set new color to the
different index at byteIndex(the index that user wants HSSFPalette to add) -
FIRST_COLOR_INDEX; (line 118 in PaletteRecord )
--
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