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 13:51:37 +0000
commitc73a65db14f8ee57e382a04b0d38a704c0308458 (patch)
treee4e6493194c5b73be3f5113646e9aa23e288a16e
parent0e86210bc480de38919aacf709513f95fab26d35 (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>
-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())