[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Mon Mar 27 12:07:34 UTC 2017


 lotuswordpro/source/filter/lwpframelayout.cxx |    7 ++++++-
 lotuswordpro/source/filter/lwpframelayout.hxx |    1 +
 2 files changed, 7 insertions(+), 1 deletion(-)

New commits:
commit c2a9387ab259f12c7ee724f7f5be52b8d8f7ed64
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Mar 26 21:21:22 2017 +0100

    ofz#944 avoid recurse to death
    
    (cherry picked from commit 7eb92eea21e2af47b17c9901107f6e4833567928)
    
    Change-Id: I27ed8cf5e8296a1ad91c33614913fc7af4a56d45
    Reviewed-on: https://gerrit.libreoffice.org/35724
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx
index ef95f678ad2a..d1616b815a03 100644
--- a/lotuswordpro/source/filter/lwpframelayout.cxx
+++ b/lotuswordpro/source/filter/lwpframelayout.cxx
@@ -761,7 +761,7 @@ void LwpFrameLink::Read(LwpObjectStream* pStrm)
 }
 
 LwpFrameLayout::LwpFrameLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
-    : LwpPlacableLayout(objHdr, pStrm), m_pFrame(nullptr)
+    : LwpPlacableLayout(objHdr, pStrm), m_pFrame(nullptr), m_bGettingMaxWidth(false)
 {
 }
 
@@ -946,6 +946,10 @@ double LwpFrameLayout::GetWidth()
  */
 double LwpFrameLayout::GetMaxWidth()
 {
+    if (m_bGettingMaxWidth)
+        throw std::runtime_error("recursive GetMaxWidth");
+
+    m_bGettingMaxWidth = true;
     double fActualWidth = 0;
     rtl::Reference<LwpVirtualLayout> xLayout(GetContainerLayout());
     LwpMiddleLayout* pParent = dynamic_cast<LwpMiddleLayout*>(xLayout.get());
@@ -974,6 +978,7 @@ double LwpFrameLayout::GetMaxWidth()
         fActualWidth = fParentWidth - fXOffset - fParentMarginRight - fWrapRight;
     }
 
+    m_bGettingMaxWidth = false;
     return fActualWidth;
 }
 
diff --git a/lotuswordpro/source/filter/lwpframelayout.hxx b/lotuswordpro/source/filter/lwpframelayout.hxx
index 99b3a215ccc3..5b11c146e0f4 100644
--- a/lotuswordpro/source/filter/lwpframelayout.hxx
+++ b/lotuswordpro/source/filter/lwpframelayout.hxx
@@ -141,6 +141,7 @@ private:
 private:
     LwpFrameLink m_Link;
     LwpFrame* m_pFrame;
+    bool m_bGettingMaxWidth;
 };
 
 /**


More information about the Libreoffice-commits mailing list