[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Sat Jan 7 15:46:21 PST 2012
sc/source/core/data/documen9.cxx | 1 -
sc/source/core/data/drwlayer.cxx | 6 ++++++
sc/source/core/data/table1.cxx | 3 ---
3 files changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 779884e79046bbbb1eb173c6aa1324240d6d13a5
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Sat Jan 7 18:44:21 2012 -0500
Reset sheet index of drawing objects when moving sheet too.
If not, cell-anchored objects would get stuck on the old sheet
position, which is not good.
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 2bbd35e..69f289a 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -421,6 +421,8 @@ void ScDrawLayer::ScRenamePage( SCTAB nTab, const String& rNewName )
void ScDrawLayer::ScMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos )
{
MovePage( nOldPos, nNewPos );
+ sal_uInt16 nMinPos = std::min(nOldPos, nNewPos);
+ ResetTab(nMinPos, pDoc->GetTableCount()-1);
}
void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool bAlloc )
commit 292cec8ff30181a7c3c253362cd5e2a93cc134db
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date: Sat Jan 7 18:38:12 2012 -0500
Better to internalize the sheet ID reset within ScDrawLayer...
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index d701597..b8cca4c 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -257,7 +257,6 @@ 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()-1));
}
void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 91820f4..2bbd35e 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -407,6 +407,8 @@ void ScDrawLayer::ScRemovePage( SCTAB nTab )
}
else
DeletePage( static_cast<sal_uInt16>(nTab) ); // einfach weg damit
+
+ ResetTab(nTab, pDoc->GetTableCount()-1);
}
void ScDrawLayer::ScRenamePage( SCTAB nTab, const String& rNewName )
@@ -470,6 +472,8 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos, sal_Bool b
if (bAlloc)
InsertPage(pNewPage, nNewPos);
+
+ ResetTab(static_cast<SCTAB>(nNewPos), pDoc->GetTableCount()-1);
}
void ScDrawLayer::ResetTab( SCTAB nStart, SCTAB nEnd )
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 2464340..06b8203 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -331,10 +331,7 @@ 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