[Libreoffice-commits] .: Branch 'libreoffice-3-5' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Sat Jan 7 15:19:14 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 6b7080c102e56651803831aaa12c3c86efbce858
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 06b8203..2464340 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;


More information about the Libreoffice-commits mailing list