diff options
author | Caolán McNamara <cmc@openoffice.org> | 2002-09-19 12:54:59 +0000 |
---|---|---|
committer | Caolán McNamara <cmc@openoffice.org> | 2002-09-19 12:54:59 +0000 |
commit | ed8b5f2debac216243930aba0873e0d75de8d0dd (patch) | |
tree | 54cd0e35bb80cbcc1ce2da3eb321d3b1fa9c5dd7 | |
parent | c0279920c0473a5a308af3bc079550702b83b582 (diff) |
#99657# handle no fill correctly for export
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 71 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 7 |
3 files changed, 76 insertions, 10 deletions
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 35273ce73f71..370232d08acb 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtw8esh.cxx,v $ * - * $Revision: 1.46 $ + * $Revision: 1.47 $ * - * last change: $Author: cmc $ $Date: 2002-09-19 12:33:53 $ + * last change: $Author: cmc $ $Date: 2002-09-19 13:54:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1412,7 +1412,11 @@ INT32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrmFmt& rFmt, MSO_SPT eShapeTyp rPropOpt.AddOpt( ESCHER_Prop_dxTextRight, 0 ); } +#if 0 if (SFX_ITEM_SET == rFmt.GetItemState(RES_BACKGROUND, true, &pItem)) +#else + if (pItem = rWrt.TrueFrameBgBrush(rFmt)) +#endif { if( ((SvxBrushItem*)pItem)->GetGraphic() ) { diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 3cf5b7c56a8f..941b078b84f2 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtw8nds.cxx,v $ * - * $Revision: 1.37 $ + * $Revision: 1.38 $ * - * last change: $Author: cmc $ $Date: 2002-09-19 12:33:53 $ + * last change: $Author: cmc $ $Date: 2002-09-19 13:54:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1195,11 +1195,11 @@ short SwWW8Writer::TrueFrameDirection(const SwFrmFmt &rFlyFmt) const { pItem = 0; const SwFmtAnchor* pAnchor = &pFlyFmt->GetAnchor(); - if( FLY_PAGE != pAnchor->GetAnchorId() && - pAnchor->GetCntntAnchor() ) + if (FLY_PAGE != pAnchor->GetAnchorId() && + pAnchor->GetCntntAnchor()) { - pFlyFmt = pAnchor->GetCntntAnchor()->nNode. - GetNode().GetFlyFmt(); + pFlyFmt = + pAnchor->GetCntntAnchor()->nNode.GetNode().GetFlyFmt(); } else pFlyFmt = 0; @@ -1218,6 +1218,65 @@ short SwWW8Writer::TrueFrameDirection(const SwFrmFmt &rFlyFmt) const return nRet; } +const SvxBrushItem* SwWW8Writer::GetCurrentPageBgBrush() const +{ + const SwFrmFmt &rFmt = pAktPageDesc + ? pAktPageDesc->GetMaster() + : pDoc->GetPageDesc(0).GetMaster(); + + const SfxPoolItem* pItem = 0; + //If not set, or "no fill", get real bg + SfxItemState eState = rFmt.GetItemState(RES_BACKGROUND, true, &pItem); + + const SvxBrushItem* pRet = (const SvxBrushItem*)pItem; + if (SFX_ITEM_SET != eState || (!pRet->GetGraphic() && + pRet->GetColor() == COL_TRANSPARENT)) + { + pRet = (const SvxBrushItem*) + &pDoc->GetAttrPool().GetDefaultItem(RES_BACKGROUND); + } + return pRet; +} + +const SvxBrushItem* SwWW8Writer::TrueFrameBgBrush(const SwFrmFmt &rFlyFmt) const +{ + const SwFrmFmt *pFlyFmt = &rFlyFmt; + const SvxBrushItem* pRet = 0; + + while (pFlyFmt) + { + //If not set, or "no fill", get real bg + const SfxPoolItem* pItem = 0; + SfxItemState eState = + pFlyFmt->GetItemState(RES_BACKGROUND, true, &pItem); + pRet = (const SvxBrushItem*)pItem; + if (SFX_ITEM_SET != eState || (!pRet->GetGraphic() && + pRet->GetColor() == COL_TRANSPARENT)) + { + pRet = 0; + const SwFmtAnchor* pAnchor = &pFlyFmt->GetAnchor(); + if (FLY_PAGE != pAnchor->GetAnchorId() && + pAnchor->GetCntntAnchor()) + { + pFlyFmt = + pAnchor->GetCntntAnchor()->nNode.GetNode().GetFlyFmt(); + } + else + pFlyFmt = 0; + } + else + pFlyFmt = 0; + } + + if (!pRet) + pRet = GetCurrentPageBgBrush(); + + ASSERT(pRet && + (pRet->GetGraphic() || pRet->GetColor() != COL_TRANSPARENT), + "leaving with no real brush"); + return pRet; +} + Writer& OutWW8_SwTxtNode( Writer& rWrt, SwCntntNode& rNode ) { SwWW8Writer& rWW8Wrt = (SwWW8Writer&)rWrt; diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index b9e6a3a794ff..5d67c90a1cbb 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -2,9 +2,9 @@ * * $RCSfile: wrtww8.hxx,v $ * - * $Revision: 1.35 $ + * $Revision: 1.36 $ * - * last change: $Author: cmc $ $Date: 2002-09-19 12:33:54 $ + * last change: $Author: cmc $ $Date: 2002-09-19 13:54:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -169,6 +169,7 @@ class SwMSConvertControls; class WW8OleMaps; class SvStorageRef; struct WW8_PdAttrDesc; +class SvxBrushItem; #define WWFL_ULSPACE_LIKE_SWG 0x00000001 #define WWFL_NO_GRAF 0x00000080 @@ -524,6 +525,8 @@ public: void WritePostItBegin( WW8Bytes* pO = 0 ); short TrueFrameDirection(const SwFrmFmt &rFlyFmt) const; short GetCurrentPageDirection() const; + const SvxBrushItem* GetCurrentPageBgBrush() const; + const SvxBrushItem* TrueFrameBgBrush(const SwFrmFmt &rFlyFmt) const; void OutWW8FlyFrmsInCntnt( const SwTxtNode& rNd ); void OutWW8FlyFrm( const SwFrmFmt& rFlyFrmFmt, const Point& rNdTopLeft ); void OutFlyFrms( const SwCntntNode& rNode ); |