diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-03-11 10:38:46 +0000 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2016-03-14 08:47:28 +0000 |
commit | bbe20c198b7849f36a2602a53a81118f798e4d4f (patch) | |
tree | 7d8c0b13cddf9f5f9f59237f24bbcf580090c614 /lotuswordpro/source/filter/lwplayout.hxx | |
parent | Resolves: tdf#92067 with duplicate menu entries track which to activate (diff) | |
download | core-bbe20c198b7849f36a2602a53a81118f798e4d4f.tar.gz core-bbe20c198b7849f36a2602a53a81118f798e4d4f.zip |
treat ExtMargins with same recurse protection as Margins
Change-Id: I24640971ea6ca89878043966293492a991f01008
(cherry picked from commit bcecf9b13b7eee0e7c60a6827a310f8b38d13f69)
Reviewed-on: https://gerrit.libreoffice.org/23145
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
Diffstat (limited to 'lotuswordpro/source/filter/lwplayout.hxx')
-rw-r--r-- | lotuswordpro/source/filter/lwplayout.hxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 0456cfad1645..991dfac5fed7 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -99,7 +99,6 @@ public: inline virtual sal_uInt16 GetNumCols(){return 1;} virtual double GetColWidth(sal_uInt16 nIndex); virtual double GetColGap(sal_uInt16 nIndex); - virtual double GetExtMarginsValue(const sal_uInt8& /*nWhichSide*/){return 0;} virtual bool IsAutoGrow(){ return false;} virtual bool IsAutoGrowUp(){ return false;} virtual bool IsAutoGrowDown(){ return false;} @@ -154,6 +153,15 @@ public: m_bGettingMarginsValue = false; return fRet; } + double GetExtMarginsValue(const sal_uInt8& nWhichSide) + { + if (m_bGettingExtMarginsValue) + throw std::runtime_error("recursion in layout"); + m_bGettingExtMarginsValue = true; + auto fRet = ExtMarginsValue(nWhichSide); + m_bGettingExtMarginsValue = false; + return fRet; + } OUString GetStyleName(){ return m_StyleName;} bool IsComplex(); virtual bool IsAnchorPage(){ return false;} @@ -207,6 +215,7 @@ protected: virtual bool HonorProtection(); virtual bool IsProtected(); virtual double MarginsValue(const sal_uInt8& /*nWhichSide*/){return 0;} + virtual double ExtMarginsValue(const sal_uInt8& /*nWhichSide*/){return 0;} virtual bool MarginsSameAsParent(); protected: bool m_bGettingHonorProtection; @@ -214,6 +223,7 @@ protected: bool m_bGettingHasProtection; bool m_bGettingIsProtected; bool m_bGettingMarginsValue; + bool m_bGettingExtMarginsValue; sal_uInt32 m_nAttributes; sal_uInt32 m_nAttributes2; sal_uInt32 m_nAttributes3; @@ -323,8 +333,6 @@ class LwpMiddleLayout : public LwpVirtualLayout public: LwpMiddleLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm ); virtual ~LwpMiddleLayout(); - virtual double MarginsValue(const sal_uInt8& nWhichSide) override; - virtual double GetExtMarginsValue(const sal_uInt8& nWhichSide) override; LwpLayoutGeometry* GetGeometry() { if (m_bGettingGeometry) @@ -379,6 +387,8 @@ public: protected: void Read() override; virtual bool MarginsSameAsParent() override; + virtual double MarginsValue(const sal_uInt8& nWhichSide) override; + virtual double ExtMarginsValue(const sal_uInt8& nWhichSide) override; private: LwpObjectID m_BasedOnStyle; LwpLayoutGeometry* Geometry(); |