lotuswordpro/source/filter/lwplayout.cxx | 14 ++++++++++---- lotuswordpro/source/filter/lwplayout.hxx | 1 + 2 files changed, 11 insertions(+), 4 deletions(-)
New commits: commit d62d6d661c694b167b2eb303dd43839d45f69150 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Dec 12 09:51:55 2017 +0000 ofz#4600 avoid recurse to death Change-Id: I3cdced8294b30df5936bf7e167ca8a4950dde652 Reviewed-on: https://gerrit.libreoffice.org/46285 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Michael Stahl <mst...@redhat.com> diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 27dbc48cc9b8..cb9a170159b3 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -1947,6 +1947,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) @@ -2002,19 +2003,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 2f23271a28a2..1c10f59f3feb 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -496,6 +496,7 @@ public: protected: void Read() override; protected: + bool m_bGettingWrapType; sal_uInt8 m_nWrapType; sal_uInt8 m_nBuoyancy; sal_Int32 m_nBaseLineOffset;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits