diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-05-08 15:01:22 +0200 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-05-08 19:53:25 +0200 |
commit | b09889a158cbc839ebc8a6061b0b261fa74930e6 (patch) | |
tree | bad7d2516c34a4e834dc44113b13016614c38438 /xmloff | |
parent | 745cf84060184ae707c047db17ef458aa7e384a1 (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>
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 7566c1065119..019c0bb19308 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3306,6 +3306,8 @@ namespace xmloff { namespace token { // for optional language-dependent reference formats TOKEN( "reference-language", XML_REFERENCE_LANGUAGE ), TOKEN( "newline", XML_NEWLINE ), + 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 1a2a3434fee7..36c8ca93f117 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -2623,6 +2623,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 0b670fb0e083..2bfb61072352 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 26c261d24e65..4382a95a38bf 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1770,6 +1770,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 fd20df679564..017f0fe40e21 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -3318,11 +3318,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 c8abe9651736..7dadde85e2a2 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 }, |