diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-06-14 13:30:57 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-06-15 10:09:51 +0200 |
commit | f258f89a96ff6521ae75ae67a0cef9b29f01434d (patch) | |
tree | a7dcd29c2d513b212bfffb10e075395ceec06097 /sw | |
parent | f0bd2e796de731fd5172171acc0e68e4fd559be3 (diff) |
n#325936 fix ww8 export of not-in-background anchored images in header
Regression from commit 2ad707b3, which only updated the import, but
forgot to remove the fake "in background" property on export.
Change-Id: I2b42c5fa7873d946b10d311800049586bc214071
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 477eaa4c4d60..e47d88105e92 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -75,6 +75,8 @@ #include <fmtfollowtextflow.hxx> // #i30669# #include <dcontact.hxx> #include <frmfmt.hxx> +#include <flyfrm.hxx> +#include <pagefrm.hxx> #include <fmtcntnt.hxx> #include <ndindex.hxx> #include <doc.hxx> @@ -1656,6 +1658,25 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush, } } +bool lcl_isInHeader(const SwFrmFmt& rFmt) +{ + const SwFlyFrmFmt* pFlyFrmFmt = dynamic_cast<const SwFlyFrmFmt*>(&rFmt); + SwFlyFrm* pFlyFrm = const_cast<SwFlyFrm*>(pFlyFrmFmt->GetFrm()); + SwPageFrm* pPageFrm = pFlyFrm->FindPageFrmOfAnchor(); + SwFrm* pHeader = pPageFrm->Lower(); + if (pHeader->GetType() == FRM_HEADER) + { + const SwFrm* pFrm = pFlyFrm->GetAnchorFrm(); + while (pFrm) + { + if (pFrm == pHeader) + return true; + pFrm = pFrm->GetUpper(); + } + } + return false; +} + sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt, MSO_SPT eShapeType, EscherPropertyContainer& rPropOpt) { @@ -1746,8 +1767,14 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt, WriteBrushAttr(aBrush, rPropOpt); const SdrObject* pObj = rFmt.FindRealSdrObject(); + + // SwWW8ImplReader::Read_GrafLayer() imports these as opaque + // unconditionally, so if both are true, don't export the property. + bool bIsInHeader = lcl_isInHeader(rFmt); + bool bIsThrought = rFmt.GetSurround().GetValue() == SURROUND_THROUGHT; + if( pObj && (pObj->GetLayer() == GetHellLayerId() || - pObj->GetLayer() == GetInvisibleHellId() )) + pObj->GetLayer() == GetInvisibleHellId() ) && !(bIsInHeader && bIsThrought)) { rPropOpt.AddOpt( ESCHER_Prop_fPrint, 0x200020 ); } |