Kaydet (Commit) 71291761 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

Revert "ODF export: don't write invalid "group-name" attribute"

This reverts commit 2d4b87f0.

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
üst ebf98688
...@@ -2306,8 +2306,7 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const ...@@ -2306,8 +2306,7 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
ScfPropertySet aProps( xCtrlModel ); ScfPropertySet aProps( xCtrlModel );
OUString sGroupName = OUString::number( pLeader->GetDffShapeId() ); OUString sGroupName = OUString::number( pLeader->GetDffShapeId() );
// for radio buttons, "Name" is the group name aProps.SetStringProperty( "GroupName", sGroupName );
aProps.SetStringProperty( "Name", sGroupName );
aProps.SetStringProperty( "RefValue", OUString::number( nRefVal++ ) ); aProps.SetStringProperty( "RefValue", OUString::number( nRefVal++ ) );
if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() ) if ( pLeader->HasCellLink() && !pTbxObj->HasCellLink() )
{ {
......
...@@ -1159,9 +1159,11 @@ namespace xmloff ...@@ -1159,9 +1159,11 @@ namespace xmloff
{ {
static const sal_Int32 nStringPropertyAttributeIds[] = static const sal_Int32 nStringPropertyAttributeIds[] =
{ // attribute flags { // attribute flags
SCA_GROUP_NAME
}; };
static const OUString pStringPropertyNames[] = static const OUString pStringPropertyNames[] =
{ // property names { // property names
OUString(PROPERTY_GROUP_NAME)
}; };
static const sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] ); static const sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
...@@ -1657,6 +1659,8 @@ namespace xmloff ...@@ -1657,6 +1659,8 @@ namespace xmloff
} }
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) ) if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
m_nIncludeSpecial |= SCA_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_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE; m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
break; break;
......
...@@ -76,10 +76,8 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter) ...@@ -76,10 +76,8 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter)
// string properties which are exported as attributes // string properties which are exported as attributes
m_aAttributeMetaData.addStringProperty( m_aAttributeMetaData.addStringProperty(
OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME); OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME);
// map invalid "group-name" attribute to "name"
// (since radio buttons are grouped by name)
m_aAttributeMetaData.addStringProperty( m_aAttributeMetaData.addStringProperty(
OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_NAME); OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME);
m_aAttributeMetaData.addStringProperty( m_aAttributeMetaData.addStringProperty(
OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL); OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
m_aAttributeMetaData.addStringProperty( m_aAttributeMetaData.addStringProperty(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment