sw/source/core/crsr/findattr.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 9a5fd659873450a59309f71082a67fa9e74fcf47
Author:     Michael Stahl <michael.st...@cib.de>
AuthorDate: Mon Oct 14 14:56:48 2019 +0200
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Thu Oct 17 15:52:09 2019 +0200

    tdf#128138 sw_redlinehide: fix infinite loop in FindAttrsImpl()
    
    The code looked wrong previously, always assigning the end of the text
    node regardless of direction, but it turns out the improvement caused an
    infinite loop... let's just swap things after the loop, seems simpler
    than adding another if at the assignments.
    
    (regression from 4caef398af256be5f0c2a159129b528ee3702e5c)
    
    Change-Id: I098f5265fa86d6a2511a80a02230899a7a303a88
    Reviewed-on: https://gerrit.libreoffice.org/80774
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@cib.de>
    (cherry picked from commit 4e0241697371c40f4348bdfb6585a872d4cbcbf6)
    Reviewed-on: https://gerrit.libreoffice.org/80876
    Reviewed-by: Xisco FaulĂ­ <xiscofa...@libreoffice.org>
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>
    Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index c77dc2065979..47c1f676ecb5 100644
--- a/sw/source/core/crsr/findattr.cxx
+++ b/sw/source/core/crsr/findattr.cxx
@@ -1198,9 +1198,12 @@ static bool FindAttrsImpl(SwPaM & rSearchPam,
         }
     }
 
-    // if backward search, switch point and mark
-    if( bFound && !bSrchForward )
-        rSearchPam.Exchange();
+    // in search direction, mark precedes point, because the next iteration
+    // starts at point
+    if (bFound)
+    {
+        rSearchPam.Normalize(!bSrchForward);
+    }
 
     return bFound;
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to