tdf#157663 SW: reenable move recognition improvements
Re-enabled the improvement of move recognition in redlines, that
is able to recognize movements split into more redlines.
Probably it does not effect performance too much, but if in some cases
it would become a problem then this small patch can be reverted easily.
Change-Id: I6598d4d4f98f472f3972aec41b82ec26d90db860
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158455
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158612
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 02ded9b..26a3c7b 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -908,11 +908,7 @@ bool SwRedlineTable::isMoved(size_type rPos) const
if (isMovedImpl(rPos, false))
return true;
else
{
// Commented out because of probably performance issue
//return isMovedImpl(rPos, true);
return false;
}
return isMovedImpl(rPos, true);
}
bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const
@@ -982,7 +978,7 @@ bool SwRedlineTable::isMovedImpl(size_type rPos, bool bTryCombined) const
size_type nStart = rPos > nLookahead ? rPos - nLookahead : 0;
// first, try to compare to single redlines
// next, try to compare to combined redlines
for (int nPass = 0; nPass < (bTryCombined ? 2 : 1) && !bRet; nPass++)
for (int nPass = 0; nPass < 2 && !bRet; nPass++)
{
for (size_type nPosAct = nStart; nPosAct < nEnd && !bRet; ++nPosAct)
{