[Libreoffice-commits] .: sc/source

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Thu May 24 04:25:46 PDT 2012


 sc/source/filter/xml/xmlexprt.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit cd834e5c78c65449a47a6a5310d05bf9775f2da6
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu May 24 13:22:30 2012 +0200

    don't export empty color formats & conditional formats
    
    Change-Id: I880facafc155af2e8c67f66f9d3463daf1191207

diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 5951ee0..2379401 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2851,7 +2851,7 @@ void ScXMLExport::WriteTable(sal_Int32 nTable, const Reference<sheet::XSpreadshe
             WriteNamedRange(pRangeName);
         }
 
-        if(getDefaultVersion() > ODFVER_012)
+        if(getDefaultVersion() > SvtSaveOptions::ODFVER_012)
         {
             //export new conditional format information
             ExportConditionalFormat(nTable);
@@ -3823,6 +3823,16 @@ void ScXMLExport::ExportConditionalFormat(SCTAB nTab)
     ScColorFormatList* pColorFormatList = pDoc->GetColorScaleList(nTab);
     if(pCondFormatList || pColorFormatList)
     {
+        bool bExport = false;
+        if(pCondFormatList && pCondFormatList->size())
+            bExport = true;
+
+        if(pColorFormatList && pColorFormatList->size())
+            bExport = true;
+
+        if(!bExport)
+            return;
+
         SvXMLElementExport aElementCondFormats(*this, XML_NAMESPACE_CALC_EXT, XML_CONDITIONAL_FORMATS, true, true);
 
         if(pCondFormatList)


More information about the Libreoffice-commits mailing list