summaryrefslogtreecommitdiff
path: root/lotuswordpro/source
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx5
-rw-r--r--lotuswordpro/source/filter/lwplayout.hxx16
2 files changed, 16 insertions, 5 deletions
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index de77f9c421f4..f8631da0fd38 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -83,6 +83,7 @@ LwpVirtualLayout::LwpVirtualLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm)
, m_bGettingHasProtection(false)
, m_bGettingIsProtected(false)
, m_bGettingMarginsValue(false)
+ , m_bGettingExtMarginsValue(false)
, m_nAttributes(0)
, m_nAttributes2(0)
, m_nAttributes3(0)
@@ -776,7 +777,7 @@ double LwpMiddleLayout::MarginsValue(const sal_uInt8 &nWhichSide)
* @param:
* @return:
*/
-double LwpMiddleLayout::GetExtMarginsValue(const sal_uInt8 &nWhichSide)
+double LwpMiddleLayout::ExtMarginsValue(const sal_uInt8 &nWhichSide)
{
double fValue = 0;
if(m_nOverrideFlag & OVER_MARGINS)
@@ -794,7 +795,7 @@ double LwpMiddleLayout::GetExtMarginsValue(const sal_uInt8 &nWhichSide)
fValue = pStyle->GetExtMarginsValue(nWhichSide);
return fValue;
}
- return LwpVirtualLayout::GetExtMarginsValue(nWhichSide);
+ return LwpVirtualLayout::ExtMarginsValue(nWhichSide);
}
/**
* @descr: Get the LwpBorderStuff object according to m_LayBorderStuff id.
diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx
index ee46b3d5340d..6102b071623a 100644
--- a/lotuswordpro/source/filter/lwplayout.hxx
+++ b/lotuswordpro/source/filter/lwplayout.hxx
@@ -103,7 +103,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;}
@@ -158,6 +157,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;}
@@ -211,6 +219,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;
@@ -218,6 +227,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;
@@ -328,8 +338,6 @@ class LwpMiddleLayout : public LwpVirtualLayout
public:
LwpMiddleLayout( LwpObjectHeader &objHdr, LwpSvStream* pStrm );
virtual ~LwpMiddleLayout();
- virtual double MarginsValue(const sal_uInt8& nWhichSide) SAL_OVERRIDE;
- virtual double GetExtMarginsValue(const sal_uInt8& nWhichSide) SAL_OVERRIDE;
LwpLayoutGeometry* GetGeometry()
{
if (m_bGettingGeometry)
@@ -385,6 +393,8 @@ public:
protected:
void Read() SAL_OVERRIDE;
virtual bool MarginsSameAsParent() SAL_OVERRIDE;
+ virtual double MarginsValue(const sal_uInt8& nWhichSide) SAL_OVERRIDE;
+ virtual double ExtMarginsValue(const sal_uInt8& nWhichSide) SAL_OVERRIDE;
private:
LwpObjectID m_BasedOnStyle;
LwpLayoutGeometry* Geometry();