summaryrefslogtreecommitdiff
path: root/sc/source/ui/undo
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-10-26 00:59:34 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-10-26 17:01:59 +0200
commit05d40c33b0d3e8d33912ad2b43ae8e31c6a1e443 (patch)
tree22327eb9d411ef508089af37b274113ac12c01ac /sc/source/ui/undo
parent267aa59dfe918f97c32b0ba8f9a54b548c89b4c9 (diff)
add local range names to undo
Diffstat (limited to 'sc/source/ui/undo')
-rw-r--r--sc/source/ui/undo/undocell.cxx19
1 files changed, 15 insertions, 4 deletions
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index fa98ed441a7d..a4c6c6dc529f 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -1084,10 +1084,11 @@ sal_Bool ScUndoDetective::CanRepeat(SfxRepeatTarget& /* rTarget */) const
//
ScUndoRangeNames::ScUndoRangeNames( ScDocShell* pNewDocShell,
- ScRangeName* pOld, ScRangeName* pNew ) :
+ ScRangeName* pOld, ScRangeName* pNew, SCTAB nTab ) :
ScSimpleUndo( pNewDocShell ),
pOldRanges ( pOld ),
- pNewRanges ( pNew )
+ pNewRanges ( pNew ),
+ mnTab ( nTab )
{
}
@@ -1108,9 +1109,19 @@ void ScUndoRangeNames::DoChange( sal_Bool bUndo )
pDoc->CompileNameFormula( sal_True ); // CreateFormulaString
if ( bUndo )
- pDoc->SetRangeName( new ScRangeName( *pOldRanges ) );
+ {
+ if (mnTab >= 0)
+ pDoc->SetRangeName( mnTab, new ScRangeName( *pOldRanges ) );
+ else
+ pDoc->SetRangeName( new ScRangeName( *pOldRanges ) );
+ }
else
- pDoc->SetRangeName( new ScRangeName( *pNewRanges ) );
+ {
+ if (mnTab >= 0)
+ pDoc->SetRangeName( mnTab, new ScRangeName( *pNewRanges ) );
+ else
+ pDoc->SetRangeName( new ScRangeName( *pNewRanges ) );
+ }
pDoc->CompileNameFormula( false ); // CompileFormulaString