diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 10:12:12 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 13:55:31 +0100 |
commit | ac3f35a9572e12cb22b731683d02af6714174551 (patch) | |
tree | 88aafa551e4b1b82b03a0d9e04f11c974535b695 /lotuswordpro | |
parent | e85aa0cc8b306c2f5ca6240b99e1704f772dbebb (diff) |
ofz: infinite loop
Change-Id: I15a0cbc5d4896e5390f5d422fb993325f22eedee
Reviewed-on: https://gerrit.libreoffice.org/50557
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwppara.cxx | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/lotuswordpro/source/filter/lwppara.cxx b/lotuswordpro/source/filter/lwppara.cxx index 54f1246749a6..d84fbb59d8b8 100644 --- a/lotuswordpro/source/filter/lwppara.cxx +++ b/lotuswordpro/source/filter/lwppara.cxx @@ -96,6 +96,7 @@ #include <lwpdropcapmgr.hxx> #include "lwptable.hxx" #include <memory> +#include <set> LwpPara::LwpPara(LwpObjectHeader const & objHdr, LwpSvStream* pStrm) : LwpDLVList(objHdr, pStrm) @@ -531,16 +532,10 @@ void LwpPara::RegisterStyle() } bool bHeading = pNumbering->IsHeading(); + std::set<LwpPara*> aSeen; while(true) { - /*// When we hit the hint paragraph, we can stop and check the hint. - if (qNumberHint && (qPara == qNumberHint->GetPara()) && - qNumberHint->Lookup(qSilverBullet, Level, Position, &Offset)) - { - Num += Offset; - break; - }*/ - + aSeen.insert(pPara); LwpSilverBullet* pParaSilverBullet = pPara->GetSilverBullet(); pNumbering = pPara->GetParaNumbering(); @@ -580,18 +575,6 @@ void LwpPara::RegisterStyle() } } } - - /*if (qSpecificStyle - && qSpecificStyle == qPara->GetParaStyle(LTRUE)) - break; - - // See if we crossed a section boundary - if (ResetSection) - { - CurrPos.SetPara(qPara); - if (CurrPos <= SectionPos) - break; - }*/ } // Don't bump the number if this bullet is skipped @@ -642,6 +625,8 @@ void LwpPara::RegisterStyle() } } pPara = pPrePara; + if (aSeen.find(pPara) != aSeen.end()) + throw std::runtime_error("loop in conversion"); } nNum = nNum ? nNum : 1; |