diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-05-08 15:01:22 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-05-15 10:15:10 +0200 |
commit | 980dee8f8e748f84e03cf40962ed2826b9a4dc9e (patch) | |
tree | 824386a1fe044c060ab58be353e50aa7aa4b1521 /xmloff | |
parent | d8f49e3ab6e631dac50c38425a2f388bc9c77aec (diff) |
OFFICE-3776 xmloff: adapt ODF import to renamed text:sender-initials
ODF TC decided to rename the element to meta:creator-initials, so adapt
the import so it can read this in addition to the 2 element names
produced by current and past LO versions.
Also add a test.
Unfortunately it turned out that the ODF validator had a bug in checking
character data in foreign elements, which is triggered by the test
document, see https://issues.apache.org/jira/browse/ODFTOOLKIT-475
... so update the validator jar as well.
Change-Id: I1de1e8772b41f8937f043d9a0d150e169f25ffd4
Reviewed-on: https://gerrit.libreoffice.org/53979
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
(cherry picked from commit b09889a158cbc839ebc8a6061b0b261fa74930e6)
Reviewed-on: https://gerrit.libreoffice.org/54001
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
(cherry picked from commit 1a8fcf5c1523e14a6988263a7c3827f71c0dc674)
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/draw/ximppage.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 1 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 1 |
6 files changed, 15 insertions, 6 deletions
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index e1e67af750b6..9b019e880219 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3295,6 +3295,8 @@ namespace xmloff { namespace token { TOKEN( "zeros-denominator-digits", XML_ZEROS_DENOMINATOR_DIGITS ), TOKEN( "integer-fraction-delimiter", XML_INTEGER_FRACTION_DELIMITER ), + TOKEN( "creator-initials", XML_CREATOR_INITIALS ), + #if OSL_DEBUG_LEVEL > 0 { 0, nullptr, nullptr, XML_TOKEN_END } #else diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 53a8727fc87a..57d2558c04c1 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -2657,6 +2657,7 @@ void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage ) OUString aInitials( xAnnotation->getInitials() ); if( !aInitials.isEmpty() ) { + // TODO: see OFFICE-3776 export meta:creator-initials for ODF 1.3 SvXMLElementExport aInitialsElem( *this, XML_NAMESPACE_LO_EXT, XML_SENDER_INITIALS, true, false ); Characters(aInitials); diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index ddf42faee6b8..1c518a12af78 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -143,8 +143,10 @@ SvXMLImportContextRef DrawAnnotationContext::CreateChildContext( sal_uInt16 nPre else if( IsXMLToken( rLocalName, XML_DATE ) ) xContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maDateBuffer); } - else if( (XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) && - IsXMLToken(rLocalName, XML_SENDER_INITIALS) ) + else if (((XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) + && IsXMLToken(rLocalName, XML_SENDER_INITIALS)) + || (XML_NAMESPACE_META == nPrefix + && IsXMLToken(rLocalName, XML_CREATOR_INITIALS))) { xContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, maInitialsBuffer); } diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 620c69a6cc75..710e30e66890 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1751,6 +1751,7 @@ void XMLTextFieldExport::ExportFieldHelper( OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) ); if( !aInitials.isEmpty() ) { + // TODO: see OFFICE-3776 export meta:creator-initials for ODF 1.3 SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_LO_EXT, XML_SENDER_INITIALS, true, false ); diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index d100263d2fcf..d50d4442e0de 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -3314,11 +3314,13 @@ SvXMLImportContextRef XMLAnnotationImportContext::CreateChildContext( pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, aDateBuffer); } - else if( XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix ) + else if (((XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) + && IsXMLToken(rLocalName, XML_SENDER_INITIALS)) + || (XML_NAMESPACE_META == nPrefix + && IsXMLToken(rLocalName, XML_CREATOR_INITIALS))) { - if( IsXMLToken( rLocalName, XML_SENDER_INITIALS ) ) - pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, - rLocalName, aInitialsBuffer); + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, + rLocalName, aInitialsBuffer); } if( !pContext ) diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 7ff3bec70784..ed05ff1aecc1 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -156,6 +156,7 @@ static const SvXMLTokenMapEntry aTextPElemTokenMap[] = // sender fields { XML_NAMESPACE_TEXT, XML_SENDER_FIRSTNAME,XML_TOK_TEXT_SENDER_FIRSTNAME}, { XML_NAMESPACE_TEXT, XML_SENDER_LASTNAME, XML_TOK_TEXT_SENDER_LASTNAME }, + // note: loext was written by accident in some LO versions, don't remove! { XML_NAMESPACE_LO_EXT, XML_SENDER_INITIALS, XML_TOK_TEXT_SENDER_INITIALS }, { XML_NAMESPACE_TEXT, XML_SENDER_INITIALS, XML_TOK_TEXT_SENDER_INITIALS }, { XML_NAMESPACE_TEXT, XML_SENDER_TITLE, XML_TOK_TEXT_SENDER_TITLE }, |