From 0e402c37a75b637824b75ed38809ce196c2acfdb Mon Sep 17 00:00:00 2001 From: Oliver-Rainer Wittmann Date: Tue, 29 Dec 2009 10:28:54 +0100 Subject: sw33bf02: #i104889# method - no empty value export for style:default-outline-level for ODF version < 1.2 --- xmloff/source/style/styleexp.cxx | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'xmloff/source/style/styleexp.cxx') diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index f03c0ac9a78b..9ca113218a9d 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -200,13 +200,22 @@ sal_Bool XMLStyleExport::exportStyle( OUStringBuffer sTmp; sTmp.append( static_cast(nOutlineLevel)); GetExport().AddAttribute( XML_NAMESPACE_STYLE, - XML_DEFAULT_OUTLINE_LEVEL, - sTmp.makeStringAndClear() ); + XML_DEFAULT_OUTLINE_LEVEL, + sTmp.makeStringAndClear() ); } else { - GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DEFAULT_OUTLINE_LEVEL, - OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); + // --> OD 2009-12-29 #i104889# + // empty value for style:default-outline-level does exist + // since ODF 1.2. Thus, suppress its export for former versions. + if ( ( GetExport().getExportFlags() & EXPORT_OASIS ) != 0 && + GetExport().getDefaultVersion() >= SvtSaveOptions::ODFVER_012 ) + // <-- + { + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_DEFAULT_OUTLINE_LEVEL, + OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); + } } } }//<-end,zhaojianwei @@ -311,8 +320,9 @@ sal_Bool XMLStyleExport::exportStyle( } ///////////////////////////////////////////////// if ( bNoInheritedListStyle ) - GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_LIST_STYLE_NAME, - OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); + GetExport().AddAttribute( XML_NAMESPACE_STYLE, + XML_LIST_STYLE_NAME, + OUString( RTL_CONSTASCII_USTRINGPARAM( "" ))); } //<-end,zhaojianwei } -- cgit v1.2.3