From 7055ad90927d0d2e0dc5eab3774322e386fe2b15 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Sun, 30 Jan 2022 00:56:48 +0100 Subject: Resolves: tdf#146994 InitOwnBlockMode() with current mark range or cursor pos This sets specifically the end position to the correct value. The start position and dependent logic if meBlockMode==Own is re-initialized in MarkCursor() via InitBlockMode(). Unfortunately that (calling MarkCursor()) happens after the end position was incremented in ExpandBlock(), previous with the wrong values. This new own block mode init now also makes it possible to expand/shrink the marked range after a paste or undo/redo, as it would be expected for any existing selection. Change-Id: Id26e4aa32896ec0c714e33b99dbf6702df144995 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129158 Reviewed-by: Eike Rathke Tested-by: Jenkins --- sc/source/ui/view/viewfun2.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sc/source/ui/view/viewfun2.cxx') diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index fd19f833540d..49b8fc14f30f 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -2008,7 +2008,7 @@ bool ScViewFunc::SearchAndReplace( const SvxSearchItem* pSearchItem, } DoneBlockMode(true); // don't delete mark - InitOwnBlockMode(); + InitOwnBlockMode( ScRange( nCol, nRow, nStartTab, nCol, nRow, nEndTab)); // If search starts at the beginning don't ask again whether it shall start at the beginning bool bFirst = true; @@ -2359,7 +2359,7 @@ void ScViewFunc::UseScenario( const OUString& rName ) SCTAB nTab = GetViewData().GetTabNo(); DoneBlockMode(); - InitOwnBlockMode(); + InitOwnBlockMode( ScRange( GetViewData().GetCurX(), GetViewData().GetCurY(), nTab)); pDocSh->UseScenario( nTab, rName ); } -- cgit