summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin van Zijl <martin.vanzijl@gmail.com>2018-12-17 13:06:26 +1300
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-02-01 08:32:55 +0100
commit9a7d9366125374df07f6a0369a96ee2978f7f24c (patch)
tree0a2bf438fa687f2a5ee60bc6a57f44a2aa3a9909
parent6ecca9cffc36ba6030bd511b41894c9bd105298b (diff)
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@cib.de>
-rw-r--r--sw/source/uibase/uiview/viewsrch.cxx19
1 files changed, 9 insertions, 10 deletions
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();
}