summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-09-02 15:13:33 +0100
committerAndras Timar <andras.timar@collabora.com>2015-09-19 21:31:50 +0200
commit84d8bd7261efd04905406fc7e87b24932b160d28 (patch)
treeca501b96b1c5eb59e0132efcbaf6572e2fdec15f /sw
parentb85ebedd4ecedef4caeb22ea2b3e128b44757755 (diff)
detect if new offsets are the same as the previous ones and avoid loop
Change-Id: I4c53d4bce9a69d79e34bdd634c296d9b495e1904 (cherry picked from commit 137cf76573c89ea1b0b1f716a50731419a187473) Reviewed-on: https://gerrit.libreoffice.org/18273 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 03bada1196b3..66baa458910c 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -413,6 +413,8 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP &rStartCp,
WW8PLCFxDesc aRes;
aRes.pMemPos = 0;
aRes.nEndPos = rStartCp;
+ bool bReadRes(false);
+ WW8PLCFxDesc aPrevRes;
while (pPap->HasFkp() && rStartCp != WW8_CP_MAX)
{
@@ -445,6 +447,13 @@ bool SwWW8ImplReader::SearchRowEnd(WW8PLCFx_Cp_FKP* pPap, WW8_CP &rStartCp,
}
pPap->GetSprms(&aRes);
pPap->SetDirty(false);
+ if (bReadRes && aRes.nEndPos == aPrevRes.nEndPos && aRes.nStartPos == aPrevRes.nStartPos)
+ {
+ SAL_WARN("sw.ww8", "SearchRowEnd, loop in paragraph property chain");
+ break;
+ }
+ bReadRes = true;
+ aPrevRes = aRes;
//Update our aRes to get the new starting point of the next properties
rStartCp = aRes.nEndPos;
}