lotuswordpro/source/filter/lwplayout.cxx | 15 ++++++++++++--- lotuswordpro/source/filter/lwplayout.hxx | 1 + 2 files changed, 13 insertions(+), 3 deletions(-)
New commits: commit 02c9756f52565e9c13507a9a4d60d33bc18609c4 Author: Caolán McNamara <caol...@redhat.com> Date: Tue May 8 12:43:47 2018 +0100 ofz#8161 avoid recurse to death Change-Id: If3fc212ed0fe2b3cb3c1381198d46387861ac3dd Reviewed-on: https://gerrit.libreoffice.org/53973 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index 166320b0c565..4423178aeeeb 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -84,6 +84,7 @@ LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader const &objHdr, LwpSvStream* p , m_bGettingExtMarginsValue(false) , m_bGettingUsePrinterSettings(false) , m_bGettingScaleCenter(false) + , m_bGettingBorderStuff(false) , m_bGettingUseWhen(false) , m_bGettingStyleLayout(false) , m_nAttributes(0) @@ -788,20 +789,28 @@ double LwpMiddleLayout::ExtMarginsValue(sal_uInt8 nWhichSide) */ LwpBorderStuff* LwpMiddleLayout::GetBorderStuff() { + if (m_bGettingBorderStuff) + throw std::runtime_error("recursion in layout"); + m_bGettingBorderStuff = true; + + LwpBorderStuff* pRet = nullptr; + if(m_nOverrideFlag & OVER_BORDERS) { LwpLayoutBorder* pLayoutBorder = dynamic_cast<LwpLayoutBorder*>(m_LayBorderStuff.obj().get()); - return pLayoutBorder ? &pLayoutBorder->GetBorderStuff() : nullptr; + pRet = pLayoutBorder ? &pLayoutBorder->GetBorderStuff() : nullptr; } else { rtl::Reference<LwpObject> xBase(GetBasedOnStyle()); if (LwpMiddleLayout* pLay = dynamic_cast<LwpMiddleLayout*>(xBase.get())) { - return pLay->GetBorderStuff(); + pRet = pLay->GetBorderStuff(); } } - return nullptr; + + m_bGettingBorderStuff= false; + return pRet; } /** diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index b3685f587945..2d0694b67864 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -238,6 +238,7 @@ protected: bool m_bGettingExtMarginsValue; bool m_bGettingUsePrinterSettings; bool m_bGettingScaleCenter; + bool m_bGettingBorderStuff; bool m_bGettingUseWhen; bool m_bGettingStyleLayout; sal_uInt32 m_nAttributes; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits