[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Sat Jan 7 15:20:30 PST 2012
sc/source/core/data/documen9.cxx | 2 +-
sc/source/core/data/table1.cxx | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 1f6e412a8fc7f7a22f0872eda3be6545a7cee5eb
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Sat Jan 7 18:18:15 2012 -0500
Reset sheet ID of cell-anchored drawing objects when deleting sheet(s).
This prevents drawing objects from disappearing on file reload.
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index e4dec4f..d701597 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 93285a2..61e9bb6 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;
More information about the Libreoffice-commits
mailing list