summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-07-31 11:18:31 +0200
committerNoel Power <noel.power@novell.com>2012-08-01 10:32:15 +0100
commit88c0f4e9a28db4f2947c1c7469f54b76e88a3052 (patch)
tree7bfd662d4dfc11caabcf20228d72c24328d8341c
parent35080734323dbd740042ff159d71368b3739e97d (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 b204b92ec7ad..c2324aa71787 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -228,7 +228,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 eb5a205bbdc3..b8a8f590ab86 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -282,11 +282,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
{
@@ -1726,7 +1728,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 b951b32ddbd4..cfaf64becc42 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -1662,6 +1662,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();