summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2012-01-07 18:18:15 -0500
committerKohei Yoshida <kohei.yoshida@suse.com>2012-01-07 18:19:42 -0500
commit6b7080c102e56651803831aaa12c3c86efbce858 (patch)
tree805ad5ded2544c969545429e94bd5b97c59782d2 /sc/source
parentdaab19c2ae13245318b8fcd1a5468cae7ab43348 (diff)
Reset sheet ID of cell-anchored drawing objects when deleting sheet(s).
This prevents drawing objects from disappearing on file reload.
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/documen9.cxx2
-rw-r--r--sc/source/core/data/table1.cxx3
2 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index e4dec4ff2301..d7015973527a 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -257,7 +257,7 @@ void ScDocument::DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos )
{
// angelegt wird die Page schon im ScTable ctor
pDrawLayer->ScCopyPage( nOldPos, nNewPos, false );
- pDrawLayer->ResetTab(static_cast<SCTAB>(nNewPos), static_cast<SCTAB>(maTabs.size()));
+ pDrawLayer->ResetTab(static_cast<SCTAB>(nNewPos), static_cast<SCTAB>(maTabs.size()-1));
}
void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 06b8203c15d2..2464340753c5 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -331,7 +331,10 @@ ScTable::~ScTable()
ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
if (pDrawLayer)
+ {
pDrawLayer->ScRemovePage( nTab );
+ pDrawLayer->ResetTab(nTab, pDocument->GetTableCount()-1);
+ }
}
delete[] pColWidth;