summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-31 11:18:31 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-08-01 10:57:09 +0200
commit684539e19ef7a54afcb2c4f24ba966ec04a2ad87 (patch)
tree4815b39ce60ea70c553ed0c5405b39d90eb1ef66
parent5009c09737c36f078ecde32e8848b0d4ee37f7c1 (diff)
fdo#45724 fix WW8 export of textbox default background color
regression from 5609c512cd4d2899300b432d88d93cff05a05c87 Change-Id: I5f3ce73943b2805b7de1ae41699e605af9086b15
-rw-r--r--oox/inc/oox/ole/axcontrol.hxx3
-rw-r--r--oox/source/ole/axcontrol.cxx10
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
3 files changed, 10 insertions, 5 deletions
diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index da042b94010e..4c453c32dbd5 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -219,7 +219,8 @@ public:
void convertToMSColor(
PropertySet& rPropSet,
sal_Int32 nPropId,
- sal_uInt32& nOleColor ) const;
+ sal_uInt32& nOleColor,
+ sal_uInt32 nDefault = 0 ) const;
/** Converts the passed StdPic picture stream to UNO properties. */
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index 4e113af36b40..30aee564eebe 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -273,11 +273,13 @@ void ControlConverter::convertColor( PropertyMap& rPropMap, sal_Int32 nPropId, s
rPropMap.setProperty( nPropId, OleHelper::decodeOleColor( mrGraphicHelper, nOleColor, mbDefaultColorBgr ) );
}
-void ControlConverter::convertToMSColor( PropertySet& rPropSet, sal_Int32 nPropId, sal_uInt32& nOleColor ) const
+void ControlConverter::convertToMSColor( PropertySet& rPropSet, sal_Int32 nPropId, sal_uInt32& nOleColor, sal_uInt32 nDefault ) const
{
sal_uInt32 nRGB = 0;
- rPropSet.getProperty( nRGB, nPropId );
- nOleColor = OleHelper::encodeOleColor( nRGB );
+ if (rPropSet.getProperty( nRGB, nPropId ))
+ nOleColor = OleHelper::encodeOleColor( nRGB );
+ else
+ nOleColor = nDefault;
}
void ControlConverter::convertPicture( PropertyMap& rPropMap, const StreamDataSequence& rPicData ) const
{
@@ -1717,7 +1719,7 @@ void AxTextBoxModel::convertFromProperties( PropertySet& rPropSet, const Control
if ( rPropSet.getProperty( bRes, PROP_VScroll ) )
setFlag( mnScrollBars, AX_SCROLLBAR_VERTICAL, bRes );
- rConv.convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
+ rConv.convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor, 0x80000005L );
rConv.convertToAxBorder( rPropSet, mnBorderColor, mnBorderStyle, mnSpecialEffect );
AxMorphDataModelBase::convertFromProperties( rPropSet, rConv );
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 1c46ce1b3b10..e1061c087d0f 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1648,6 +1648,8 @@ void SwBasicEscherEx::WriteBrushAttr(const SvxBrushItem &rBrush,
bool lcl_isInHeader(const SwFrmFmt& rFmt)
{
const SwFlyFrmFmt* pFlyFrmFmt = dynamic_cast<const SwFlyFrmFmt*>(&rFmt);
+ if (!pFlyFrmFmt)
+ return false;
SwFlyFrm* pFlyFrm = const_cast<SwFlyFrm*>(pFlyFrmFmt->GetFrm());
SwPageFrm* pPageFrm = pFlyFrm->FindPageFrmOfAnchor();
SwFrm* pHeader = pPageFrm->Lower();