diff options
author | Elton Chung <elton@layerjet.com> | 2012-02-19 16:59:40 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-02-19 17:07:46 +0400 |
commit | d30b4e9fb66f377295d8eeea8c1b1cf879aecdf6 (patch) | |
tree | a99079bda02a9d8dd5bd0d54666164f362314c52 | |
parent | 704c9477039e37b4910db6aa8dd644751dd5e6a5 (diff) |
Get rid of size() == 0
58 files changed, 77 insertions, 77 deletions
diff --git a/autodoc/inc/ary/info/ci_text.hxx b/autodoc/inc/ary/info/ci_text.hxx index 4e8bf7a99073..a178ff77de19 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 eb65a14de9ae..85be9cb9fb37 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 e067308295ca..35d647a85ebf 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 d194d6015744..832420f6fb96 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 f2cc54fb157e..4c5624fb0068 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 e0abe6d416a0..5d93ee09ec28 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 ffc514f81261..7bf2f8f6b160 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 b954b61e764f..d5f327d906da 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 84e7c8b88d00..b984e3f9fa3d 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 346dcc0bbbfd..16787167476b 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 152d0055054a..fd72b8082395 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 7775349f8f54..6e92b1dd34ee 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -134,7 +134,7 @@ 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(m_pParent->getDestColumns()->empty()) Reset(); clearListBox(m_lbNewColumnNames); diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx index 539c2e4e2207..321718bdf667 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 85d07f8414e8..a219f1308c00 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 5dba571ad637..0750d38d4d0e 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/misc/txtrange.cxx b/editeng/source/misc/txtrange.cxx index f473a18b2adb..f2c828819286 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 32bec10be139..3578c3a96640 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 af93e66c7ec2..3551f8a5022b 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 204da93dc387..e937a332c441 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 d929be362fff..8f7ee3d0c21c 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 17af33006c2a..2777662c7d3a 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 01034dbd485a..1fc791b99960 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 c12e1c1f200f..5426d4cd81a0 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 86a4d7c923ed..9588638bdf32 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 d5c3f2ae2700..cc60e6f03f4e 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 diff --git a/sc/source/ui/vba/vbahyperlinks.cxx b/sc/source/ui/vba/vbahyperlinks.cxx index 85c6ae6c218c..d83a76d5f864 100644 --- a/sc/source/ui/vba/vbahyperlinks.cxx +++ b/sc/source/ui/vba/vbahyperlinks.cxx @@ -46,7 +46,7 @@ namespace { bool lclContains( const ScRangeList& rScOuter, const uno::Reference< excel::XRange >& rxInner ) throw (uno::RuntimeException) { const ScRangeList& rScInner = ScVbaRange::getScRangeList( rxInner ); - if( (rScInner.size() == 0) || (rScOuter.size() == 0) ) + if( rScInner.empty() || rScOuter.empty() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Empty range objects" ) ), uno::Reference< uno::XInterface >() ); for( size_t nIndex = 0, nCount = rScInner.size(); nIndex < nCount; ++nIndex ) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 8a9640392316..a220fdf010f6 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 bd215a40b646..09b082a20db5 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 71064c35003b..68c94a70c527 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 3757bd0e06d8..dca44fda0cd9 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 23a19cd0a18f..3a6aa83635b1 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 49ae9d848f01..54169e581652 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 09ab23f70553..4b70c8a62627 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 c2d7f4f8498e..684521fef6a6 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -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 bc9037b43b1f..33feb52ed13f 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 787695685f58..9b7c2a5650ab 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/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx index eb35840b1642..1296ccd1ec70 100644 --- a/stoc/source/corereflection/crefl.cxx +++ b/stoc/source/corereflection/crefl.cxx @@ -159,7 +159,7 @@ void IdlReflectionServiceImpl::dispose() MutexGuard aGuard( _aComponentMutex ); _aElements.clear(); #ifdef TEST_LIST_CLASSES - OSL_ENSURE( g_aClassNames.size() == 0, "### idl classes still alive!" ); + OSL_ENSURE( g_aClassNames.empty(), "### idl classes still alive!" ); ClassNameList::const_iterator iPos( g_aClassNames.begin() ); while (iPos != g_aClassNames.end()) { diff --git a/stoc/source/registry_tdprovider/rdbtdp_tdenumeration.cxx b/stoc/source/registry_tdprovider/rdbtdp_tdenumeration.cxx index d5bcd9b08575..cfc59a186b77 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 d3d5ced731d5..e8a8256395c3 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 0bfe6734fc5a..44941b9a8db4 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 bc34218110ce..b2359f923d78 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/table/swnewtable.cxx b/sw/source/core/table/swnewtable.cxx index d2ba75e87b2c..3f68127408c8 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/ui/wrtsh/navmgr.cxx b/sw/source/ui/wrtsh/navmgr.cxx index 6ee622241e8c..66a53f14b5cf 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 3c64fbe0dcff..501f4e32fae0 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 21c59b306c06..cebd00a27b96 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 58cf37bf0f6e..2db9be5314be 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.empty() ); if ( !bIncludeIt ) { diff --git a/ucb/source/ucp/webdav/NeonLockStore.cxx b/ucb/source/ucp/webdav/NeonLockStore.cxx index 53dd1b4d5099..1ad726aec039 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 3ab4d3924108..b80d665aeaca 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 6287eda82a27..5b036664aacd 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 @@ -699,7 +699,7 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx) PSDefineReencodedFont (pOutFile, nGlyphSetID); continue; } - if ((*aGlyphSet).size() == 0) // empty set, doesn't need reencoding + if ((*aGlyphSet).empty()) // empty set, doesn't need reencoding { continue; } @@ -845,7 +845,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42 aCharSet != maCharList.end(); ++aCharSet, nCharSetID++) { - if ((*aCharSet).size() == 0) + if ((*aCharSet).empty()) continue; // loop thru all the chars in the subset @@ -877,7 +877,7 @@ GlyphSet::PSUploadFont (osl::File& rOutFile, PrinterGfx &rGfx, bool bAllowType42 aGlyphSet != maGlyphList.end(); ++aGlyphSet, nGlyphSetID++) { - if ((*aGlyphSet).size() == 0) + if ((*aGlyphSet).empty()) continue; // loop thru all the glyphs in the subset diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 79ded4b95129..8456d866f73f 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/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 85a6751ac212..ce6c0514c492 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -859,7 +859,7 @@ void GraphiteLayout::expandOrCondense(ImplLayoutArgs &rArgs) } else if (nDeltaWidth < 0)// condense - apply a factor to all glyph positions { - if (mvGlyphs.size() == 0) return; + if (mvGlyphs.empty()) return; Glyphs::iterator iLastGlyph = mvGlyphs.begin() + (mvGlyphs.size() - 1); // position last glyph using original width float fXFactor = static_cast<float>(rArgs.mnLayoutWidth - iLastGlyph->mnOrigWidth) / static_cast<float>(iLastGlyph->maLinearPos.X()); diff --git a/writerfilter/qa/cppunittests/odiapi/testProperty.cxx b/writerfilter/qa/cppunittests/odiapi/testProperty.cxx index 3ec344848b74..dc8d519a622a 100644 --- a/writerfilter/qa/cppunittests/odiapi/testProperty.cxx +++ b/writerfilter/qa/cppunittests/odiapi/testProperty.cxx @@ -207,7 +207,7 @@ public: pb->clear(); - CPPUNIT_ASSERT_MESSAGE("Clearing property bag failed", pb->size() == 0); + CPPUNIT_ASSERT_MESSAGE("Clearing property bag failed", pb->empty()); } void testSortPropertyBag() @@ -393,7 +393,7 @@ public: PropertyBag_Pointer_t pb = createPropertyBag(); PropertyPoolHandle_Pointer_t ph = pool->insert(pb); - CPPUNIT_ASSERT_MESSAGE("Inserting empty property bag failed", ph->getPropertyBag()->size() == 0); + CPPUNIT_ASSERT_MESSAGE("Inserting empty property bag failed", ph->getPropertyBag()->empty()); } void testDumpPropertyPool() diff --git a/writerfilter/source/doctok/WW8DocumentImpl.cxx b/writerfilter/source/doctok/WW8DocumentImpl.cxx index b5e15edb90b6..fd628568c586 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 4b183b903063..f892357f4ee5 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 f9555662041e..c0296c441b43 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 6d58aa4fb5c6..52f1329f9c1b 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/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index 3a964a34aef2..5483632252af 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 3cd935a1cd7a..029fd97be203 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" ); } |