[Libreoffice-commits] core.git: oox/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Nov 22 09:00:15 UTC 2018


 oox/source/ole/axcontrol.cxx |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit a995d10e27149dc701d7f6fa093545888b5250f5
Author:     Martin van Zijl <martin.vanzijl at gmail.com>
AuthorDate: Tue Nov 20 12:14:20 2018 +1300
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Thu Nov 22 09:59:53 2018 +0100

    tdf#119991 save checkbox tristate in oox format
    
    Change-Id: I313bff6115d56c2567a4586daa43851a1db12b0b
    Reviewed-on: https://gerrit.libreoffice.org/63670
    Tested-by: Jenkins
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/oox/source/ole/axcontrol.cxx b/oox/source/ole/axcontrol.cxx
index de849f9019e2..551f331c9bfa 100644
--- a/oox/source/ole/axcontrol.cxx
+++ b/oox/source/ole/axcontrol.cxx
@@ -531,7 +531,7 @@ void ControlConverter::convertToAxState( PropertySet const & rPropSet,
 
     sal_Int16 nState = API_STATE_DONTKNOW;
 
-    bool bTmp = false;
+    bool bTriStateEnabled = false;
     // need to use State for current state ( I think this is regardless of whether
     // control is awt or not )
     rPropSet.getProperty( nState, PROP_State );
@@ -543,8 +543,12 @@ void ControlConverter::convertToAxState( PropertySet const & rPropSet,
         rValue = "1";
 
     // tristate
-    if( bSupportsTriState && rPropSet.getProperty( bTmp, PROP_TriState ) )
-        nMultiSelect = AX_SELECTION_MULTI;
+    if( bSupportsTriState )
+    {
+        bool bPropertyExists = rPropSet.getProperty( bTriStateEnabled, PROP_TriState );
+        if( bPropertyExists && bTriStateEnabled )
+            nMultiSelect = AX_SELECTION_MULTI;
+    }
 }
 
 void ControlConverter::convertAxOrientation( PropertyMap& rPropMap,
@@ -1510,7 +1514,7 @@ void AxMorphDataModelBase::exportBinaryModel( BinaryOutputStream& rOutStrm )
     aWriter.skipProperty(); // mnShowDropButton );
     aWriter.skipProperty();
     aWriter.skipProperty(); // drop down style
-    if ( mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX && mnMultiSelect != AX_SELECTION_SINGLE )
+    if ( (mnDisplayStyle == AX_DISPLAYSTYLE_LISTBOX || mnDisplayStyle == AX_DISPLAYSTYLE_CHECKBOX) && mnMultiSelect != AX_SELECTION_SINGLE )
         aWriter.writeIntProperty< sal_uInt8 >( mnMultiSelect );
     // although CheckBox, ListBox, OptionButton, ToggleButton are also supported
     // they can only have the fileformat default
@@ -1663,7 +1667,7 @@ void AxCheckBoxModel::convertFromProperties( PropertySet& rPropSet, const Contro
     ControlConverter::convertToMSColor( rPropSet, PROP_BackgroundColor, mnBackColor );
     ControlConverter::convertToMSColor( rPropSet, PROP_TextColor, mnTextColor );
     // need to process the image if one exists
-    ControlConverter::convertToAxState( rPropSet, maValue, mnMultiSelect, API_DEFAULTSTATE_BOOLEAN );
+    ControlConverter::convertToAxState( rPropSet, maValue, mnMultiSelect, API_DEFAULTSTATE_TRISTATE );
     AxMorphDataModelBase::convertFromProperties( rPropSet, rConv );
 }
 


More information about the Libreoffice-commits mailing list