diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-07 18:18:15 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-01-07 18:20:56 -0500 |
commit | 1f6e412a8fc7f7a22f0872eda3be6545a7cee5eb (patch) | |
tree | e57bb602abdad67e01621e849cf420590739b0fb /sc | |
parent | 6c3cfe6059c31c980d123f413a69d536887c336d (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')
-rw-r--r-- | sc/source/core/data/documen9.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 3 |
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 93285a294c1c..61e9bb6091b7 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -333,7 +333,10 @@ ScTable::~ScTable() ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer(); if (pDrawLayer) + { pDrawLayer->ScRemovePage( nTab ); + pDrawLayer->ResetTab(nTab, pDocument->GetTableCount()-1); + } } delete[] pColWidth; |