[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - oox/inc oox/source

Noel Power noelp at kemper.freedesktop.org
Wed Aug 1 02:24:54 PDT 2012


 oox/inc/oox/ole/axcontrol.hxx |    3 ++-
 oox/source/ole/axcontrol.cxx  |   13 +++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

New commits:
commit 76c05c56d19f0643fb99375ef8315e931f87de59
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Jul 31 12:33:41 2012 +0200

    fdo#45724 improve WW8 textbox export
    
    If there is no default value, but there is a current one, export that
    instead.
    
    Change-Id: I01af5cfa641b061b0aeb959e579bca66340781e9

diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index ff86c8d..7756ebf 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -1717,6 +1717,9 @@ void AxTextBoxModel::convertFromProperties( PropertySet& rPropSet, const Control
     if ( rPropSet.getProperty( bRes,  PROP_HideInactiveSelection ) )
         setFlag( mnFlags, AX_FLAGS_HIDESELECTION, bRes );
     rPropSet.getProperty( maValue, ( mbAwtModel ? PROP_Text : PROP_DefaultText ) );
+    if (maValue.isEmpty() && !mbAwtModel)
+        // No default value? Then try exporting the current one.
+        rPropSet.getProperty( maValue, PROP_Text);
     sal_Int16 nTmp(0);
     if ( rPropSet.getProperty( nTmp, PROP_MaxTextLen ) )
         mnMaxLength = nTmp;
commit 1db74f95ca260b65e04f7ed3e11f2bb36d3d8414
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Jul 31 11:18:31 2012 +0200

    fdo#45724 fix WW8 export of textbox default background color
    
    regression from 5609c512cd4d2899300b432d88d93cff05a05c87
    
    Change-Id: I5f3ce73943b2805b7de1ae41699e605af9086b15

diff --git a/oox/inc/oox/ole/axcontrol.hxx b/oox/inc/oox/ole/axcontrol.hxx
index ee3a9ac..153aaf6 100644
--- a/oox/inc/oox/ole/axcontrol.hxx
+++ b/oox/inc/oox/ole/axcontrol.hxx
@@ -227,7 +227,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 6013f75..ff86c8d 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -281,11 +281,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
 {
@@ -1725,7 +1727,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 );


More information about the Libreoffice-commits mailing list