Kaydet (Commit) ed8b5f2d authored tarafından Caolán McNamara's avatar Caolán McNamara

#99657# handle no fill correctly for export

üst c0279920
......@@ -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() )
{
......
......@@ -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;
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment