diff options
author | Michael Stahl <mst@openoffice.org> | 2010-03-29 14:45:13 +0200 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-03-29 14:45:13 +0200 |
commit | fe0c2e669a02ef653ddf18e1cf61aa0b38995eed (patch) | |
tree | a1f7ce398eb8e0cd087892765c5bd9c9b632e865 | |
parent | 1c20aa26ebaa0efc0605b054ebcfe329beb829dd (diff) |
sw321bf01: #i110187#: xmloff: do not export grddl attribute in ODF < 1.2
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 37e74b4caf..2509faeddc 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1241,6 +1241,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; @@ -1376,11 +1393,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 ) { |