diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-26 21:21:22 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-03-28 13:00:27 +0200 |
commit | d7e64d62071757ee7613c82925d978a73b46a2f8 (patch) | |
tree | 859a85f716b733b4c34d9a591315478b30346d0d | |
parent | ee9cfb0703a60faaf50bec36e637bc592acca9a6 (diff) |
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@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit c2a9387ab259f12c7ee724f7f5be52b8d8f7ed64)
-rw-r--r-- | lotuswordpro/source/filter/lwpframelayout.cxx | 7 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwpframelayout.hxx | 1 |
2 files changed, 7 insertions, 1 deletions
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; }; /** |