diff options
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.cxx | 14 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.hxx | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 30ec9d0a4805..b746a2d94c1e 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -1915,6 +1915,7 @@ rtl::Reference<LwpVirtualLayout> LwpLayout::GetContainerLayout() LwpPlacableLayout::LwpPlacableLayout( LwpObjectHeader const &objHdr, LwpSvStream* pStrm ) : LwpLayout(objHdr, pStrm) + , m_bGettingWrapType(false) , m_nWrapType(0) , m_nBuoyancy(0) , m_nBaseLineOffset(0) @@ -1970,19 +1971,24 @@ void LwpPlacableLayout::Read() */ sal_uInt8 LwpPlacableLayout::GetWrapType() { - if(m_nOverrideFlag & OVER_PLACEMENT) + if (m_bGettingWrapType) + throw std::runtime_error("recursion in layout"); + m_bGettingWrapType = true; + sal_uInt8 nWrapType = LAY_WRAP_AROUND; + if (m_nOverrideFlag & OVER_PLACEMENT) { - return m_nWrapType; + nWrapType = m_nWrapType; } else { rtl::Reference<LwpObject> xBase(GetBasedOnStyle()); if (LwpPlacableLayout* pLay = dynamic_cast<LwpPlacableLayout*>(xBase.get())) { - return pLay->GetWrapType(); + nWrapType = pLay->GetWrapType(); } } - return LAY_WRAP_AROUND; + m_bGettingWrapType = false; + return nWrapType; } /** * @descr: get LayoutRelativity diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index cd84af5b380b..387d68488fd5 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -493,6 +493,7 @@ public: protected: void Read() override; protected: + bool m_bGettingWrapType; sal_uInt8 m_nWrapType; sal_uInt8 m_nBuoyancy; sal_Int32 m_nBaseLineOffset; |