[Libreoffice-commits] core.git: 2 commits - sc/source xmloff/source

Lionel Elie Mamane lionel at mamane.lu
Thu Feb 5 12:47:03 PST 2015


 sc/source/filter/excel/xiescher.cxx   |    3 +--
 xmloff/source/forms/elementexport.cxx |   34 ++++++++++++++++++++++++++++++++++
 xmloff/source/forms/layerimport.cxx   |    6 ++----
 3 files changed, 37 insertions(+), 6 deletions(-)

New commits:
commit 7129176134ac136fc38aa1b49f1d65c836af3d2c
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Feb 5 21:43:33 2015 +0100

    Revert "ODF export: don't write invalid "group-name" attribute"
    
    This reverts commit 2d4b87f0c1bfd97185a89c18d5b7680d11a958d6.
    
    The reverted commit leads to the following regressions:
    
     - Basic dialogs
       (which were not targeted, but impacted, by the reverted commit)
       with several RadioButtons sharing a group-name (as they will have a
       tendency to do) cannot be loaded anymore, since the implementation
       assumes (and checks) that names are unique.
    
     - Even in forms, where a RadioButton had both a form:name and a
       form:group-name attribute, the form:name attribute wins and thus
       RadioButtons that has the same group-name but different form:name
       (as they will tend to do) will not anymore be mutually exclusive,
       which defeats their point.
    
    Additionally, since it did not change the UI parts (property editor
    window), the user was still presented with two different editable
    properties "Name" and "Group Name", where "Group Name" was empty...
    
    Change-Id: I1bff532a5a7336cf2eb0579bcd4e2d16be6480fe

diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 76d6545..1cb2fcf 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2306,8 +2306,7 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
                 ScfPropertySet aProps( xCtrlModel );
                 OUString sGroupName = OUString::number( pLeader->GetDffShapeId() );
 
-                // for radio buttons, "Name" is the group name
-                aProps.SetStringProperty( "Name", sGroupName );
+                aProps.SetStringProperty( "GroupName", sGroupName );
                 aProps.SetStringProperty( "RefValue", OUString::number( nRefVal++ ) );
                 if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() )
                 {
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index bd1d7e2..ed8abb9 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -1159,9 +1159,11 @@ namespace xmloff
         {
             static const sal_Int32 nStringPropertyAttributeIds[] =
             {   // attribute flags
+                SCA_GROUP_NAME
             };
             static const OUString pStringPropertyNames[] =
             {   // property names
+                OUString(PROPERTY_GROUP_NAME)
             };
 
             static const sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
@@ -1657,6 +1659,8 @@ namespace xmloff
                 }
                 if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
                     m_nIncludeSpecial |= SCA_IMAGE_POSITION;
+                if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) )
+                    m_nIncludeSpecial |= SCA_GROUP_NAME;
                 m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
                 m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
                 break;
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index aa5f578..33459eb 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -76,11 +76,9 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
     // string properties which are exported as attributes
     m_aAttributeMetaData.addStringProperty(
         OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME);
-    // map invalid "group-name" attribute to "name"
-    // (since radio buttons are grouped by name)
-    m_aAttributeMetaData.addStringProperty(
-            OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_NAME);
     m_aAttributeMetaData.addStringProperty(
+            OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME);
+        m_aAttributeMetaData.addStringProperty(
         OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
     m_aAttributeMetaData.addStringProperty(
         OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
commit ebf98688efab6dbfb0111e40cb18a7a9d1012ac9
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Feb 5 21:43:14 2015 +0100

    Revert "xmloff: dead code gives MSVC fits"
    
    This reverts commit 29e1b2f1ca6e2dcbf9a04c63a3ac1d554cfdcb52
    in preparation for reverting 2d4b87f0c1bfd97185a89c18d5b7680d11a958d6

diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx
index 7ac9191..bd1d7e2 100644
--- a/xmloff/source/forms/elementexport.cxx
+++ b/xmloff/source/forms/elementexport.cxx
@@ -1155,6 +1155,36 @@ namespace xmloff
             }
         }
 
+        // the string properties
+        {
+            static const sal_Int32 nStringPropertyAttributeIds[] =
+            {   // attribute flags
+            };
+            static const OUString pStringPropertyNames[] =
+            {   // property names
+            };
+
+            static const sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
+        #if OSL_DEBUG_LEVEL > 0
+            static const sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] );
+            OSL_ENSURE( ( nIdCount == nNameCount ),
+                "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
+        #endif
+            for ( i = 0; i < nIdCount; ++i )
+                if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial )
+                {
+                    exportStringPropertyAttribute(
+                        OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ),
+                        OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ),
+                        pStringPropertyNames[i]
+                    );
+            #if OSL_DEBUG_LEVEL > 0
+                //  reset the bit for later checking
+                m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
+            #endif
+                }
+        }
+
         if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
         {
             // need to export the min value and the max value as attributes


More information about the Libreoffice-commits mailing list