summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-10-26 16:18:22 +0200
committerEike Rathke <erack@redhat.com>2016-10-26 16:19:40 +0200
commit0ebe9fab18e732468d2b9d53dddf9f266411a0e5 (patch)
treebf7543194a733221ad7566b3f5b12fff0e824fd8
parent5ac920be30928fca515a1a393ba1b2847c12b07e (diff)
init ScUndoRemoveMerge with range, tdf#92117 follow-up
So the original selection is restored after Undo. Change-Id: Ie549a0b62da469ee38270ae089ea5abf9a6868e3
-rw-r--r--sc/source/ui/docshell/docfunc.cxx4
-rw-r--r--sc/source/ui/inc/undoblk.hxx1
-rw-r--r--sc/source/ui/undo/undoblk.cxx4
3 files changed, 5 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 77c029fe7d73..4942c28995e6 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1907,7 +1907,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( &rDoc, *aMark.begin(), *aMark.rbegin());
- pUndoRemoveMerge.reset( new ScUndoRemoveMerge( &rDocShell, pUndoDoc ));
+ pUndoRemoveMerge.reset( new ScUndoRemoveMerge( &rDocShell, rRange, pUndoDoc ));
}
for( ::std::vector<ScRange>::const_iterator iIter( qIncreaseRange.begin()); iIter != qIncreaseRange.end(); ++iIter )
@@ -2355,7 +2355,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark,
{
ScDocument* pUndoDoc = new ScDocument( SCDOCMODE_UNDO );
pUndoDoc->InitUndo( &rDoc, *aMark.begin(), *aMark.rbegin());
- pUndoRemoveMerge.reset( new ScUndoRemoveMerge( &rDocShell, pUndoDoc ));
+ pUndoRemoveMerge.reset( new ScUndoRemoveMerge( &rDocShell, rRange, pUndoDoc ));
}
for( ::std::vector<ScRange>::const_iterator iIter( qDecreaseRange.begin()); iIter != qDecreaseRange.end(); ++iIter )
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index 01af186c1ea1..32704024a09c 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -902,6 +902,7 @@ public:
const ScCellMergeOption& rOption,
ScDocument* pNewUndoDoc );
ScUndoRemoveMerge( ScDocShell* pNewDocShell,
+ const ScRange& rRange,
ScDocument* pNewUndoDoc );
virtual ~ScUndoRemoveMerge() override;
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index ba29368f84b0..46b2ba31db27 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -2114,8 +2114,8 @@ ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell,
}
ScUndoRemoveMerge::ScUndoRemoveMerge( ScDocShell* pNewDocShell,
- ScDocument* pNewUndoDoc ) :
- ScBlockUndo( pNewDocShell, ScRange(), SC_UNDO_SIMPLE ),
+ const ScRange& rRange, ScDocument* pNewUndoDoc ) :
+ ScBlockUndo( pNewDocShell, rRange, SC_UNDO_SIMPLE ),
pUndoDoc( pNewUndoDoc )
{
}