sw321bf01: #i110187#: xmloff: do not export grddl attribute in ODF < 1.2

This commit is contained in:
Michael Stahl 2010-03-29 14:45:13 +02:00
parent 3da480435e
commit c67a33ed57

View file

@ -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 )
{