diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 20:27:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-01 20:27:56 +0000 |
commit | ad56a550864cbe86687abbea492af47b5ab5d7c6 (patch) | |
tree | 04e2c77431af04b325be529554b2e626cf26a1b1 /lotuswordpro | |
parent | d24dba40175256a317a3d2281c70d3240b74f4a0 (diff) |
ofz#6640 avoid recurse to death
Change-Id: Ia798636a5b4013753a268fff68915ec56c384e5f
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.cxx | 20 | ||||
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.hxx | 1 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index e753d4722725..014ff5563d16 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -83,6 +83,7 @@ LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader const &objHdr, LwpSvStream* p , m_bGettingExtMarginsValue(false) , m_bGettingUsePrinterSettings(false) , m_bGettingUseWhen(false) + , m_bGettingStyleLayout(false) , m_nAttributes(0) , m_nAttributes2(0) , m_nAttributes3(0) @@ -364,13 +365,22 @@ bool LwpVirtualLayout::NoContentReference() bool LwpVirtualLayout::IsStyleLayout() { + if (m_bGettingStyleLayout) + throw std::runtime_error("recursion in layout"); + m_bGettingStyleLayout = true; + + bool bRet = false; if (m_nAttributes3 & STYLE3_STYLELAYOUT) - return true; + bRet = true; + else + { + rtl::Reference<LwpVirtualLayout> xParent(dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get())); + if (xParent.is()) + bRet = xParent->IsStyleLayout(); + } - rtl::Reference<LwpVirtualLayout> xParent(dynamic_cast<LwpVirtualLayout*>(GetParent().obj().get())); - if (xParent.is()) - return xParent->IsStyleLayout(); - return false; + m_bGettingStyleLayout = false; + return bRet; } /** diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 5c6a5563a27c..94adf4ee6813 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -228,6 +228,7 @@ protected: bool m_bGettingExtMarginsValue; bool m_bGettingUsePrinterSettings; bool m_bGettingUseWhen; + bool m_bGettingStyleLayout; sal_uInt32 m_nAttributes; sal_uInt32 m_nAttributes2; sal_uInt32 m_nAttributes3; |