diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-10-14 14:56:48 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-10-14 18:38:41 +0200 |
commit | 4e0241697371c40f4348bdfb6585a872d4cbcbf6 (patch) | |
tree | c134fbeb5d33c0e7d7cabd9a9e20fddf4406905f /sw/source/core/crsr | |
parent | 08cfb36321f6f090e6f0c29dd7c91005eb651c91 (diff) |
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.stahl@cib.de>
Diffstat (limited to 'sw/source/core/crsr')
-rw-r--r-- | sw/source/core/crsr/findattr.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 08d5b6d51e8d..7f35f3c37351 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -1190,9 +1190,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; } |