Kaydet (Commit) d277ac87 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 8d6c1b69
......@@ -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) );
}
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment