diff options
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.cxx | 15 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.hxx | 1 |
2 files changed, 13 insertions, 3 deletions
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; |