summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2013-05-27 18:55:05 +0100
committerMichael Stahl <mstahl@redhat.com>2013-06-04 15:50:53 +0200
commit660f54347433b05cb2d0ab081ddf6209aff47cd2 (patch)
tree1e8d610f5d9551d26c79156b83cce902c544a44c
parent27f64bb866037c0321966bdb0c96cac92db2a208 (diff)
fdo#65014 Fix backwards/forwards search change of direction.
Begin a search from the extremity of the selected region instead of from the cursor position. Previously when changing search direction the first "result" is the same as has been previously found when searching forwards as the cursor is at the end of the selection, and the search region is from the end of the previous result to the begin of the document. Now the selected or previously found region is ignored. This only affects normal searches, and does not have any effect when multiple regions are selected. Change-Id: I65a5d94b898dd4b7467889b1932f42c9b6b523fe Reviewed-on: https://gerrit.libreoffice.org/4061 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit c73a65db14f8ee57e382a04b0d38a704c0308458) Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/source/ui/uiview/viewsrch.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index fce4d50f65f7..7e07a36abff9 100644
--- a/sw/source/ui/uiview/viewsrch.cxx
+++ b/sw/source/ui/uiview/viewsrch.cxx
@@ -444,6 +444,13 @@ sal_Bool SwView::SearchAndWrap(sal_Bool bApi)
// aus 'Suche alle'
m_pWrtShell->StartAllAction();
m_pWrtShell->Push();
+
+ // fdo#65014 : Ensure that the point of the cursor is at the extremity of the
+ // selection closest to the end being searched to as to exclude the selected
+ // region from the search. (This doesn't work in the case of multiple
+ // selected regions as the cursor doesn't mark the selection in that case.)
+ m_pWrtShell->GetCrsr()->Normalize( m_pSrchItem->GetBackward() );
+
// falls in selektierten Bereichen gesucht werden soll, duerfen sie
// nicht aufgehoben werden
if (!m_pSrchItem->GetSelection())