Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Performance improvement unlikely yet readability/intent clearer + cppcheck satisfied.

-- 
Regards,
Mariusz Dykerek

From 3fa7c19cfa1a844a926221d2d0235e4c9737c86c Mon Sep 17 00:00:00 2001
From: Mariusz Dykierek <MariuszDykierek@gmail.com>
Date: Sun, 19 Feb 2012 17:21:55 +0100
Subject: [PATCH 1/2] Using empty() instead of size() == 0 (broad fix for
 cppcheck's Possible inefficient checking for '<sth>'
 emptiness)

---
 autodoc/inc/ary/info/ci_text.hxx                   |    2 +-
 autodoc/source/display/idl/hfi_module.cxx          |    2 +-
 autodoc/source/display/idl/hfi_xrefpage.cxx        |    2 +-
 autodoc/source/display/idl/hi_factory.cxx          |    2 +-
 autodoc/source/exes/adc_uni/adc_cl.cxx             |    2 +-
 chart2/source/controller/dialogs/DialogModel.cxx   |    2 +-
 comphelper/source/container/container.cxx          |    4 ++--
 connectivity/source/drivers/file/fanalyzer.cxx     |    2 +-
 connectivity/source/drivers/file/fcomp.cxx         |    4 ++--
 .../drivers/mozab/bootstrap/MNSProfileDiscover.cxx |    2 +-
 .../source/drivers/postgresql/pq_tools.hxx         |    2 +-
 dbaccess/source/ui/misc/WColumnSelect.cxx          |    4 ++--
 dbaccess/source/ui/querydesign/QueryTableView.cxx  |    2 +-
 .../source/ui/querydesign/TableConnectionData.cxx  |    2 +-
 .../source/deployment/registry/dp_backenddb.cxx    |    4 ++--
 desktop/source/pkgchk/unopkg/unopkg_misc.cxx       |    2 +-
 editeng/source/editeng/impedit4.cxx                |    2 +-
 editeng/source/misc/txtrange.cxx                   |    2 +-
 editeng/source/outliner/outlobj.cxx                |    2 +-
 extensions/qa/update/test_update.cxx               |    2 +-
 forms/source/component/EventThread.cxx             |    2 +-
 fpicker/source/unx/kde_unx/UnxCommandThread.cxx    |    2 +-
 .../win32/filepicker/VistaFilePickerImpl.cxx       |    2 +-
 lotuswordpro/source/filter/xfilter/xfindex.cxx     |    2 +-
 registry/tools/regcompare.cxx                      |    4 ++--
 sc/source/core/data/dociter.cxx                    |    6 +++---
 sc/source/core/data/dptablecache.cxx               |    4 ++--
 sc/source/ui/view/viewdata.cxx                     |    4 ++--
 sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx |    2 +-
 .../controls/MasterPageContainerQueue.cxx          |    2 +-
 sdext/source/presenter/PresenterTimer.cxx          |    4 ++--
 sdext/source/presenter/PresenterToolBar.cxx        |    2 +-
 shell/source/win32/simplemail/senddoc.cxx          |    4 ++--
 shell/source/win32/simplemail/smplmailclient.cxx   |    2 +-
 starmath/source/cursor.cxx                         |    8 ++++----
 starmath/source/dialog.cxx                         |    2 +-
 starmath/source/parse.cxx                          |    2 +-
 .../registry_tdprovider/rdbtdp_tdenumeration.cxx   |    2 +-
 stoc/source/tdmanager/tdmgr.cxx                    |    2 +-
 svx/source/fmcomp/gridctrl.cxx                     |    2 +-
 sw/source/core/SwNumberTree/SwNumberTree.cxx       |    2 +-
 sw/source/core/edit/edlingu.cxx                    |    2 +-
 sw/source/core/table/swnewtable.cxx                |    2 +-
 sw/source/filter/ww8/wrtw8nds.cxx                  |    4 ++--
 sw/source/ui/wrtsh/navmgr.cxx                      |    2 +-
 ucb/source/ucp/tdoc/tdoc_storage.cxx               |    2 +-
 ucb/source/ucp/webdav/ContentProperties.cxx        |    2 +-
 ucb/source/ucp/webdav/NeonHeadRequest.cxx          |    2 +-
 ucb/source/ucp/webdav/NeonLockStore.cxx            |    2 +-
 ucb/source/ucp/webdav/NeonSession.cxx              |    2 +-
 vcl/generic/print/glyphset.cxx                     |    4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx                  |    2 +-
 writerfilter/source/doctok/WW8DocumentImpl.cxx     |    2 +-
 .../source/ooxml/OOXMLFastContextHandler.cxx       |    2 +-
 writerfilter/source/ooxml/OOXMLFastHelper.hxx      |    6 +++---
 writerperfect/source/filter/OdgGenerator.cxx       |    2 +-
 xmloff/source/core/RDFaImportHelper.cxx            |    2 +-
 xmloff/source/style/xmlnumfi.cxx                   |    4 ++--
 xmloff/source/text/txtparae.cxx                    |    2 +-
 59 files changed, 78 insertions(+), 78 deletions(-)

diff --git a/autodoc/inc/ary/info/ci_text.hxx b/autodoc/inc/ary/info/ci_text.hxx
index 4e8bf7a..a178ff7 100644
--- a/autodoc/inc/ary/info/ci_text.hxx
+++ b/autodoc/inc/ary/info/ci_text.hxx
@@ -62,7 +62,7 @@ class DocuText
                                                 { aTokens.push_back(&let_drToken); }
     const TokenList &   Tokens() const          { return aTokens; }
     bool                IsNoHtml() const        { return NOT bUsesHtml; }
-    bool                IsEmpty() const         { return aTokens.size() == 0; }
+    bool                IsEmpty() const         { return aTokens.empty(); }
 
   private:
     TokenList           aTokens;
