lotuswordpro/source/filter/lwplayout.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit a4e0d20c7eff8b053ec754b0a4b89dcb26636bf5
Author: Caolán McNamara <caol...@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 <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@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>();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to