[Libreoffice-commits] core.git: sc/source

Eike Rathke erack at redhat.com
Wed Oct 26 14:20:03 UTC 2016


 sc/source/ui/docshell/docfunc.cxx |    4 ++--
 sc/source/ui/inc/undoblk.hxx      |    1 +
 sc/source/ui/undo/undoblk.cxx     |    4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 0ebe9fab18e732468d2b9d53dddf9f266411a0e5
Author: Eike Rathke <erack at redhat.com>
Date:   Wed Oct 26 16:18:22 2016 +0200

    init ScUndoRemoveMerge with range, tdf#92117 follow-up
    
    So the original selection is restored after Undo.
    
    Change-Id: Ie549a0b62da469ee38270ae089ea5abf9a6868e3

diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 77c029f..4942c28 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 01af186..3270402 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 ba29368..46b2ba3 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 )
 {
 }


More information about the Libreoffice-commits mailing list