diff options
-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; }; /** |