[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/source xmloff/source xmlscript/source

Lionel Elie Mamane lionel at mamane.lu
Thu Feb 5 08:48:29 PST 2015


 sc/source/filter/excel/xiescher.cxx                |    3 +--
 xmloff/source/forms/elementexport.cxx              |    4 ++++
 xmloff/source/forms/layerimport.cxx                |    6 ++----
 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx |    1 +
 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx |    8 ++------
 5 files changed, 10 insertions(+), 12 deletions(-)

New commits:
commit af9890c60f35c7b84df2543690b0b8c39a884bb6
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu Feb 5 17:26:16 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
    Reviewed-on: https://gerrit.libreoffice.org/14338
    Reviewed-by: Michael Stahl <mstahl at redhat.com>
    Tested-by: Michael Stahl <mstahl at redhat.com>

diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index bf5ca8a..5e9fa52 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2258,8 +2258,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 099a8bf..0d86328 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 125abd4..dbab783 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);
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
index db43d54..844a445 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
@@ -419,6 +419,7 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles  )
     readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
     readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
     readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
+    readStringAttr( "GroupName", XMLNS_DIALOGS_PREFIX ":group-name" );
 
     sal_Int16 nState = 0;
     if (readProp( "State" ) >>= nState)
diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
index 17b4026..bb51e91 100644
--- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
@@ -1179,9 +1179,7 @@ void TitledBoxElement::endElement()
         ctx.importImageURLProperty( "ImageURL" ,  "image-src" , _xAttributes );
         ctx.importImagePositionProperty( "ImagePosition", "image-position", xAttributes );
         ctx.importBooleanProperty( "MultiLine", "multiline", xAttributes );
-        // map invalid "group-name" attribute to "name"
-        // (since radio buttons are grouped by name)
-        ctx.importStringProperty( "Name", "group-name", xAttributes );
+        ctx.importStringProperty( "GroupName", "group-name", xAttributes );
 
         sal_Int16 nVal = 0;
         sal_Bool bChecked = sal_False;
@@ -1276,9 +1274,7 @@ void RadioGroupElement::endElement()
         ctx.importImageURLProperty( "ImageURL" , "image-src" , xAttributes );
         ctx.importImagePositionProperty( "ImagePosition", "image-position", xAttributes );
         ctx.importBooleanProperty( "MultiLine", "multiline", xAttributes );
-        // map invalid "group-name" attribute to "name"
-        // (since radio buttons are grouped by name)
-        ctx.importStringProperty( "Name", "group-name", xAttributes );
+        ctx.importStringProperty( "GroupName", "group-name", xAttributes );
         sal_Int16 nVal = 0;
         sal_Bool bChecked = sal_False;
         if (getBoolAttr( &bChecked, "checked", xAttributes, _pImport->XMLNS_DIALOGS_UID ) && bChecked)


More information about the Libreoffice-commits mailing list