[Libreoffice-commits] .: chart2/source sc/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Fri Apr 22 02:52:00 PDT 2011


 chart2/source/view/main/ChartView.cxx          |    2 +-
 chart2/source/view/main/VDataSeries.cxx        |    2 +-
 sc/source/filter/xml/XMLStylesExportHelper.cxx |    2 +-
 sc/source/filter/xml/xmlstyli.cxx              |    2 +-
 sc/source/ui/vba/vbarange.cxx                  |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit d65cd84d8f2fc8f331f0a525454b686b3e0ecf39
Author: Kayo Hamid <kayo.hamid at gekkolinux.com.br>
Date:   Fri Apr 22 11:31:04 2011 +0200

    cppcheck inefficient checking for emptiness
    
    From cppcheck: Using xxxx.empty() instead of xxxx.size() can be faster.
     xxxx.size() can take linear time but xxxx.empty() is guaranteed to take
     constant time

diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 91f4a88..9f64a88 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -762,7 +762,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
     }
 
     //transport seriesnames to the coordinatesystems if needed
-    if( m_aSeriesPlotterList.size() )
+    if( !m_aSeriesPlotterList.empty() )
     {
         uno::Sequence< rtl::OUString > aSeriesNames;
         bool bSeriesNamesInitialized = false;
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 78930d9..3e896f2 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -113,7 +113,7 @@ struct lcl_LessXOfPoint
     inline bool operator() ( const std::vector< double >& first,
                              const std::vector< double >& second )
     {
-        if( first.size() > 0 && second.size() > 0 )
+        if( !first.empty() && !second.empty() )
         {
             return first[0]<second[0];
         }
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index 5ae0485..acf7b04 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -357,7 +357,7 @@ void ScMyValidationsContainer::WriteMessage(ScXMLExport& rExport,
 
 void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport)
 {
-    if (aValidationVec.size())
+    if (!aValidationVec.empty())
     {
         SvXMLElementExport aElemVs(rExport, XML_NAMESPACE_TABLE, XML_CONTENT_VALIDATIONS, sal_True, sal_True);
         ScMyValidationVec::iterator aItr(aValidationVec.begin());
diff --git a/sc/source/filter/xml/xmlstyli.cxx b/sc/source/filter/xml/xmlstyli.cxx
index f4b7d6b..c4c31d8 100644
--- a/sc/source/filter/xml/xmlstyli.cxx
+++ b/sc/source/filter/xml/xmlstyli.cxx
@@ -525,7 +525,7 @@ void XMLTableStyleContext::FillPropertySet(
             sal_Int32 nNumFmt = GetNumberFormat();
             if (nNumFmt >= 0)
                 AddProperty(CTF_SC_NUMBERFORMAT, uno::makeAny(nNumFmt));
-            if (!bConditionalFormatCreated && (aMaps.size() > 0))
+            if (!bConditionalFormatCreated && (!aMaps.empty()))
             {
                 aConditionalFormat = rPropSet->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_CONDXML)));
                 std::vector<ScXMLMapContent>::iterator aItr(aMaps.begin());
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 1895c78..c0d3387 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -1159,7 +1159,7 @@ bool getScRangeListForAddress( const rtl::OUString& sName, ScDocShell* pDocSh, S
         vNames.push_back( aToken );
     } while ( nIndex >= 0 );
 
-    if ( !vNames.size() )
+    if ( vNames.empty() )
         vNames.push_back( sName );
 
     std::vector< rtl::OUString >::iterator it = vNames.begin();


More information about the Libreoffice-commits mailing list