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 834f7c51ea1a51c6022da25fad9d0389682c5d52 Author: Kohei Yoshida <kohei.yosh...@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 aeb3af4ea06cb1f17b0177ab77c88f809fb99427 Author: Kohei Yoshida <kohei.yosh...@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 61e9bb6..93285a2 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -333,10 +333,7 @@ ScTable::~ScTable() ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer(); if (pDrawLayer) - { pDrawLayer->ScRemovePage( nTab ); - pDrawLayer->ResetTab(nTab, pDocument->GetTableCount()-1); - } } delete[] pColWidth; _______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits