[Libreoffice-commits] core.git: lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Mon Jun 19 11:49:37 UTC 2017


 lotuswordpro/source/filter/lwplayout.cxx |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 8b1bc1a3f55d4b79b46ef91f1ac51a5f610d46d6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 19 12:48:40 2017 +0100

    ofz: loop in layout
    
    Change-Id: I7c776d3b02bd8d35f160e82916213e402e9c88ab

diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 373c6f34f9b5..8d157ddfb291 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -367,19 +367,25 @@ bool LwpVirtualLayout::IsStyleLayout()
 LwpVirtualLayout* LwpVirtualLayout::FindChildByType(LWP_LAYOUT_TYPE eType)
 {
     LwpObjectID& rID = GetChildHead();
+    LwpVirtualLayout* pPrevLayout = nullptr;
 
     while(!rID.IsNull())
     {
         LwpVirtualLayout * pLayout = dynamic_cast<LwpVirtualLayout *>(rID.obj().get());
         if (!pLayout)
+            break;
+
+        if (pPrevLayout && pLayout == pPrevLayout)
         {
+            SAL_WARN("lwp", "loop in layout");
             break;
         }
 
+        pPrevLayout = pLayout;
+
         if (pLayout->GetLayoutType() == eType)
-        {
             return pLayout;
-        }
+
         rID = pLayout->GetNext();
     }
 


More information about the Libreoffice-commits mailing list