From c67a33ed5782e4dc9ceede00e97a1feaddf42b41 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 29 Mar 2010 14:45:13 +0200 Subject: [PATCH] sw321bf01: #i110187#: xmloff: do not export grddl attribute in ODF < 1.2 --- xmloff/source/core/xmlexp.cxx | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index f310150e9ade..4c52cc2ce4cb 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1314,6 +1314,23 @@ void SvXMLExport::SetBodyAttributes() { } +static void +lcl_AddGrddl(SvXMLExport & rExport, const sal_Int32 nExportMode) +{ + // check version >= 1.2 + switch (rExport.getDefaultVersion()) { + case SvtSaveOptions::ODFVER_011: // fall thru + case SvtSaveOptions::ODFVER_010: return; + default: break; + } + + if (EXPORT_SETTINGS != nExportMode) // meta, content, styles + { + rExport.AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION, + OUString::createFromAscii(s_grddl_xsl) ); + } +} + sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) { bool bOwnGraphicResolver = false; @@ -1449,11 +1466,7 @@ sal_uInt32 SvXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ) enum XMLTokenEnum eRootService = XML_TOKEN_INVALID; const sal_Int32 nExportMode = mnExportFlags & (EXPORT_META|EXPORT_STYLES|EXPORT_CONTENT|EXPORT_SETTINGS); - if ( EXPORT_SETTINGS != nExportMode ) // meta, content, styles - { - AddAttribute( XML_NAMESPACE_GRDDL, XML_TRANSFORMATION, - OUString::createFromAscii(s_grddl_xsl) ); - } + lcl_AddGrddl(*this, nExportMode); if( EXPORT_META == nExportMode ) {