diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-12-08 13:47:11 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-12-08 18:37:15 +0100 |
commit | a26c4448e6e5ffcd285cc691bfc4eb6c7edf76bc (patch) | |
tree | a3c13167471d242e21211cfb9ae4996682453214 /xmloff | |
parent | 92eb84ec047cd091d467fd02c8e8bc8d85002b2e (diff) |
tdf#71737 xmloff: ODF 1.2 doesn't allow hyperlinks in ...
... text:illustration-index-entry-template, so store these elements
only in ODF 1.2 extended, and in loext namespace.
Change-Id: Icf919e91114f5c9aed2adc3f5359b9df61eb3433
Reviewed-on: https://gerrit.libreoffice.org/46088
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLIndexTemplateContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/XMLSectionExport.cxx | 24 |
2 files changed, 24 insertions, 2 deletions
diff --git a/xmloff/source/text/XMLIndexTemplateContext.cxx b/xmloff/source/text/XMLIndexTemplateContext.cxx index 87295c1afd73..b538860afeeb 100644 --- a/xmloff/source/text/XMLIndexTemplateContext.cxx +++ b/xmloff/source/text/XMLIndexTemplateContext.cxx @@ -217,7 +217,7 @@ SvXMLImportContextRef XMLIndexTemplateContext::CreateChildContext( { SvXMLImportContext* pContext = nullptr; - if (XML_NAMESPACE_TEXT == nPrefix) + if (XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) { TemplateTokenType nToken; if (SvXMLUnitConverter::convertEnum(nToken, rLocalName, diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 1eac782d0875..899cb51bc068 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -1256,6 +1256,7 @@ void XMLSectionExport::ExportIndexTemplateElement( // convert type to token (and check validity) ... XMLTokenEnum eElement(XML_TOKEN_INVALID); + sal_uInt16 nNamespace(XML_NAMESPACE_TEXT); switch(nTokenType) { case TOK_TTYPE_ENTRY_TEXT: @@ -1301,6 +1302,27 @@ void XMLSectionExport::ExportIndexTemplateElement( break; } + if (eType != TEXT_SECTION_TYPE_TOC) + { + switch (nTokenType) + { + case TOK_TTYPE_HYPERLINK_START: + case TOK_TTYPE_HYPERLINK_END: + if (SvtSaveOptions::ODFVER_012 < aODFVersion) + { + assert(eType == TEXT_SECTION_TYPE_ILLUSTRATION); + nNamespace = XML_NAMESPACE_LO_EXT; + } + else + { + eElement = XML_TOKEN_INVALID; // not allowed in ODF <= 1.2 + } + break; + default: + break; + } + } + //--->i90246 //check the ODF version being exported if( aODFVersion == SvtSaveOptions::ODFVER_011 @@ -1455,7 +1477,7 @@ void XMLSectionExport::ExportIndexTemplateElement( OUString::number(nLevel)); } // export template - SvXMLElementExport aTemplateElement(GetExport(), XML_NAMESPACE_TEXT, + SvXMLElementExport aTemplateElement(GetExport(), nNamespace, GetXMLToken(eElement), true, false) ; |