diff options
author | Noel Power <noel.power@suse.com> | 2013-06-26 10:36:53 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-06-26 16:45:29 +0100 |
commit | 0a686a9bb54b5c1b3a45810e2601a098c0272c33 (patch) | |
tree | 4feb4c990502743544c312a074269c64702e6e9f /oox/source | |
parent | f38487511957971f9d08dd5c9af8f8128371540e (diff) |
tweak ppt ole import for libreoffice codebase
a) make sure backcolor is skipped when libreoffice backcolor
is default. Libreoffice default is 0 ( but if we write that out mso
reads it as black )
b) don't take the label default backcolor in exchange for the
libreoffice default. Libreoffice default backcolor for label is white,
mso's default is rather different ( and never seems to be used )
c) re-enable compObj export ( seemed this was disabled unintentionally
except for buttons )
Change-Id: Ie68267809cee2e92bd06e88e698f17a10eeeb6ad
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/ole/axcontrol.cxx | 32 | ||||
-rw-r--r-- | oox/source/ole/olehelper.cxx | 2 |
2 files changed, 27 insertions, 7 deletions
diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx index eca6d70958e0..86642dc12233 100644 --- a/oox/source/ole/axcontrol.cxx +++ b/oox/source/ole/axcontrol.cxx @@ -1033,7 +1033,10 @@ void AxCommandButtonModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) { AxBinaryPropertyWriter aWriter( rOutStrm ); aWriter.writeIntProperty< sal_uInt32 >( mnTextColor ); - aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); aWriter.writeStringProperty( maCaption ); aWriter.skipProperty(); // pict pos @@ -1156,7 +1159,12 @@ void AxLabelModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) { AxBinaryPropertyWriter aWriter( rOutStrm ); aWriter.writeIntProperty< sal_uInt32 >( mnTextColor ); - aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + // if mnBackColor == 0 then it's the libreoffice default backcolour is + // the MSO Label default which is AX_SYSCOLOR_BUTTONFACE + aWriter.writeIntProperty< sal_uInt32 >( AX_SYSCOLOR_WINDOWBACK ); aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); aWriter.writeStringProperty( maCaption ); aWriter.skipProperty(); // picture position @@ -1299,7 +1307,10 @@ void AxImageModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) aWriter.skipProperty(); //undefined aWriter.skipProperty(); //auto-size aWriter.writeIntProperty< sal_uInt32 >( mnBorderColor ); - aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour aWriter.writeIntProperty< sal_uInt8 >( mnBorderStyle ); aWriter.skipProperty(); // mouse pointer aWriter.writeIntProperty< sal_uInt8 >( mnPicSizeMode ); @@ -1500,7 +1511,10 @@ void AxMorphDataModelBase::exportBinaryModel( BinaryOutputStream& rOutStrm ) aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); else aWriter.skipProperty(); //mnFlags - aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour aWriter.writeIntProperty< sal_uInt32 >( mnTextColor ); // only write if different from default @@ -2116,7 +2130,10 @@ void AxSpinButtonModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) { AxBinaryPropertyWriter aWriter( rOutStrm ); aWriter.writeIntProperty< sal_uInt32 >( mnArrowColor ); - aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); aWriter.writePairProperty( maSize ); aWriter.skipProperty(); // unused @@ -2261,7 +2278,10 @@ void AxScrollBarModel::exportBinaryModel( BinaryOutputStream& rOutStrm ) { AxBinaryPropertyWriter aWriter( rOutStrm ); aWriter.writeIntProperty< sal_uInt32 >( mnArrowColor ); - aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + if ( mnBackColor ) + aWriter.writeIntProperty< sal_uInt32 >( mnBackColor ); + else + aWriter.skipProperty(); // default backcolour aWriter.writeIntProperty< sal_uInt32 >( mnFlags ); aWriter.writePairProperty( maSize ); aWriter.skipProperty(); // mouse pointer diff --git a/oox/source/ole/olehelper.cxx b/oox/source/ole/olehelper.cxx index 8dc8f7ce8e7a..433b88462f8e 100644 --- a/oox/source/ole/olehelper.cxx +++ b/oox/source/ole/olehelper.cxx @@ -461,7 +461,7 @@ void OleFormCtrlExportHelper::exportName( const Reference< XOutputStream >& rxOu void OleFormCtrlExportHelper::exportCompObj( const Reference< XOutputStream >& rxOut ) { oox::BinaryXOutputStream aOut( rxOut, false ); - if ( mpModel && mpModel->getControlType() == API_CONTROL_BUTTON ) + if ( mpModel ) mpModel->exportCompObj( aOut ); } |