summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-05-08 15:01:22 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-05-08 19:53:25 +0200
commitb09889a158cbc839ebc8a6061b0b261fa74930e6 (patch)
treebad7d2516c34a4e834dc44113b13016614c38438 /xmloff/source/text
parent745cf84060184ae707c047db17ef458aa7e384a1 (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/source/text')
-rw-r--r--xmloff/source/text/txtflde.cxx1
-rw-r--r--xmloff/source/text/txtfldi.cxx10
-rw-r--r--xmloff/source/text/txtimp.cxx1
3 files changed, 8 insertions, 4 deletions
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 },