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

Noel Power noelp at kemper.freedesktop.org
Wed Aug 1 02:32:38 PDT 2012


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

New commits:
commit 2909cf76a701b4860b849fc1aa90fc2046bfbe00
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 b8a8f59..1d124ce 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -1718,6 +1718,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 88c0f4e9a28db4f2947c1c7469f54b76e88a3052
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 b204b92..c2324aa 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 eb5a205..b8a8f59 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 b951b32..cfaf64b 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();


More information about the Libreoffice-commits mailing list