resolved fdo#81294 store correct sheet number during range names update

Change-Id: Ic4c858efa6e7c1a65357ac79f01e6c08f464ae3f
This commit is contained in:
Eike Rathke
2014-07-18 00:45:44 +02:00
parent 380855c358
commit 4011b74eb7

View File

@@ -1591,6 +1591,12 @@ void ScTable::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY )
void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt )
{
// Store the old tab number in sc::UpdatedRangeNames for
// ScTokenArray::AdjustReferenceOnInsertedTab() to check with
// isNameModified()
if (mpRangeName)
mpRangeName->UpdateInsertTab(rCxt, nTab);
if (nTab >= rCxt.mnInsertPos)
{
nTab += rCxt.mnSheets;
@@ -1598,9 +1604,6 @@ void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt )
pDBDataNoName->UpdateMoveTab(nTab - 1 ,nTab);
}
if (mpRangeName)
mpRangeName->UpdateInsertTab(rCxt, nTab);
if (mpCondFormatList)
mpCondFormatList->UpdateInsertTab(rCxt);
@@ -1618,6 +1621,12 @@ void ScTable::UpdateInsertTab( sc::RefUpdateInsertTabContext& rCxt )
void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt )
{
// Store the old tab number in sc::UpdatedRangeNames for
// ScTokenArray::AdjustReferenceOnDeletedTab() to check with
// isNameModified()
if (mpRangeName)
mpRangeName->UpdateDeleteTab(rCxt, nTab);
if (nTab > rCxt.mnDeletePos)
{
nTab -= rCxt.mnSheets;
@@ -1625,9 +1634,6 @@ void ScTable::UpdateDeleteTab( sc::RefUpdateDeleteTabContext& rCxt )
pDBDataNoName->UpdateMoveTab(nTab + 1,nTab);
}
if (mpRangeName)
mpRangeName->UpdateDeleteTab(rCxt, nTab);
if (mpCondFormatList)
mpCondFormatList->UpdateDeleteTab(rCxt);