summaryrefslogtreecommitdiff
path: root/xmloff/source/forms/elementimport.cxx
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-04-19 18:27:16 +0200
committerMichael Stahl <mst@openoffice.org>2010-04-19 18:27:16 +0200
commit72a6bdf9e3cfa0173b4cdbb49859a407505ba052 (patch)
treed7b0257775b1d5ac81d5fc9f9551d872d4c5706b /xmloff/source/forms/elementimport.cxx
parentfe73a227ea0843b6dfbd3ee23a450e31c8448c26 (diff)
sw33bf03: #i110691#: import/export xml:id and {anim,draw,form,text}:id:
in ODF 1.2, the ID attributes on many elements are deprecated, and must be used only in conjunction with xml:id. new method SvXMLExport::AddAttributeIdLegacy() should fix the export.
Diffstat (limited to 'xmloff/source/forms/elementimport.cxx')
-rw-r--r--xmloff/source/forms/elementimport.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index e25eef33db..f360f8f718 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -589,12 +589,21 @@ namespace xmloff
//---------------------------------------------------------------------
void OControlImport::handleAttribute(sal_uInt16 _nNamespaceKey, const ::rtl::OUString& _rLocalName, const ::rtl::OUString& _rValue)
{
- static const sal_Char* pControlIdAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCA_CONTROL_ID);
static const sal_Char* pLinkedCellAttributeName = OAttributeMetaData::getBindingAttributeName(BA_LINKED_CELL);
- if ( !m_sControlId.getLength() && _rLocalName.equalsAscii( pControlIdAttributeName ) )
- { // it's the control id
- m_sControlId = _rValue;
+ if (IsXMLToken(_rLocalName, XML_ID))
+ { // it's the control id
+ if (XML_NAMESPACE_XML == _nNamespaceKey)
+ {
+ m_sControlId = _rValue;
+ }
+ else if (XML_NAMESPACE_FORM == _nNamespaceKey)
+ {
+ if (!m_sControlId.getLength())
+ {
+ m_sControlId = _rValue;
+ }
+ }
}
else if ( _rLocalName.equalsAscii( pLinkedCellAttributeName ) )
{ // it's the address of a spreadsheet cell