ODF export: don't write invalid "group-name" attribute
Radio buttons are grouped via their "form:name" attribute already. Change-Id: I9f8b27a2904d947c3d4665495d36961e3e41d2c6
This commit is contained in:
@@ -2288,7 +2288,8 @@ void XclImpOptionButtonObj::DoProcessControl( ScfPropertySet& rPropSet ) const
|
|||||||
ScfPropertySet aProps( xCtrlModel );
|
ScfPropertySet aProps( xCtrlModel );
|
||||||
OUString sGroupName = OUString::number( pLeader->GetDffShapeId() );
|
OUString sGroupName = OUString::number( pLeader->GetDffShapeId() );
|
||||||
|
|
||||||
aProps.SetStringProperty( "GroupName", sGroupName );
|
// for radio buttons, "Name" is the group name
|
||||||
|
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,11 +1159,9 @@ 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] );
|
||||||
@@ -1659,8 +1657,6 @@ 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,9 +76,11 @@ 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(
|
||||||
|
OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_NAME);
|
||||||
m_aAttributeMetaData.addStringProperty(
|
m_aAttributeMetaData.addStringProperty(
|
||||||
OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME);
|
|
||||||
m_aAttributeMetaData.addStringProperty(
|
|
||||||
OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
|
OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
|
||||||
m_aAttributeMetaData.addStringProperty(
|
m_aAttributeMetaData.addStringProperty(
|
||||||
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
|
OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
|
||||||
|
@@ -419,7 +419,6 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles )
|
|||||||
readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
|
readImageURLAttr( "ImageURL", XMLNS_DIALOGS_PREFIX ":image-src" );
|
||||||
readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
|
readImagePositionAttr( "ImagePosition", XMLNS_DIALOGS_PREFIX ":image-position" );
|
||||||
readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
|
readBoolAttr( "MultiLine", XMLNS_DIALOGS_PREFIX ":multiline" );
|
||||||
readStringAttr( "GroupName", XMLNS_DIALOGS_PREFIX ":group-name" );
|
|
||||||
|
|
||||||
sal_Int16 nState = 0;
|
sal_Int16 nState = 0;
|
||||||
if (readProp( "State" ) >>= nState)
|
if (readProp( "State" ) >>= nState)
|
||||||
|
@@ -1174,7 +1174,9 @@ void TitledBoxElement::endElement()
|
|||||||
ctx.importImageURLProperty( "ImageURL" , "image-src" , _xAttributes );
|
ctx.importImageURLProperty( "ImageURL" , "image-src" , _xAttributes );
|
||||||
ctx.importImagePositionProperty( "ImagePosition", "image-position", xAttributes );
|
ctx.importImagePositionProperty( "ImagePosition", "image-position", xAttributes );
|
||||||
ctx.importBooleanProperty( "MultiLine", "multiline", xAttributes );
|
ctx.importBooleanProperty( "MultiLine", "multiline", xAttributes );
|
||||||
ctx.importStringProperty( "GroupName", "group-name", xAttributes );
|
// map invalid "group-name" attribute to "name"
|
||||||
|
// (since radio buttons are grouped by name)
|
||||||
|
ctx.importStringProperty( "Name", "group-name", xAttributes );
|
||||||
|
|
||||||
sal_Int16 nVal = 0;
|
sal_Int16 nVal = 0;
|
||||||
sal_Bool bChecked = sal_False;
|
sal_Bool bChecked = sal_False;
|
||||||
@@ -1269,7 +1271,9 @@ void RadioGroupElement::endElement()
|
|||||||
ctx.importImageURLProperty( "ImageURL" , "image-src" , xAttributes );
|
ctx.importImageURLProperty( "ImageURL" , "image-src" , xAttributes );
|
||||||
ctx.importImagePositionProperty( "ImagePosition", "image-position", xAttributes );
|
ctx.importImagePositionProperty( "ImagePosition", "image-position", xAttributes );
|
||||||
ctx.importBooleanProperty( "MultiLine", "multiline", xAttributes );
|
ctx.importBooleanProperty( "MultiLine", "multiline", xAttributes );
|
||||||
ctx.importStringProperty( "GroupName", "group-name", xAttributes );
|
// map invalid "group-name" attribute to "name"
|
||||||
|
// (since radio buttons are grouped by name)
|
||||||
|
ctx.importStringProperty( "Name", "group-name", xAttributes );
|
||||||
sal_Int16 nVal = 0;
|
sal_Int16 nVal = 0;
|
||||||
sal_Bool bChecked = sal_False;
|
sal_Bool bChecked = sal_False;
|
||||||
if (getBoolAttr( &bChecked, "checked", xAttributes, _pImport->XMLNS_DIALOGS_UID ) && bChecked)
|
if (getBoolAttr( &bChecked, "checked", xAttributes, _pImport->XMLNS_DIALOGS_UID ) && bChecked)
|
||||||
|
Reference in New Issue
Block a user