summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-01-12 23:01:34 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 13:34:20 +0000
commit15791e7c288e6ed134b06065771fbf9aed964467 (patch)
tree381c8bf854f93ffa6fa86ec1e9318a0fe9ab69a1 /xmloff
parent253023901355c722c2b0f71769be94a5efd77162 (diff)
xmloff: there is no reason why office:version should be omitted
... if a document contains foreign elements or attributes. In fact since ODF 1.2 the office:version attribute is mandatory and any document that omits it is therefore invalid, while "extended conforming" documents are allowed to contain foreign elements and attributes. This mysterious check was there since CVS initial import, but without any justification. Change-Id: Ifeafad2b7af41f06356461adb7ae65dbf7bae11d (cherry picked from commit d277ac87455a599fbf4acd3c6401f09bc74d3dac) Reviewed-on: https://gerrit.libreoffice.org/21425 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/core/xmlexp.cxx29
1 files changed, 14 insertions, 15 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx
index 737e7d1cda2e..f331e4984128 100644
--- a/xmloff/source/core/xmlexp.cxx
+++ b/xmloff/source/core/xmlexp.cxx
@@ -1414,24 +1414,23 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass )
}
// office:version = ...
- if( !mbExtended )
+ const sal_Char* pVersion = nullptr;
+ switch (getDefaultVersion())
{
- const sal_Char* pVersion = nullptr;
- switch( getDefaultVersion() )
- {
- case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break;
- case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = sXML_1_2; break;
- case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break;
- case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break;
- case SvtSaveOptions::ODFVER_010: break;
+ case SvtSaveOptions::ODFVER_LATEST: pVersion = sXML_1_2; break;
+ case SvtSaveOptions::ODFVER_012_EXT_COMPAT: pVersion = sXML_1_2; break;
+ case SvtSaveOptions::ODFVER_012: pVersion = sXML_1_2; break;
+ case SvtSaveOptions::ODFVER_011: pVersion = sXML_1_1; break;
+ case SvtSaveOptions::ODFVER_010: break;
- default:
- SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), unexpected odf default version!");
- }
+ default:
+ SAL_WARN("xmloff.core", "xmloff::SvXMLExport::exportDoc(), unexpected odf default version!");
+ }
- if( pVersion )
- AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION,
- OUString::createFromAscii(pVersion) );
+ if (pVersion)
+ {
+ AddAttribute( XML_NAMESPACE_OFFICE, XML_VERSION,
+ OUString::createFromAscii(pVersion) );
}
{