summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-12-08 13:47:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-12-08 21:22:41 +0100
commitc5b7e99758553d8d4f1a149bcc3d0b2d5835d312 (patch)
tree9f3262689dedb8a91ab14dcdfa70fd99e53bbe3f /xmloff
parent4ac38b5689458f6dc0da313fbd24b8b462cbcc78 (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> (cherry picked from commit a26c4448e6e5ffcd285cc691bfc4eb6c7edf76bc) Reviewed-on: https://gerrit.libreoffice.org/46109 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/XMLIndexTemplateContext.cxx2
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx24
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)
;