Patch for bug 16559.
Custom Palettes now work. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353400 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2ef26b5ff5
commit
351a6859f5
@ -2064,18 +2064,21 @@ public class Workbook implements Model {
|
|||||||
*/
|
*/
|
||||||
public PaletteRecord getCustomPalette()
|
public PaletteRecord getCustomPalette()
|
||||||
{
|
{
|
||||||
PaletteRecord palette;
|
PaletteRecord palette;
|
||||||
Record rec = records.get(records.getPalettepos());
|
int palettePos = records.getPalettepos();
|
||||||
if (rec instanceof PaletteRecord)
|
if (palettePos != -1) {
|
||||||
{
|
Record rec = records.get(palettePos);
|
||||||
palette = (PaletteRecord) rec;
|
if (rec instanceof PaletteRecord) {
|
||||||
}
|
palette = (PaletteRecord) rec;
|
||||||
else
|
} else throw new RuntimeException("InternalError: Expected PaletteRecord but got a '"+rec+"'");
|
||||||
{
|
}
|
||||||
palette = createPalette();
|
else
|
||||||
records.add(records.getPalettepos(), palette);
|
{
|
||||||
}
|
palette = createPalette();
|
||||||
return palette;
|
//Add the palette record after the bof which is always the first record
|
||||||
|
records.add(1, palette);
|
||||||
|
}
|
||||||
|
return palette;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user