summaryrefslogtreecommitdiff
path: root/xmloff/source/text/XMLChangedRegionImportContext.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
commit80fcc2da523bfae04094b105e67493f9d7679f8f (patch)
treec04d34f6a8144861efbaa11bf66cf6d185c1d7cb /xmloff/source/text/XMLChangedRegionImportContext.cxx
parentc72e885c09d39d03bf35f27614342f7660e9f357 (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/text/XMLChangedRegionImportContext.cxx')
-rw-r--r--xmloff/source/text/XMLChangedRegionImportContext.cxx13
1 files changed, 11 insertions, 2 deletions
diff --git a/xmloff/source/text/XMLChangedRegionImportContext.cxx b/xmloff/source/text/XMLChangedRegionImportContext.cxx
index 220f235d9ddd..347590a6e5b6 100644
--- a/xmloff/source/text/XMLChangedRegionImportContext.cxx
+++ b/xmloff/source/text/XMLChangedRegionImportContext.cxx
@@ -71,6 +71,7 @@ void XMLChangedRegionImportContext::StartElement(
const Reference<XAttributeList> & xAttrList)
{
// process attributes: id
+ bool bHaveXmlId( false );
sal_Int16 nLength = xAttrList->getLength();
for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++)
{
@@ -80,11 +81,19 @@ void XMLChangedRegionImportContext::StartElement(
&sLocalName );
const OUString sValue = xAttrList->getValueByIndex(nAttr);
- if ( XML_NAMESPACE_TEXT == nPrefix )
+ if (XML_NAMESPACE_XML == nPrefix)
{
- if( IsXMLToken( sLocalName, XML_ID ) )
+ if (IsXMLToken(sLocalName, XML_ID))
{
sID = sValue;
+ bHaveXmlId = true;
+ }
+ }
+ else if (XML_NAMESPACE_TEXT == nPrefix)
+ {
+ if (IsXMLToken(sLocalName, XML_ID))
+ {
+ if (!bHaveXmlId) { sID = sValue; }
}
else if( IsXMLToken( sLocalName, XML_MERGE_LAST_PARAGRAPH ) )
{