[Libreoffice-commits] .: sc/source
Markus Mohrhard
mmohrhard at kemper.freedesktop.org
Wed Jun 29 20:32:14 PDT 2011
sc/source/core/data/table1.cxx | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
New commits:
commit cacc32f86fa18cb8262f5597b381c099117a3344
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Jun 30 05:28:29 2011 +0200
fix for fdo#38380: update local range names
local range names must be updated like global range names
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 0d0f572..d316b49 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1301,6 +1301,12 @@ void ScTable::UpdateReference( UpdateRefMode eUpdateRefMode, SCCOL nCol1, SCROW
bUpdated |= aCol[i].UpdateReference(
eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, pUndoDoc );
+ if (mpRangeName)
+ {
+ ScRange aRange( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );;
+ mpRangeName->UpdateReference( eUpdateRefMode, aRange, nDx, nDy, nDz );
+ }
+
if ( bIncludeDraw )
UpdateDrawRef( eUpdateRefMode, nCol1, nRow1, nTab1, nCol2, nRow2, nTab2, nDx, nDy, nDz, bUpdateNoteCaptionPos );
@@ -1408,6 +1414,9 @@ void ScTable::UpdateInsertTab(SCTAB nTable, SCTAB nNewSheets)
}
for (SCCOL i=0; i <= MAXCOL; i++) aCol[i].UpdateInsertTab(nTable, nNewSheets);
+ if (mpRangeName)
+ mpRangeName->UpdateTabRef( nTable, 1, 0, nNewSheets);
+
if (IsStreamValid())
SetStreamValid(false);
}
@@ -1427,6 +1436,14 @@ void ScTable::UpdateDeleteTab( SCTAB nTable, sal_Bool bIsMove, ScTable* pRefUndo
else
for (i=0; i <= MAXCOL; i++) aCol[i].UpdateDeleteTab(nTable, bIsMove, NULL, nSheets);
+ if (mpRangeName)
+ {
+ for (SCTAB aTab = 0; aTab < nSheets; ++aTab)
+ {
+ mpRangeName->UpdateTabRef( nTable + aTab, 2 );
+ }
+ }
+
if (IsStreamValid())
SetStreamValid(false);
}
@@ -1442,6 +1459,9 @@ void ScTable::UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos, SCTAB nTabNo,
pProgress->SetState(pProgress->GetState() + aCol[i].GetCodeCount());
}
+ if (mpRangeName)
+ mpRangeName->UpdateTabRef(nOldPos, 3, nNewPos);
+
if (IsStreamValid())
SetStreamValid(false);
if (pDBDataNoName)
More information about the Libreoffice-commits
mailing list