From dfdb7f9fcffe0b8594359c22277b64c7b6cdfd4c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 6 Mar 2019 18:38:37 +0100 Subject: [PATCH] tdf#123637 sw_redlinehide: fix iteration in SwCursorShell::GotoNextOutline() If nStartPos == size() and !bUseFirst. (regression from d0e9cc832d19b622532f01580d9cf78ee0b215db) Change-Id: I571d24ec5e9d4f2780e7c6d5c8cee09baeaffcc1 Reviewed-on: https://gerrit.libreoffice.org/68821 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/source/core/crsr/crstrvl.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index f99e4a7c2978..41f4cbe9f669 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1033,14 +1033,14 @@ bool SwCursorShell::GotoNextOutline() do { - if (nPos == rNds.GetOutLineNds().size()) - { - nPos = 0; - } - else if (!bUseFirst) + if (!bUseFirst) { ++nPos; } + if (rNds.GetOutLineNds().size() <= nPos) + { + nPos = 0; + } if (bUseFirst) {