[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Feb 1 07:33:19 UTC 2019
sw/source/uibase/uiview/viewsrch.cxx | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
New commits:
commit 9a7d9366125374df07f6a0369a96ee2978f7f24c
Author: Martin van Zijl <martin.vanzijl at gmail.com>
AuthorDate: Mon Dec 17 13:06:26 2018 +1300
Commit: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Fri Feb 1 08:32:55 2019 +0100
tdf#44837 fix bug where replace all clears selection
Change-Id: I3b1c95439434fab55ffd159dce0aacded4551a07
Reviewed-on: https://gerrit.libreoffice.org/65291
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/sw/source/uibase/uiview/viewsrch.cxx b/sw/source/uibase/uiview/viewsrch.cxx
index 94eb878621ef..70b2bd98cf56 100644
--- a/sw/source/uibase/uiview/viewsrch.cxx
+++ b/sw/source/uibase/uiview/viewsrch.cxx
@@ -358,13 +358,15 @@ void SwView::ExecSearch(SfxRequest& rReq)
{ //Scope for SwWait-Object
SwWait aWait( *GetDocShell(), true );
m_pWrtShell->StartAllAction();
+
+ // i#8288 "replace all" should not change cursor
+ // position, so save current cursor
+ m_pWrtShell->Push();
+
if (!m_pSrchItem->GetSelection())
{
// if we don't want to search in the selection...
m_pWrtShell->KillSelection(nullptr, false);
- // i#8288 "replace all" should not change cursor
- // position, so save current cursor
- m_pWrtShell->Push();
if (SwDocPositions::Start == aOpts.eEnd)
{
m_pWrtShell->EndOfSection();
@@ -375,13 +377,10 @@ void SwView::ExecSearch(SfxRequest& rReq)
}
}
nFound = FUNC_Search( aOpts );
- if (!m_pSrchItem->GetSelection())
- {
- // create it just to overwrite it with stack cursor
- m_pWrtShell->CreateCursor();
- // i#8288 restore the original cursor position
- m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
- }
+ // create it just to overwrite it with stack cursor
+ m_pWrtShell->CreateCursor();
+ // i#8288 restore the original cursor position
+ m_pWrtShell->Pop(SwCursorShell::PopMode::DeleteCurrent);
m_pWrtShell->EndAllAction();
}
More information about the Libreoffice-commits
mailing list