diff options
author | Michael Stahl <mst@openoffice.org> | 2010-04-19 18:27:16 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-04-19 18:27:16 +0200 |
commit | 80fcc2da523bfae04094b105e67493f9d7679f8f (patch) | |
tree | c04d34f6a8144861efbaa11bf66cf6d185c1d7cb /xmloff/source/text/txtparai.cxx | |
parent | c72e885c09d39d03bf35f27614342f7660e9f357 (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/txtparai.cxx')
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index aaac42d14597..0d7661ac2c1c 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1920,6 +1920,7 @@ XMLParaContext::XMLParaContext( const SvXMLTokenMap& rTokenMap = GetImport().GetTextImport()->GetTextPAttrTokenMap(); + bool bHaveXmlId( false ); OUString aCondStyleName, sClassNames; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -1936,6 +1937,7 @@ XMLParaContext::XMLParaContext( { case XML_TOK_TEXT_P_XMLID: m_sXmlId = rValue; + bHaveXmlId = true; break; case XML_TOK_TEXT_P_ABOUT: m_sAbout = rValue; @@ -1950,6 +1952,9 @@ XMLParaContext::XMLParaContext( case XML_TOK_TEXT_P_DATATYPE: m_sDatatype = rValue; break; + case XML_TOK_TEXT_P_TEXTID: + if (!bHaveXmlId) { m_sXmlId = rValue; } + break; case XML_TOK_TEXT_P_STYLE_NAME: sStyleName = rValue; break; @@ -1982,9 +1987,6 @@ XMLParaContext::XMLParaContext( } } break; - case XML_TOK_TEXT_P_ID: - sId = rValue; - break; case XML_TOK_TEXT_P_RESTART_NUMBERING: { sal_Bool bBool; @@ -2023,14 +2025,17 @@ XMLParaContext::~XMLParaContext() // if we have an id set for this paragraph, get a cursor for this // paragraph and register it with the given identifier - if( sId.getLength() ) + // FIXME: this is just temporary, and should be removed when + // EditEngine paragraphs implement XMetadatable! + if (m_sXmlId.getLength()) { Reference < XTextCursor > xIdCursor( xTxtImport->GetText()->createTextCursorByRange( xStart ) ); if( xIdCursor.is() ) { xIdCursor->gotoRange( xEnd, sal_True ); Reference< XInterface > xRef( xIdCursor, UNO_QUERY ); - GetImport().getInterfaceToIdentifierMapper().registerReference( sId, xRef ); + GetImport().getInterfaceToIdentifierMapper().registerReference( + m_sXmlId, xRef); } } |