diff --git a/autodoc/source/display/idl/hfi_module.cxx b/autodoc/source/display/idl/hfi_module.cxx
index eb65a14..85be9cb 100644
--- a/autodoc/source/display/idl/hfi_module.cxx
+++ b/autodoc/source/display/idl/hfi_module.cxx
@@ -214,7 +214,7 @@ HF_IdlModule::produce_ChildList( const String &      i_sName,
                                  const String &      i_sLabel,
                                  const ce_ptr_list & i_list ) const
 {
-    if ( i_list.size() == 0 )
+    if ( i_list.empty() )
         return false;
 
     HF_SubTitleTable
diff --git a/autodoc/source/display/idl/hfi_xrefpage.cxx 
b/autodoc/source/display/idl/hfi_xrefpage.cxx
index e067308..35d647a 100644
--- a/autodoc/source/display/idl/hfi_xrefpage.cxx
+++ b/autodoc/source/display/idl/hfi_xrefpage.cxx
@@ -74,7 +74,7 @@ HF_IdlXrefs::Write_ManualLinks( const client &  i_ce ) const
 {
     const StringVector &
         rLinks2Refs = i_ce.Secondaries().Links2RefsInManual();
-    if ( rLinks2Refs.size() == 0 )
+    if ( rLinks2Refs.empty() )
     {
         rContentDirectory
             << C_sDevMan
diff --git a/autodoc/source/display/idl/hi_factory.cxx b/autodoc/source/display/idl/hi_factory.cxx
index d194d60..832420f 100644
--- a/autodoc/source/display/idl/hi_factory.cxx
+++ b/autodoc/source/display/idl/hi_factory.cxx
@@ -234,7 +234,7 @@ HtmlFactory_Idl::write_ManualLinks( Xml::Element &  o_screen,
 {
     const StringVector &
         rLinks2Descrs = i_ce.Secondaries().Links2DescriptionInManual();
-    if ( rLinks2Descrs.size() == 0 )
+    if ( rLinks2Descrs.empty() )
         return;
 
     o_screen
diff --git a/autodoc/source/exes/adc_uni/adc_cl.cxx b/autodoc/source/exes/adc_uni/adc_cl.cxx
index f2cc54f..4c5624f 100644
--- a/autodoc/source/exes/adc_uni/adc_cl.cxx
+++ b/autodoc/source/exes/adc_uni/adc_cl.cxx
@@ -255,7 +255,7 @@ CommandLine::do_PrintUse() const
 bool
 CommandLine::inq_CheckParameters() const
 {
-    if (NOT bInitOk OR aCommands.size() == 0)
+    if (NOT bInitOk OR aCommands.empty())
         return false;
     return true;
 }
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx 
b/chart2/source/controller/dialogs/DialogModel.cxx
index e0abe6d..5d93ee0 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -90,7 +90,7 @@ OUString lcl_ConvertRole( const OUString & rRoleString, bool bFromInternalToUI )
     typedef ::std::map< OUString, OUString > tTranslationMap;
     static tTranslationMap aTranslationMap;
 
-    if( aTranslationMap.size() == 0 )
+    if( aTranslationMap.empty() )
     {
         aTranslationMap[ C2U( "categories" ) ] =   OUString( String( ::chart::SchResId( 
STR_DATA_ROLE_CATEGORIES )));
         aTranslationMap[ C2U( "error-bars-x" ) ] = OUString( String( ::chart::SchResId( 
STR_DATA_ROLE_X_ERROR )));
diff --git a/comphelper/source/container/container.cxx b/comphelper/source/container/container.cxx
index ffc514f..7bf2f8f 100644
--- a/comphelper/source/container/container.cxx
+++ b/comphelper/source/container/container.cxx
@@ -113,7 +113,7 @@ IndexAccessIterator::~IndexAccessIterator() {}
                     bCheckingStartingPoint = sal_False;
                 }
 
-                if ((m_arrChildIndizies.size() == 0) && !bCheckingStartingPoint)
+                if (m_arrChildIndizies.empty() && !bCheckingStartingPoint)
                 {   // das ist genau dann der Fall, wenn ich keinen rechten Nachbarn fuer 
irgendeinen der direkten Vorfahren des
                     // urspruenglichen xSearchLoop gefunden habe
                     bHasMoreToSearch = sal_False;
@@ -138,7 +138,7 @@ IndexAccessIterator::~IndexAccessIterator() {}
 
     if (!bFoundSomething)
     {
-        OSL_ENSURE(m_arrChildIndizies.size() == 0, "IndexAccessIterator::Next : items left on 
stack ! how this ?");
+        OSL_ENSURE(m_arrChildIndizies.empty(), "IndexAccessIterator::Next : items left on stack ! 
how this ?");
         Invalidate();
     }
 
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx 
b/connectivity/source/drivers/file/fanalyzer.cxx
index b954b61..d5f327d 100644
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ b/connectivity/source/drivers/file/fanalyzer.cxx
@@ -263,7 +263,7 @@ void OSQLAnalyzer::describeParam(::rtl::Reference<OSQLColumns> rParameterColumns
     OOperand* pOperand = aCodeStack.top();
     aCodeStack.pop();
 
-    OSL_ENSURE(aCodeStack.size() == 0, "StackFehler");
+    OSL_ENSURE(aCodeStack.empty(), "StackFehler");
     OSL_ENSURE(pOperand, "StackFehler");
     if (IS_TYPE(OOperandResult,pOperand))
         delete pOperand;
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 84e7c8b..b984e3f 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -578,7 +578,7 @@ sal_Bool OPredicateInterpreter::evaluate(OCodeList& rCodeList)
     OOperand* pOperand = m_aStack.top();
     m_aStack.pop();
 
-    DBG_ASSERT(m_aStack.size() == 0, "StackFehler");
+    DBG_ASSERT(m_aStack.empty(), "StackFehler");
     DBG_ASSERT(pOperand, "StackFehler");
 
     bResult = pOperand->isValid();
@@ -605,7 +605,7 @@ void OPredicateInterpreter::evaluateSelection(OCodeList& rCodeList,ORowSetValueD
     OOperand* pOperand = m_aStack.top();
     m_aStack.pop();
 
-    DBG_ASSERT(m_aStack.size() == 0, "StackFehler");
+    DBG_ASSERT(m_aStack.empty(), "StackFehler");
     DBG_ASSERT(pOperand, "StackFehler");
 
     (*_rVal) = pOperand->getValue();
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx 
b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
index 346dcc0..1678716 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSProfileDiscover.cxx
@@ -300,7 +300,7 @@ namespace connectivity
                 //default profile setted in mozilla registry
                 return m_Product.mCurrentProfileName;
             }
-            if (m_Product.mProfileList.size() == 0)
+            if (m_Product.mProfileList.empty())
             {
                 //there are not any profiles
                 return ::rtl::OUString();
diff --git a/connectivity/source/drivers/postgresql/pq_tools.hxx 
b/connectivity/source/drivers/postgresql/pq_tools.hxx
index 152d005..fd72b80 100644
--- a/connectivity/source/drivers/postgresql/pq_tools.hxx
+++ b/connectivity/source/drivers/postgresql/pq_tools.hxx
@@ -197,7 +197,7 @@ public:
 
 template < typename T, typename Allocator > com::sun::star::uno::Sequence<T> sequence_of_vector ( 
const std::vector<T, Allocator> &vec )
 {
-    if ( vec.size() == 0 )
+    if ( vec.empty() )
         return com::sun::star::uno::Sequence<T>();
     else
         return com::sun::star::uno::Sequence<T>( &vec[0], vec.size());
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 7775349..9def266 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -133,8 +133,8 @@ void OWizColumnSelect::Reset()
 void OWizColumnSelect::ActivatePage( )
 {
     DBG_CHKTHIS(OWizColumnSelect,NULL);
-    // if there are no dest columns reset the left side with the origibnal columns
-    if(m_pParent->getDestColumns()->size() == 0)
+    // if there are no dest columns reset the left side with the original columns
+    if(m_pParent->getDestColumns()->empty())
         Reset();
 
     clearListBox(m_lbNewColumnNames);
diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx 
b/dbaccess/source/ui/querydesign/QueryTableView.cxx
index 0d9b4c7..dde2991 100644
--- a/dbaccess/source/ui/querydesign/QueryTableView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx
@@ -281,7 +281,7 @@ void OQueryTableView::ReSync()
 {
     DBG_CHKTHIS(OQueryTableView,NULL);
     TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData();
-    OSL_ENSURE((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0),
+    OSL_ENSURE(getTableConnections()->empty() && GetTabWinMap()->empty(),
         "vor OQueryTableView::ReSync() bitte ClearAll aufrufen !");
 
     // ich brauche eine Sammlung aller Fensternamen, deren Anlegen schief geht, damit ich die 
entsprechenden Connections
diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx 
b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
index 539c2e4..321718b 100644
--- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx
+++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx
@@ -59,7 +59,7 @@ void OTableConnectionData::Init()
 {
     //////////////////////////////////////////////////////////////////////
     // LineDataList mit Defaults initialisieren
-    OSL_ENSURE(m_vConnLineData.size() == 0, "OTableConnectionData::Init() : nur mit leere 
Linienliste aufzurufen !");
+    OSL_ENSURE(m_vConnLineData.empty(), "OTableConnectionData::Init() : nur mit leere Linienliste 
aufzurufen !");
     ResetConnLines(sal_True);
         // das legt Defaults an
 }
diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx 
b/desktop/source/deployment/registry/dp_backenddb.cxx
index 85d07f8..a219f13 100644
--- a/desktop/source/deployment/registry/dp_backenddb.cxx
+++ b/desktop/source/deployment/registry/dp_backenddb.cxx
@@ -296,7 +296,7 @@ void BackendDb::writeVectorOfPair(
     css::uno::Reference<css::xml::dom::XNode> const & xParent)
 {
     try{
-        if (vecPairs.size() == 0)
+        if (vecPairs.empty())
             return;
         const OUString sNameSpace = getDbNSName();
         OSL_ASSERT(!sNameSpace.isEmpty());
@@ -413,7 +413,7 @@ void BackendDb::writeSimpleList(
 {
     try
     {
-        if (list.size() == 0)
+        if (list.empty())
             return;
         const OUString sNameSpace = getDbNSName();
         const OUString sPrefix(getNSPrefix() + OUSTR(":"));
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx 
b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
index 5dba571..0750d38 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx
@@ -344,7 +344,7 @@ void printf_packages(
 {
     OSL_ASSERT(allExtensions.size() == vecUnaccepted.size());
 
-    if (allExtensions.size() == 0)
+    if (allExtensions.empty())
     {
         printf_space( level );
         dp_misc::writeConsole("<none>\n");
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index f76b0ca..f24e712 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2078,7 +2078,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
     const ::svx::SpellPortions& rNewPortions,
     bool bRecheck )
 {
-    // Note: rNewPortions.size() == 0 is valid and happens when the whole
+    // Note: rNewPortions.empty() is valid and happens when the whole
     // sentence got removed in the dialog
 
     DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized");
diff --git a/editeng/source/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx
index f473a18..f2c8288 100644
--- a/editeng/source/misc/txtrange.cxx
+++ b/editeng/source/misc/txtrange.cxx
@@ -409,7 +409,7 @@ void SvxBoundArgs::Calc( const PolyPolygon& rPoly )
     }
     if( !bMultiple )
     {
-        DBG_ASSERT( pLongArr->size() == 0, "I said: Simple!" );
+        DBG_ASSERT( pLongArr->empty(), "I said: Simple!" );
         if( nAct )
         {
             if( bInner )
diff --git a/editeng/source/outliner/outlobj.cxx b/editeng/source/outliner/outlobj.cxx
index 32bec10..3578c3a 100644
--- a/editeng/source/outliner/outlobj.cxx
+++ b/editeng/source/outliner/outlobj.cxx
@@ -57,7 +57,7 @@ public:
         mbIsEditDoc(bIsEditDoc),
         mnRefCount(0)
     {
-        if( (maParagraphDataVector.size() == 0) && (pEditTextObject->GetParagraphCount() != 0) )
+        if( maParagraphDataVector.empty() && (pEditTextObject->GetParagraphCount() != 0) )
             maParagraphDataVector.resize(pEditTextObject->GetParagraphCount());
     }
 
diff --git a/extensions/qa/update/test_update.cxx b/extensions/qa/update/test_update.cxx
index af93e66..3551f8a 100644
--- a/extensions/qa/update/test_update.cxx
+++ b/extensions/qa/update/test_update.cxx
@@ -154,7 +154,7 @@ protected:
                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "123456-abcdef-1a2b3c-4d5e6f" ) ),
                     rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "InstallSetID" ) ) ) )
         {
-            CPPUNIT_ASSERT( aInfo.Sources.size() == 0 );
+            CPPUNIT_ASSERT( aInfo.Sources.empty() );
         }
         else
             CPPUNIT_FAIL( "Calling checkForUpdates() failed." );
diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx
index 204da93..e937a33 100644
--- a/forms/source/component/EventThread.cxx
+++ b/forms/source/component/EventThread.cxx
@@ -65,7 +65,7 @@ OComponentEventThread::~OComponentEventThread()
 {
     DBG_DTOR( OComponentEventThread, NULL );
 
-    DBG_ASSERT( m_aEvents.size() == 0,
+    DBG_ASSERT( m_aEvents.empty(),
         "OComponentEventThread::~OComponentEventThread: Kein dispose gerufen?" );
 
     impl_clearEventQueue();
diff --git a/fpicker/source/unx/kde_unx/UnxCommandThread.cxx 
b/fpicker/source/unx/kde_unx/UnxCommandThread.cxx
index d929be3..8f7ee3d 100644
--- a/fpicker/source/unx/kde_unx/UnxCommandThread.cxx
+++ b/fpicker/source/unx/kde_unx/UnxCommandThread.cxx
@@ -182,7 +182,7 @@ void SAL_CALL UnxFilePickerCommandThread::handleCommand( const ::rtl::OUString &
 
     ::std::list< ::rtl::OUString > aList = tokenize( rCommand );
 
-    if ( aList.size() == 0 )
+    if ( aList.empty() )
         return;
 
     ::rtl::OUString aCommandName = aList.front();
diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx 
b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 17af330..2777662 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -775,7 +775,7 @@ void VistaFilePickerImpl::impl_sta_setFiltersOnDialog()
     aLock.clear();
     // <- SYNCHRONIZED
 
-    if (lFilters.size() == 0)
+    if (lFilters.empty())
         return;
 
     COMDLG_FILTERSPEC   *pFilt = &lFilters[0];
diff --git a/lotuswordpro/source/filter/xfilter/xfindex.cxx 
b/lotuswordpro/source/filter/xfilter/xfindex.cxx
index 01034db..1fc791b 100644
--- a/lotuswordpro/source/filter/xfilter/xfindex.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfindex.cxx
@@ -211,7 +211,7 @@ void    XFIndex::ToXml(IXFStream *pStrm)
     {
         for(sal_uInt16 i=1; i <= MAX_TOC_LEVEL; i++)
         {
-            if (m_aTOCSource[i].size() == 0)
+            if (m_aTOCSource[i].empty())
             {
                 // unnecessary to output this level
                 continue;
diff --git a/registry/tools/regcompare.cxx b/registry/tools/regcompare.cxx
index c12e1c1..5426d4c 100644
--- a/registry/tools/regcompare.cxx
+++ b/registry/tools/regcompare.cxx
@@ -262,11 +262,11 @@ bool Options_Impl::initOptions_Impl (std::vector< std::string > & rArgs)
         }
     }
 
-    if ( m_regName1.size() == 0 )
+    if ( m_regName1.empty() )
     {
         return badOption("missing", "-r1");
     }
-    if ( m_regName2.size() == 0 )
+    if ( m_regName2.empty() )
     {
         return badOption("missing", "-r2");
     }
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 86a4d7c..9588638 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -311,7 +311,7 @@ sal_Bool ScValueIterator::GetThis(double& rValue, sal_uInt16& rErr)
                     }
                 }
                 pCol = &(pDoc->maTabs[nTab])->aCol[nCol];
-            } while ( pCol->maItems.size() == 0 );
+            } while ( pCol->maItems.empty() );
             pCol->Search( nRow, nColRow );
         }
 
@@ -1040,7 +1040,7 @@ ScBaseCell* ScCellIterator::GetThis()
                         return NULL;                // Ende und Aus
                 }
                 pCol = &(pDoc->maTabs[nTab])->aCol[nCol];
-            } while ( pCol->maItems.size() == 0 );
+            } while ( pCol->maItems.empty() );
             pCol->Search( nRow, nColRow );
         }
 
@@ -1152,7 +1152,7 @@ ScBaseCell* ScQueryCellIterator::GetThis()
                     nFirstQueryField = rEntry.nField;
                 }
                 pCol = &(pDoc->maTabs[nTab])->aCol[nCol];
-            } while ( pCol->maItems.size() == 0 );
+            } while ( pCol->maItems.empty() );
             pCol->Search( nRow, nColRow );
             bFirstStringIgnore = bIgnoreMismatchOnLeadingStrings &&
                 !mpParam->bHasHeader && rItem.meType == ScQueryEntry::ByString &&
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx
index d5c3f2a..02bce33 100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -640,7 +640,7 @@ void ScDPCache::AddLabel(ScDPItemData *pData)
 {
     OSL_ENSURE( IsValid(), "  IsValid() == false " );
 
-    if ( maLabelNames.size() == 0 )
+    if ( maLabelNames.empty() )
         maLabelNames.push_back( new ScDPItemData(ScGlobal::GetRscString(STR_PIVOT_DATA)) );
 
     //reset name if needed
@@ -745,7 +745,7 @@ bool ScDPCache::IsDateDimension( long nDim ) const
 {
     if ( nDim >= mnColumnCount )
         return false;
-    else if ( maTableDataValues[nDim].size()==0 )
+    else if ( maTableDataValues[nDim].empty() )
         return false;
     else
         return maTableDataValues[nDim][0].IsDate();
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 8a96403..590e7ba 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -563,7 +563,7 @@ void ScViewData::CreateTabData( std::vector< SCTAB >& rvTabs )
 
 void ScViewData::SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs )
 {
-    sal_Bool bAll = ( tabs.size() == 0 );
+    sal_Bool bAll = tabs.empty();
 
     if ( !bAll ) // create associated table data
         CreateTabData( tabs );
@@ -603,7 +603,7 @@ void ScViewData::SetZoomType( SvxZoomType eNew, sal_Bool bAll )
 
 void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vector< SCTAB >& tabs 
)
 {
-    sal_Bool bAll = ( tabs.size() == 0 );
+    sal_Bool bAll = tabs.empty();
     if ( !bAll ) // create associated table data
         CreateTabData( tabs );
     Fraction aFrac20( 1,5 );
diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx 
b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
index bd215a4..09b082a 100644
--- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
+++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx
@@ -280,7 +280,7 @@ void LayeredDevice::Repaint (const Region& rRepaintRegion)
 
 void LayeredDevice::RepaintRectangle (const Rectangle& rRepaintRectangle)
 {
-    if (mpLayers->size() == 0)
+    if (mpLayers->empty())
         return;
     else if (mpLayers->size() == 1)
     {
diff --git a/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.cxx 
b/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.cxx
index 71064c3..68c94a7 100644
--- a/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.cxx
+++ b/sd/source/ui/toolpanel/controls/MasterPageContainerQueue.cxx
@@ -217,7 +217,7 @@ IMPL_LINK(MasterPageContainerQueue, DelayedPreviewCreation, Timer*, pTimer)
 
     do
     {
-        if (mpRequestQueue->size() == 0)
+        if (mpRequestQueue->empty())
             break;
 
         // First check whether the system is idle.
diff --git a/sdext/source/presenter/PresenterTimer.cxx b/sdext/source/presenter/PresenterTimer.cxx
index 3757bd0..dca44fd 100644
--- a/sdext/source/presenter/PresenterTimer.cxx
+++ b/sdext/source/presenter/PresenterTimer.cxx
@@ -260,7 +260,7 @@ void TimerScheduler::CancelTask (const sal_Int32 nTaskId)
 
     // When the last active task was canceled then the timer can be
     // stopped.
-    if (maScheduledTasks.size() == 0)
+    if (maScheduledTasks.empty())
     {
         mbIsRunning = false;
         resume();
@@ -477,7 +477,7 @@ void PresenterClockTimer::RemoveListener (const SharedListener& rListener)
         rListener));
     if (iListener != maListeners.end())
         maListeners.erase(iListener);
-    if (maListeners.size() == 0)
+    if (maListeners.empty())
     {
         // We have no more clients and therefore are not interested in time changes.
         if (mnTimerTaskId != PresenterTimer::NotAValidTaskId)
diff --git a/sdext/source/presenter/PresenterToolBar.cxx 
b/sdext/source/presenter/PresenterToolBar.cxx
index 23a19cd..3a6aa83 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -727,7 +727,7 @@ void PresenterToolBar::ProcessEntry (
 void PresenterToolBar::Layout (
     const Reference<rendering::XCanvas>& rxCanvas)
 {
-    if (maElementContainer.size() == 0)
+    if (maElementContainer.empty())
         return;
 
     mbIsLayoutPending = false;
diff --git a/shell/source/win32/simplemail/senddoc.cxx b/shell/source/win32/simplemail/senddoc.cxx
index 49ae9d8..54169e5 100644
--- a/shell/source/win32/simplemail/senddoc.cxx
+++ b/shell/source/win32/simplemail/senddoc.cxx
@@ -111,7 +111,7 @@ void addRecipient(
 /** @internal */
 void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
 {
-    OSL_ASSERT(pMapiRecipientList->size() == 0);
+    OSL_ASSERT(pMapiRecipientList->empty());
 
     // add to recipients
     StringListIterator_t iter = gTo.begin();
@@ -135,7 +135,7 @@ void initRecipientList(MapiRecipientList_t* pMapiRecipientList)
 /** @internal */
 void initAttachementList(MapiAttachmentList_t* pMapiAttachmentList)
 {
-    OSL_ASSERT(pMapiAttachmentList->size() == 0);
+    OSL_ASSERT(pMapiAttachmentList->empty());
 
     StringListIterator_t iter = gAttachments.begin();
     StringListIterator_t iter_end = gAttachments.end();
diff --git a/shell/source/win32/simplemail/smplmailclient.cxx 
b/shell/source/win32/simplemail/smplmailclient.cxx
index 09ab23f..4b70c8a 100644
--- a/shell/source/win32/simplemail/smplmailclient.cxx
+++ b/shell/source/win32/simplemail/smplmailclient.cxx
@@ -186,7 +186,7 @@ void CSmplMailClient::assembleCommandLine(
     const Reference<XSimpleMailMessage>& xSimpleMailMessage,
     sal_Int32 aFlag, StringList_t& rCommandArgs)
 {
-    OSL_ENSURE(rCommandArgs.size() == 0, "Provided command argument buffer not empty");
+    OSL_ENSURE(rCommandArgs.empty(), "Provided command argument buffer not empty");
 
     rtl::OUString to = xSimpleMailMessage->getRecipient();
     if (to.getLength() > 0)
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index c2d7f4f..9914098 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -290,7 +290,7 @@ void SmCursor::Delete(){
     //Take the selected nodes and delete them...
     SmNodeList::iterator patchIt = TakeSelectedNodesFromList(pLineList);
 
-    //Get teh position to set after delete
+    //Get the position to set after delete
     PosAfterDelete = PatchLineList(pLineList, patchIt);
 
     //Finish editing
@@ -298,7 +298,7 @@ void SmCursor::Delete(){
 }
 
 void SmCursor::InsertNodes(SmNodeList* pNewNodes){
-    if(pNewNodes->size() == 0){
+    if(pNewNodes->empty()){
         delete pNewNodes;
         return;
     }
@@ -702,7 +702,7 @@ void SmCursor::InsertBrackets(SmBracketType eBracketType) {
     //If there's no selected nodes, create a place node
     SmNode *pBodyNode;
     SmCaretPos PosAfterInsert;
-    if(pSelectedNodesList->size() == 0) {
+    if(pSelectedNodesList->empty()) {
         pBodyNode = new SmPlaceNode();
         PosAfterInsert = SmCaretPos(pBodyNode, 1);
     } else
@@ -871,7 +871,7 @@ bool SmCursor::InsertRow() {
         it = pLineList->end();
         if(it != pLineList->begin())
             --it;
-        if(pNewLineList->size() == 0)
+        if(pNewLineList->empty())
             pNewLineList->push_front(new SmPlaceNode());
         //Parse new line
         SmNode *pNewLine = SmNodeListParser().Parse(pNewLineList);
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index bc9037b..33feb52 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1291,7 +1291,7 @@ void SmShowSymbolSet::SelectSymbol(sal_uInt16 nSymbol)
     if (nSymbol < aSymbolSet.size())
         nSelectSymbol = nSymbol;
 
-    if (aSymbolSet.size() == 0)
+    if (aSymbolSet.empty())
         nSelectSymbol = SYMBOL_NONE;
 
     if (nSelectSymbol != SYMBOL_NONE)
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 7876956..9b7c2a5 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -1112,7 +1112,7 @@ void SmParser::Line()
     //If there's no expression, add an empty one.
     //this is to avoid a formula tree without any caret
     //positions, in visual formula editor.
-    if(ExpressionArray.size() == 0)
+    if(ExpressionArray.empty())
         ExpressionArray.push_back(new SmExpressionNode(SmToken()));
 
     SmStructureNode *pSNode = new SmLineNode(m_aCurToken);
diff --git a/stoc/source/registry_tdprovider/rdbtdp_tdenumeration.cxx 
b/stoc/source/registry_tdprovider/rdbtdp_tdenumeration.cxx
index d5bcd9b..cfc59a1 100644
--- a/stoc/source/registry_tdprovider/rdbtdp_tdenumeration.cxx
+++ b/stoc/source/registry_tdprovider/rdbtdp_tdenumeration.cxx
@@ -171,7 +171,7 @@ TypeDescriptionEnumerationImpl::createInstance(
     if ( !bOpenKeySucceeded )
         throw reflection::NoSuchTypeNameException();
 
-    if ( aModuleKeys.size() == 0 )
+    if ( aModuleKeys.empty() )
         throw reflection::InvalidTypeNameException();
 
     return rtl::Reference< TypeDescriptionEnumerationImpl >(
diff --git a/stoc/source/tdmanager/tdmgr.cxx b/stoc/source/tdmanager/tdmgr.cxx
index d3d5ced..e8a8256 100644
--- a/stoc/source/tdmanager/tdmgr.cxx
+++ b/stoc/source/tdmanager/tdmgr.cxx
@@ -290,7 +290,7 @@ ManagerImpl::ManagerImpl(
 
//__________________________________________________________________________________________________
 ManagerImpl::~ManagerImpl()
 {
-    OSL_ENSURE( _aProviders.size() == 0, "### still providers left!" );
+    OSL_ENSURE( _aProviders.empty(), "### still providers left!" );
     OSL_TRACE( "> TypeDescriptionManager shut down. <" );
     ::g_moduleCount.modCnt.release( &::g_moduleCount.modCnt );
 }
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 0bfe673..44941b9 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -3688,7 +3688,7 @@ void DbGridControl::EndCursorAction()
 void DbGridControl::ConnectToFields()
 {
     ColumnFieldValueListeners* pListeners = (ColumnFieldValueListeners*)m_pFieldListeners;
-    DBG_ASSERT(!pListeners || pListeners->size() == 0, "DbGridControl::ConnectToFields : please 
call DisconnectFromFields first !");
+    DBG_ASSERT(!pListeners || pListeners->empty(), "DbGridControl::ConnectToFields : please call 
DisconnectFromFields first !");
 
     if (!pListeners)
     {
diff --git a/sw/source/core/SwNumberTree/SwNumberTree.cxx 
b/sw/source/core/SwNumberTree/SwNumberTree.cxx
index bc34218..b2359f9 100644
--- a/sw/source/core/SwNumberTree/SwNumberTree.cxx
+++ b/sw/source/core/SwNumberTree/SwNumberTree.cxx
@@ -358,7 +358,7 @@ SwNumberTreeNode * SwNumberTreeNode::GetFirstNonPhantomChild()
 void SwNumberTreeNode::MoveGreaterChildren( SwNumberTreeNode& _rCompareNode,
                                             SwNumberTreeNode& _rDestNode )
 {
-    if ( mChildren.size() == 0 )
+    if ( mChildren.empty() )
         return;
 
     // determine first child, which has to move to <_rDestNode>
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index b502d12..8fbe520 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1276,7 +1276,7 @@ void SwEditShell::MoveContinuationPosToEndOfCheckedSentence()
 
 void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, bool bRecheck)
 {
-    // Note: rNewPortions.size() == 0 is valid and happens when the whole
+    // Note: rNewPortions.empty() is valid and happens when the whole
     // sentence got removed in the dialog
 
     OSL_ENSURE(  pSpellIter, "SpellIter missing" );
diff --git a/sw/source/core/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx
index d2ba75e..3f68127 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -2068,7 +2068,7 @@ SwSaveRowSpan* SwTable::CleanUpTopRowSpan( sal_uInt16 nSplitLine )
     if( !IsNewModel() )
         return pRet;
     pRet = new SwSaveRowSpan( GetTabLines()[0]->GetTabBoxes(), nSplitLine );
-    if( pRet->mnRowSpans.size() == 0 )
+    if( pRet->mnRowSpans.empty() )
     {
         delete pRet;
         pRet = 0;
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 998197d..b6bdcb4 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -1676,7 +1676,7 @@ bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const 
xub_StrLen n
 {
     bool bHasBookmark = false;
 
-    if ( m_rSortedMarksStart.size( ) > 0 )
+    if ( !m_rSortedMarksStart.empty() )
     {
         IMark* pMarkStart = m_rSortedMarksStart.front();
         xub_StrLen nNext = pMarkStart->GetMarkStart().nContent.GetIndex();
@@ -1687,7 +1687,7 @@ bool MSWordExportBase::NearestBookmark( xub_StrLen& rNearest, const 
xub_StrLen n
         }
     }
 
-    if ( m_rSortedMarksEnd.size( ) > 0 )
+    if ( !m_rSortedMarksEnd.empty() )
     {
         IMark* pMarkEnd = m_rSortedMarksEnd[0];
         xub_StrLen nNext = pMarkEnd->GetMarkEnd().nContent.GetIndex();
diff --git a/sw/source/ui/wrtsh/navmgr.cxx b/sw/source/ui/wrtsh/navmgr.cxx
index 6ee6222..cbdb5ac 100644
--- a/sw/source/ui/wrtsh/navmgr.cxx
+++ b/sw/source/ui/wrtsh/navmgr.cxx
@@ -201,7 +201,7 @@ bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
         bRet = true;
     }
     else {
-        if ( (m_entries.size() > 0 && *m_entries.back()->GetPoint() != rPos) || (m_entries.size() 
== 0) ) {
+        if ( (!m_entries.empty()  && *m_entries.back()->GetPoint() != rPos) || (m_entries.empty()) 
) {
             SwUnoCrsr *const pCursor = m_rMyShell.GetDoc()->CreateUnoCrsr(rPos);
             m_entries.push_back(::boost::shared_ptr<SwUnoCrsr>(pCursor));
             bRet = true;
diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx
index 3c64fbe0..501f4e3 100644
--- a/ucb/source/ucp/tdoc/tdoc_storage.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx
@@ -72,7 +72,7 @@ StorageElementFactory::StorageElementFactory(
 //=========================================================================
 StorageElementFactory::~StorageElementFactory()
 {
-    OSL_ENSURE( m_aMap.size() == 0,
+    OSL_ENSURE( m_aMap.empty(),
         "StorageElementFactory::~StorageElementFactory - Dangling storages!" );
 }
 
diff --git a/ucb/source/ucp/webdav/ContentProperties.cxx 
b/ucb/source/ucp/webdav/ContentProperties.cxx
index 21c59b3..cebd00a 100644
--- a/ucb/source/ucp/webdav/ContentProperties.cxx
+++ b/ucb/source/ucp/webdav/ContentProperties.cxx
@@ -391,7 +391,7 @@ bool ContentProperties::containsAllNames(
         }
     }
 
-    return ( rNamesNotContained.size() == 0 );
+    return ( rNamesNotContained.empty() );
 }
 
 //=========================================================================
diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
index 58cf37b..f219b6c 100644
--- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
@@ -49,7 +49,7 @@ void process_headers( ne_request * req,
         rtl::OUString aHeaderValue( rtl::OUString::createFromAscii( value ) );
 
         // Note: Empty vector means that all headers are requested.
-        bool bIncludeIt = ( rHeaderNames.size() == 0 );
+        bool bIncludeIt = rHeaderNames.empyt();
 
         if ( !bIncludeIt )
         {
diff --git a/ucb/source/ucp/webdav/NeonLockStore.cxx b/ucb/source/ucp/webdav/NeonLockStore.cxx
index 53dd1b4..1ad726a 100644
--- a/ucb/source/ucp/webdav/NeonLockStore.cxx
+++ b/ucb/source/ucp/webdav/NeonLockStore.cxx
@@ -98,7 +98,7 @@ NeonLockStore::~NeonLockStore()
     stopTicker();
 
     // release active locks, if any.
-    OSL_ENSURE( m_aLockInfoMap.size() == 0,
+    OSL_ENSURE( m_aLockInfoMap.empty(),
                 "NeonLockStore::~NeonLockStore - Releasing active locks!" );
 
     LockInfoMap::const_iterator it( m_aLockInfoMap.begin() );
diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx
index 3ab4d39..64024ba 100644
--- a/ucb/source/ucp/webdav/NeonSession.cxx
+++ b/ucb/source/ucp/webdav/NeonSession.cxx
@@ -1897,7 +1897,7 @@ void runResponseHeaderHandler( void * userdata,
             = static_cast< NeonRequestContext * >( userdata );
 
         // Note: Empty vector means that all headers are requested.
-        bool bIncludeIt = ( pCtx->pHeaderNames->size() == 0 );
+        bool bIncludeIt = pCtx->pHeaderNames->empty();
 
         if ( !bIncludeIt )
         {
diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx
index 6287eda..ee76d95 100644
--- a/vcl/generic/print/glyphset.cxx
+++ b/vcl/generic/print/glyphset.cxx
@@ -210,14 +210,14 @@ GlyphSet::GetSymbolMapping (sal_Unicode nUnicodeChar)
 void
 GlyphSet::AddNotdef (char_map_t &rCharMap)
 {
-    if (rCharMap.size() == 0)
+    if (rCharMap.empty())
         rCharMap[0] = 0;
 }
 
 void
 GlyphSet::AddNotdef (glyph_map_t &rGlyphMap)
 {
-    if (rGlyphMap.size() == 0)
+    if (rGlyphMap.empty())
         rGlyphMap[0] = 0;
 }
 sal_Bool
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 79ded4b..8456d86 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2272,7 +2272,7 @@ ImplFontEntry* ImplPdfBuiltinFontData::CreateFontInstance( FontSelectPattern& 
rF
 
 ImplDevFontList* PDFWriterImpl::filterDevFontList( ImplDevFontList* pFontList )
 {
-    DBG_ASSERT( m_aSubsets.size() == 0, "Fonts changing during PDF generation, document will be 
invalid" );
+    DBG_ASSERT( m_aSubsets.empty(), "Fonts changing during PDF generation, document will be 
invalid" );
     ImplDevFontList* pFiltered = pFontList->Clone( true, true );
 
     // append the PDF builtin fonts
diff --git a/writerfilter/source/doctok/WW8DocumentImpl.cxx 
b/writerfilter/source/doctok/WW8DocumentImpl.cxx
index b5e15ed..fd62856 100644
--- a/writerfilter/source/doctok/WW8DocumentImpl.cxx
+++ b/writerfilter/source/doctok/WW8DocumentImpl.cxx
@@ -164,7 +164,7 @@ public:
     {
         string s((*SprmIdToString::Instance())(rId));
 
-        if (s.size() == 0)
+        if (s.empty())
             s = (*QNameToString::Instance())(rId);
 
         return s;
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx 
b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index 4b183b9..f892357 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -111,7 +111,7 @@ public:
     {
         string s((*QNameToString::Instance())(rId));
 
-        if (s.size() == 0)
+        if (s.empty())
             s = "(fasttoken)" + fastTokenToId(rId);
         else
             s = "(qname)" + s;
diff --git a/writerfilter/source/ooxml/OOXMLFastHelper.hxx 
b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
index f955566..c0296c4 100644
--- a/writerfilter/source/ooxml/OOXMLFastHelper.hxx
+++ b/writerfilter/source/ooxml/OOXMLFastHelper.hxx
@@ -191,7 +191,7 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
          ::rtl::OUStringToOString
          (rValue, RTL_TEXTENCODING_ASCII_US).getStr());
 
-    if (aStr.size() == 0)
+    if (aStr.empty())
         debug_logger->element( "unknown-qname" );
 #endif
 
@@ -217,7 +217,7 @@ void OOXMLFastHelper<T>::newProperty(OOXMLFastContextHandler * pHandler,
     debug_logger->attribute("name", aStr);
     debug_logger->attribute("value", pVal->toString());
 
-    if (aStr.size() == 0)
+    if (aStr.empty())
         debug_logger->element("unknown-qname");
 
     debug_logger->endElement();
@@ -243,7 +243,7 @@ void OOXMLFastHelper<T>::mark(OOXMLFastContextHandler * pHandler,
      ::rtl::OUStringToOString
      (rValue, RTL_TEXTENCODING_ASCII_US).getStr());
 
-    if (aStr.size() == 0)
+    if (aStr.empty())
         debug_logger->element("unknown-qname");
 
     debug_logger->endElement();
diff --git a/writerperfect/source/filter/OdgGenerator.cxx 
b/writerperfect/source/filter/OdgGenerator.cxx
index 6d58aa4..52f1329 100644
--- a/writerperfect/source/filter/OdgGenerator.cxx
+++ b/writerperfect/source/filter/OdgGenerator.cxx
@@ -222,7 +222,7 @@ static WPXString doubleToString(const double value)
 #else
     std::string decimalPoint(".");
 #endif
-    if ((decimalPoint.size() == 0) || (decimalPoint == "."))
+    if (decimalPoint.empty() || (decimalPoint == "."))
         return tempString;
     std::string stringValue(tempString.cstr());
     if (!stringValue.empty())
diff --git a/xmloff/source/core/RDFaImportHelper.cxx b/xmloff/source/core/RDFaImportHelper.cxx
index 6b980d4..be466c8 100644
--- a/xmloff/source/core/RDFaImportHelper.cxx
+++ b/xmloff/source/core/RDFaImportHelper.cxx
@@ -236,7 +236,7 @@ RDFaReader::ReadCURIEs(::rtl::OUString const & i_rCURIEs) const
       }
     }
     while (!CURIEs.isEmpty());
-    if (!vec.size())
+    if (vec.empty())
     {
         OSL_TRACE( "ReadCURIEs: invalid CURIEs" );
     }
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index 3a964a3..5483632 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1579,7 +1579,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* 
pFormatter)
         //  and no color definition (detected by the '[' at the start)
 
         if ( nType == XML_TOK_STYLES_NUMBER_STYLE && !bHasExtraText &&
-                aMyConditions.size() == 0 && sFormat.toChar() != (sal_Unicode)'[' )
+                aMyConditions.empty() && sFormat.toChar() != (sal_Unicode)'[' )
             nIndex = pFormatter->GetStandardIndex( nFormatLang );
     }
     if ( bAutoInt )         // automatic integer digits
@@ -1587,7 +1587,7 @@ sal_Int32 SvXMLNumFormatContext::CreateAndInsert(SvNumberFormatter* 
pFormatter)
         //! only if two decimal places was set?
 
         if ( nType == XML_TOK_STYLES_NUMBER_STYLE && !bHasExtraText &&
-                aMyConditions.size() == 0 && sFormat.toChar() != (sal_Unicode)'[' )
+                aMyConditions.empty() && sFormat.toChar() != (sal_Unicode)'[' )
             nIndex = pFormatter->GetFormatIndex( NF_NUMBER_SYSTEM, nFormatLang );
     }
 
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 3cd935a..029fd97 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -1337,7 +1337,7 @@ XMLTextParagraphExport::~XMLTextParagraphExport()
     txtparae_bContainsIllegalCharacters = sal_False;
 #endif
     PopTextListsHelper();
-    DBG_ASSERT( maTextListsHelperStack.size() == 0,
+    DBG_ASSERT( maTextListsHelperStack.empty(),
                 "misusage of text lists helper stack - it is not empty. Serious defect - please 
inform OD" );
 }
 
-- 
1.7.5.4

From 4500d347449bf8fa114a3ad0781ba4da7af657d3 Mon Sep 17 00:00:00 2001
From: Mariusz Dykierek <MariuszDykierek@gmail.com>
Date: Sun, 19 Feb 2012 18:35:42 +0100
Subject: [PATCH 2/2] Using empty() instead of size() == 0 (broad fix for
 cppcheck's Possible inefficient checking for '<sth>'
 emptiness)

---
 ucb/source/ucp/webdav/NeonHeadRequest.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ucb/source/ucp/webdav/NeonHeadRequest.cxx b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
index f219b6c..f930fb1 100644
--- a/ucb/source/ucp/webdav/NeonHeadRequest.cxx
+++ b/ucb/source/ucp/webdav/NeonHeadRequest.cxx
@@ -49,7 +49,7 @@ void process_headers( ne_request * req,
         rtl::OUString aHeaderValue( rtl::OUString::createFromAscii( value ) );
 
         // Note: Empty vector means that all headers are requested.
-        bool bIncludeIt = rHeaderNames.empyt();
+        bool bIncludeIt = rHeaderNames.empty();
 
         if ( !bIncludeIt )
         {
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.