[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - sw/source

Andrzej J.R. Hunt andrzej at ahunt.org
Tue Jun 4 06:55:15 PDT 2013


 sw/source/ui/uiview/viewsrch.cxx |    7 +++++++
 1 file changed, 7 insertions(+)

New commits:
commit 660f54347433b05cb2d0ab081ddf6209aff47cd2
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon May 27 18:55:05 2013 +0100

    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 at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>
    (cherry picked from commit c73a65db14f8ee57e382a04b0d38a704c0308458)
    
    Signed-off-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sw/source/ui/uiview/viewsrch.cxx b/sw/source/ui/uiview/viewsrch.cxx
index fce4d50..7e07a36 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())


More information about the Libreoffice-commits mailing list