poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 48403] New: Color index is set incorrectly in PaletteRecord
Date Thu, 17 Dec 2009 08:56:36 GMT

           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

View raw message