[Libreoffice-commits] core.git: lotuswordpro/source
Caolán McNamara
caolanm at redhat.com
Tue Feb 13 12:14:49 UTC 2018
lotuswordpro/source/filter/lwplayout.cxx | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
New commits:
commit a4e0d20c7eff8b053ec754b0a4b89dcb26636bf5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Feb 13 10:26:32 2018 +0000
ofz: better loop detection
Change-Id: I285358064ab9c02b5818bc0452ae3c35962778c6
Reviewed-on: https://gerrit.libreoffice.org/49630
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 5dc583dce675..b18896468f22 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -1314,18 +1314,17 @@ bool LwpMiddleLayout::IsProtected()
rtl::Reference<LwpVirtualLayout> LwpMiddleLayout::GetWaterMarkLayout()
{
rtl::Reference<LwpVirtualLayout> xLay(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
+ std::set<LwpVirtualLayout*> aSeen;
while (xLay.is())
{
+ aSeen.insert(xLay.get());
if (xLay->IsForWaterMark())
{
return xLay;
}
rtl::Reference<LwpVirtualLayout> xNext(dynamic_cast<LwpVirtualLayout*>(xLay->GetNext().obj().get()));
- if (xNext == xLay)
- {
- SAL_WARN("lwp", "loop in layout");
- break;
- }
+ if (aSeen.find(xNext.get()) != aSeen.end())
+ throw std::runtime_error("loop in conversion");
xLay = xNext;
}
return rtl::Reference<LwpVirtualLayout>();
More information about the Libreoffice-commits
mailing list