[Libreoffice-commits] core.git: Branch 'libreoffice-5-4' - sc/source
Dennis Francis
dennis.francis at collabora.co.uk
Thu Sep 7 12:18:44 UTC 2017
sc/source/ui/inc/undocell.hxx | 1 +
sc/source/ui/undo/undocell.cxx | 12 ++++++++++++
2 files changed, 13 insertions(+)
New commits:
commit f69cdbe0252a2c70a2a7db1157b06a3041bd39ad
Author: Dennis Francis <dennis.francis at collabora.co.uk>
Date: Wed Aug 30 18:14:15 2017 +0530
tdf#107952: Move cursor to changed cell after undo/redo in ScUndoSetCell
Change-Id: Id9f2ba2ed2d77f03c9bd56c41b958aa23921da0d
Reviewed-on: https://gerrit.libreoffice.org/42014
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Dennis Francis <dennis.francis at collabora.co.uk>
(cherry picked from commit f2c29539d52095ea7b914b20ef7f564469d2aa96)
Reviewed-on: https://gerrit.libreoffice.org/42036
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/ui/inc/undocell.hxx b/sc/source/ui/inc/undocell.hxx
index 2eca5ee23328..65a9ea6f22d8 100644
--- a/sc/source/ui/inc/undocell.hxx
+++ b/sc/source/ui/inc/undocell.hxx
@@ -158,6 +158,7 @@ public:
private:
void SetChangeTrack();
void SetValue( const ScCellValue& rVal );
+ void MoveCursorToCell();
private:
ScAddress maPos;
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index 0050bb6eeae3..a087a20d79c1 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -389,6 +389,7 @@ void ScUndoSetCell::Undo()
{
BeginUndo();
SetValue(maOldValue);
+ MoveCursorToCell();
pDocShell->PostPaintCell(maPos);
ScDocument& rDoc = pDocShell->GetDocument();
@@ -403,6 +404,7 @@ void ScUndoSetCell::Redo()
{
BeginRedo();
SetValue(maNewValue);
+ MoveCursorToCell();
pDocShell->PostPaintCell(maPos);
SetChangeTrack();
EndRedo();
@@ -471,6 +473,16 @@ void ScUndoSetCell::SetValue( const ScCellValue& rVal )
}
}
+void ScUndoSetCell::MoveCursorToCell()
+{
+ ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
+ if ( pViewShell )
+ {
+ pViewShell->SetTabNo( maPos.Tab() );
+ pViewShell->MoveCursorAbs( maPos.Col(), maPos.Row(), SC_FOLLOW_JUMP, false, false );
+ }
+}
+
ScUndoPageBreak::ScUndoPageBreak( ScDocShell* pNewDocShell,
SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
bool bNewColumn, bool bNewInsert ) :
More information about the Libreoffice-commits
mailing list