summaryrefslogtreecommitdiff
path: root/xmloff/source/text
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-04-24 18:30:12 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-05-12 12:56:36 +0200
commit816022a4d8a1878c8ea74f43a4821e3c8a12d1ea (patch)
treef1994b46d28e39de3ada2438cdf180eb550bac80 /xmloff/source/text
parent1237acf9851f8b12d1ccd929e2aa8b184c06d552 (diff)
xmloff: ODF export: adapt to ODF 1.3
* OFFICE-3883 legend svg:width/svg:height * OFFICE-3928 chart:coordinate-region * OFFICE-3943 draw:mime-type * OFFICE-3765 number:fill-character, number:text * OFFICE-3860 number:min-decimal-places, number:forced-exponent-sign * OFFICE-1828 number:exponent-interval * OFFICE-3695 number:max-denominator-value * OFFICE-3941 text:index-entry-link-start/text:index-entry-link-end * OFFICE-3776 meta:creator-initials * OFFICE-3789 style:header-first/style:footer-first Change-Id: I78c79231c0708c3ae9943097d162898fab71988f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92873 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'xmloff/source/text')
-rw-r--r--xmloff/source/text/XMLSectionExport.cxx5
-rw-r--r--xmloff/source/text/XMLTextMasterPageExport.cxx20
-rw-r--r--xmloff/source/text/txtflde.cxx16
-rw-r--r--xmloff/source/text/txtparae.cxx16
4 files changed, 43 insertions, 14 deletions
diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx
index e69e6e11487a..7b03730e5b59 100644
--- a/xmloff/source/text/XMLSectionExport.cxx
+++ b/xmloff/source/text/XMLSectionExport.cxx
@@ -1316,7 +1316,10 @@ void XMLSectionExport::ExportIndexTemplateElement(
|| eType == TEXT_SECTION_TYPE_OBJECT
|| eType == TEXT_SECTION_TYPE_TABLE
|| eType == TEXT_SECTION_TYPE_USER);
- nNamespace = XML_NAMESPACE_LO_EXT;
+ // ODF 1.3 OFFICE-3941
+ nNamespace = (SvtSaveOptions::ODFSVER_013 <= aODFVersion)
+ ? XML_NAMESPACE_TEXT
+ : XML_NAMESPACE_LO_EXT;
}
else
{
diff --git a/xmloff/source/text/XMLTextMasterPageExport.cxx b/xmloff/source/text/XMLTextMasterPageExport.cxx
index f2adab2600fa..4e688bdcfbd4 100644
--- a/xmloff/source/text/XMLTextMasterPageExport.cxx
+++ b/xmloff/source/text/XMLTextMasterPageExport.cxx
@@ -124,6 +124,8 @@ void XMLTextMasterPageExport::exportMasterPageContent(
}
else
{
+ auto const nVersion(GetExport().getSaneDefaultVersion());
+
aAny = rPropSet->getPropertyValue( gsHeaderOn );
bool bHeader = false;
aAny >>= bHeader;
@@ -162,12 +164,17 @@ void XMLTextMasterPageExport::exportMasterPageContent(
exportHeaderFooterContent( xHeaderTextLeft, false );
}
- if( xHeaderTextFirst.is() && xHeaderTextFirst != xHeaderText )
+ if (xHeaderTextFirst.is() && xHeaderTextFirst != xHeaderText
+ && SvtSaveOptions::ODFSVER_012 < nVersion)
{
if (bHeaderFirstShared)
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DISPLAY, XML_FALSE );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_LO_EXT,
+ // ODF 1.3 OFFICE-3789
+ SvXMLElementExport aElem( GetExport(),
+ SvtSaveOptions::ODFSVER_013 <= nVersion
+ ? XML_NAMESPACE_STYLE
+ : XML_NAMESPACE_LO_EXT,
XML_HEADER_FIRST, true, true );
exportHeaderFooterContent( xHeaderTextFirst, false );
}
@@ -210,12 +217,17 @@ void XMLTextMasterPageExport::exportMasterPageContent(
exportHeaderFooterContent( xFooterTextLeft, false );
}
- if( xFooterTextFirst.is() && xFooterTextFirst != xFooterText )
+ if (xFooterTextFirst.is() && xFooterTextFirst != xFooterText
+ && SvtSaveOptions::ODFSVER_012 < nVersion)
{
if (bFooterFirstShared)
GetExport().AddAttribute( XML_NAMESPACE_STYLE,
XML_DISPLAY, XML_FALSE );
- SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_LO_EXT,
+ // ODF 1.3 OFFICE-3789
+ SvXMLElementExport aElem( GetExport(),
+ SvtSaveOptions::ODFSVER_013 <= nVersion
+ ? XML_NAMESPACE_STYLE
+ : XML_NAMESPACE_LO_EXT,
XML_FOOTER_FIRST, true, true );
exportHeaderFooterContent( xFooterTextFirst, false );
}
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index d2aefc403292..396e05075788 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1794,16 +1794,22 @@ void XMLTextFieldExport::ExportFieldHelper(
GetExport().Characters(aBuffer.makeStringAndClear());
}
- if (SvtSaveOptions().GetODFSaneDefaultVersion() > SvtSaveOptions::ODFSVER_012)
+ if (GetExport().getSaneDefaultVersion() > SvtSaveOptions::ODFSVER_012)
{
// initials
OUString aInitials( GetStringProperty(gsPropertyInitials, 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 );
+ // ODF 1.3 OFFICE-3776 export meta:creator-initials for ODF 1.3
+ SvXMLElementExport aCreatorElem( GetExport(),
+ (SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion())
+ ? XML_NAMESPACE_META
+ : XML_NAMESPACE_LO_EXT,
+
+ (SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion())
+ ? XML_CREATOR_INITIALS
+ : XML_SENDER_INITIALS,
+ true, false );
GetExport().Characters(aInitials);
}
}
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 928005e3211d..26ff035a488b 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -3167,8 +3167,12 @@ void XMLTextParagraphExport::_exportTextGraphic(
GetExport().GetGraphicMimeTypeFromStream(xGraphic, sOutMimeType);
}
if (!sOutMimeType.isEmpty())
- {
- GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "mime-type", sOutMimeType);
+ { // ODF 1.3 OFFICE-3943
+ GetExport().AddAttribute(
+ SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion()
+ ? XML_NAMESPACE_DRAW
+ : XML_NAMESPACE_LO_EXT,
+ "mime-type", sOutMimeType);
}
}
@@ -3215,8 +3219,12 @@ void XMLTextParagraphExport::_exportTextGraphic(
GetExport().GetGraphicMimeTypeFromStream(xReplacementGraphic, sOutMimeType);
}
if (!sOutMimeType.isEmpty())
- {
- GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, "mime-type", sOutMimeType);
+ { // ODF 1.3 OFFICE-3943
+ GetExport().AddAttribute(
+ SvtSaveOptions::ODFSVER_013 <= GetExport().getSaneDefaultVersion()
+ ? XML_NAMESPACE_DRAW
+ : XML_NAMESPACE_LO_EXT,
+ "mime-type", sOutMimeType);
}
}