From bcecf9b13b7eee0e7c60a6827a310f8b38d13f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 11 Mar 2016 10:38:46 +0000 Subject: [PATCH] tweat ExtMargins with same recurse protection as Margins Change-Id: I24640971ea6ca89878043966293492a991f01008 --- lotuswordpro/qa/cppunit/data/fail/recurse-1.lwp | Bin 0 -> 15975 bytes lotuswordpro/source/filter/lwplayout.cxx | 5 +++-- lotuswordpro/source/filter/lwplayout.hxx | 16 +++++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 lotuswordpro/qa/cppunit/data/fail/recurse-1.lwp diff --git a/lotuswordpro/qa/cppunit/data/fail/recurse-1.lwp b/lotuswordpro/qa/cppunit/data/fail/recurse-1.lwp new file mode 100644 index 0000000000000000000000000000000000000000..ffc7a44e346a1d2344f3f044df74b59eefa11deb GIT binary patch literal 15975 zcmdse33yybmF_)Nw>NdSHcPf_C)SlMZ`!QI@s`E6w7JWhT8m>lBt&hgWy{vS#F7bP z$6o+Ddx9}>GVg_efiRCZBtyPom`Nsm6*~!F$U-1M!Xt!v!+h_t4a@*DK>GdXwpwZ_ z&XD=$o9~ev^1HRE0vm9AmZQ z@BPo6uOVaW7Q-kq78-lO#R40vBR(-^HTU+#*EKfRpEk~uGQ@dGkS(IAH$^L5C};=n zS62Ixc;DFIz;}P~$fn0@KC#K)O13TSupPXky+1ZGwktL|79WY2wovW6BB*j|rizPH z?U9h3b-HnUper_DH4jd>*v964B3hJ{5JRSo+jq>~2BW6NX712Ffczd7BAoCKb+JsH zrj56Y@lIo8R$`fb#h>okt*>utYgapOZr`QaI(Dh{j;6Mon;LaTOB?fS-{ta@@0I73 z_R@!Ed8(Z|Z*J*`pn++Y9$Ri`>1cC#LUZp;PH5-!jCNQk)$THItN-ziX8VjYRBwny z1rDLjR%)mZ=et7|NYIcO{2XpeLy-3=b>U6z)cu3YnX0t?H0O77Tf?#xgktPjtVfQ~_Nwa%e))L*N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?X^t zxt3N7^}iNtkEIt|y42F^EWOFnH<#%9OucWR&ReCwwNP&g>%2l8F3>j$y+!DV(8q*+ z!_=Fk{+!TWsY|53N9c3Q^?xhSKPu2>jrNB1(?Wl?P*VwIj@Xn)eBK?gPaW|KpXZS2 zMoZfCMnt{vitT=%xjSTsgQ}P2ve^p!8ER)~C-}6ckHDKM#zL?}$R8%h|9+rxb615TW zJ|Z%=lYh0|zgj1k>jzeAdzD^Xrhl2EKjg<#SNf+yU+>o!{JOJTpUTxA3g{aGIuy_c zD|CLI-czYZ^Ym~)AFb5i&C@-V`nr7m1;2hUpdSzD#!CHozJ5KR|Iw$fuh1`Ax@v{~ zLqO+e=`vI2n)+X*{`neRR;C|Yt`D!)FO}w`i4pkH?cb(vq^n4`a#qo07;Wb0eA z^#M!YxIhmU>L(ZIYYX*{7wQ)a^=C|7U84W8R6kszPc7Gfm!)r6rJJ+#t0npuLH*I7 z?#$8)gZf)R{UxcJD)iOm`ZsI!H9`Grzg{2EB|?8t>g`e=kUF$TZ(5|4sizj{pDof$ ziga_4e!NKUTC6WF)|E^2Uo6qTU7|~u>a$Dr@+i`so$v7ORIEk zmEKjQ`>OQ1knRlW$&h}eN`JLVf454%Z=L?oI(>IYpAYFX>vW)6cU0@+)%u=l{d7n_ zR;|Ao(*GxKL@|1RN9jR1hjIxeiDH}s9;FB69Lgn>B#Lnfc$6NL zb10Wkk|_9sJiw!zL%D>KL}BUcPsj&cs=5=s&UGNEPQQO==ULcxvzV*b~Dz4rgz>y*#` LU-0!GQ}h1=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 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();