[Libreoffice-commits] core.git: lotuswordpro/source
Caolán McNamara
caolanm at redhat.com
Sun Feb 11 21:09:18 UTC 2018
lotuswordpro/source/filter/lwppara1.cxx | 6 ++++++
1 file changed, 6 insertions(+)
New commits:
commit 073a90a61d35c7444e520510a5a5865584aac1ce
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Feb 11 17:10:42 2018 +0000
ofz: Infinite-loop
Change-Id: Id745e6525728661c8ee536044f0a08c0f94445b7
Reviewed-on: https://gerrit.libreoffice.org/49564
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx
index 21b341df589a..14c1e7244f14 100644
--- a/lotuswordpro/source/filter/lwppara1.cxx
+++ b/lotuswordpro/source/filter/lwppara1.cxx
@@ -102,6 +102,8 @@
#include "lwpcelllayout.hxx"
#include "lwpframelayout.hxx"
+#include <set>
+
// boost::polymorphic_downcast checks and reports (using assert), if the
// cast is incorrect (in debug builds).
using boost::polymorphic_downcast;
@@ -166,12 +168,16 @@ LwpPara* LwpPara::GetParent()
if (level != 1)
{
pPara = dynamic_cast<LwpPara*>(GetPrevious().obj().get());
+ std::set<LwpPara*> aSeen;
while (pPara)
{
+ aSeen.insert(pPara);
otherlevel = pPara->GetLevel();
if ((otherlevel < level) || (otherlevel && (level == 0)))
return pPara;
pPara = dynamic_cast<LwpPara*>(pPara->GetPrevious().obj().get());
+ if (aSeen.find(pPara) != aSeen.end())
+ throw std::runtime_error("loop in conversion");
}
}
return nullptr;
More information about the Libreoffice-commits
mailing list