Branch. Dont forget to set the palette pos of the new palette record

git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/branches/REL_2_BRANCH@353404 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason Height 2003-10-14 23:22:29 +00:00
parent 1736810bb7
commit 242817389a
2 changed files with 3 additions and 2 deletions

View File

@ -2077,6 +2077,7 @@ public class Workbook implements Model {
palette = createPalette(); palette = createPalette();
//Add the palette record after the bof which is always the first record //Add the palette record after the bof which is always the first record
records.add(1, palette); records.add(1, palette);
records.setPalettepos(1);
} }
return palette; return palette;
} }

View File

@ -103,7 +103,7 @@ public class WorkbookRecordList
if (getBackuppos() >= pos) setBackuppos( backuppos + 1 ); if (getBackuppos() >= pos) setBackuppos( backuppos + 1 );
if (getNamepos() >= pos) setNamepos(namepos+1); if (getNamepos() >= pos) setNamepos(namepos+1);
if (getSupbookpos() >= pos) setSupbookpos(supbookpos+1); if (getSupbookpos() >= pos) setSupbookpos(supbookpos+1);
if (getPalettepos() >= pos) setPalettepos( palettepos + 1 ); if ((getPalettepos() != -1) && (getPalettepos() >= pos)) setPalettepos( palettepos + 1 );
if (getExternsheetPos() >= pos) setExternsheetPos(getExternsheetPos() + 1); if (getExternsheetPos() >= pos) setExternsheetPos(getExternsheetPos() + 1);
} }
@ -128,7 +128,7 @@ public class WorkbookRecordList
if (getBackuppos() >= pos) setBackuppos( backuppos - 1 ); if (getBackuppos() >= pos) setBackuppos( backuppos - 1 );
if (getNamepos() >= pos) setNamepos(getNamepos()-1); if (getNamepos() >= pos) setNamepos(getNamepos()-1);
if (getSupbookpos() >= pos) setSupbookpos(getSupbookpos()-1); if (getSupbookpos() >= pos) setSupbookpos(getSupbookpos()-1);
if (getPalettepos() >= pos) setPalettepos( palettepos - 1 ); if ((getPalettepos() != -1) && (getPalettepos() >= pos)) setPalettepos( palettepos - 1 );
if (getExternsheetPos() >= pos) setExternsheetPos( getExternsheetPos() -1); if (getExternsheetPos() >= pos) setExternsheetPos( getExternsheetPos() -1);
} }