diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2012-06-30 18:20:20 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2012-06-30 18:21:26 +0200 |
commit | 6b11a18071254a443c8fe7e7b0b1c95b0f9fd35e (patch) | |
tree | 88cced9ff3bb7a89aa3a76bbd54591994ed01cc7 | |
parent | 611334aa74f97768717376da637bea9baac015aa (diff) |
Some cppcheck cleaning
Change-Id: I14cab3dfd26ac1568feef902b566873cecf049b9
22 files changed, 28 insertions, 28 deletions
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index c2a65ace4cc8..034d4b1a807d 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -283,7 +283,7 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, mxOwnerDocument ); std::vector< rtl::OUString > vEmbeddedImageURLs; GraphicObject::InspectForGraphicObjectImageURL( Reference< XInterface >( xDialogModel, UNO_QUERY ), vEmbeddedImageURLs ); - if ( vEmbeddedImageURLs.size() ) + if ( !vEmbeddedImageURLs.empty() ) { // Export the images to the storage Sequence< Any > aArgs( 1 ); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 0d21ebe4352f..8714040fed9d 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -763,7 +763,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 9fc7695b21dc..25420ad45342 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -110,7 +110,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/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 6eabac46c35c..ca2507638c6d 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -844,7 +844,7 @@ sal_Bool BibGeneralPage::HandleShortCutKey( const KeyEvent& rKeyEvent ) if( pWindow->HasChildPathFocus() ) { // save focused control DBG_ASSERT( nFocused == 0xFFFF, "+BibGeneralPage::HandleShortCutKey(): more than one with focus?!" ); - DBG_ASSERT( aMatchList.size() > 0, "+BibGeneralPage::HandleShortCutKey(): push_back and no content?!" ); + DBG_ASSERT( !aMatchList.empty(), "+BibGeneralPage::HandleShortCutKey(): push_back and no content?!" ); nFocused = aMatchList.size() - 1; } } @@ -854,7 +854,7 @@ sal_Bool BibGeneralPage::HandleShortCutKey( const KeyEvent& rKeyEvent ) if( bHandled ) { - DBG_ASSERT( aMatchList.size() > 0, "*BibGeneralPage::HandleShortCutKey(): be prepared to crash..." ); + DBG_ASSERT( !aMatchList.empty(), "*BibGeneralPage::HandleShortCutKey(): be prepared to crash..." ); if( nFocused >= ( aMatchList.size() - 1 ) ) // >=... includes 0xFFFF diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index f1dc4265f450..8cc1f485a07f 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -255,7 +255,7 @@ bool HWPFile::ReadParaList(std::list < HWPPara* > &aplist, unsigned char flag) } if (spNode->nch && spNode->reuse_shape) { - if (aplist.size()){ + if (!aplist.empty()){ spNode->pshape = aplist.back()->pshape; } else{ @@ -267,7 +267,7 @@ bool HWPFile::ReadParaList(std::list < HWPPara* > &aplist, unsigned char flag) if( spNode->nch ) AddParaShape( &spNode->pshape ); - if (aplist.size()) + if (!aplist.empty()) aplist.back()->SetNext(spNode); aplist.push_back(spNode); spNode = new HWPPara; @@ -441,7 +441,7 @@ void HWPFile::AddBox(FBox * box) { // LATER if we don't use box->next(), // AddBox() and GetBoxHead() are useless; - if (blist.size()) + if (!blist.empty()) { box->prev = blist.back(); box->prev->next = box; diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 2c5b43b69006..3a459ae66c97 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -350,7 +350,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, true, true); ScMyValidationVec::iterator aItr(aValidationVec.begin()); diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 7f17f84fe001..fa95350c6693 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -2030,7 +2030,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL ScChart2DataProvider::detectArgum } } - if( bDifferentIndexes && aSequenceMappingVector.size() ) + if( bDifferentIndexes && !aSequenceMappingVector.empty() ) { aResult.push_back( beans::PropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SequenceMapping")), -1, diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index a10ded4527bf..61435d4b1166 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1163,7 +1163,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(); diff --git a/sdext/source/minimizer/pagecollector.cxx b/sdext/source/minimizer/pagecollector.cxx index 511299b068e6..668ce5f68119 100644 --- a/sdext/source/minimizer/pagecollector.cxx +++ b/sdext/source/minimizer/pagecollector.cxx @@ -94,7 +94,7 @@ void PageCollector::CollectNonCustomShowPages( const com::sun::star::uno::Refere { std::vector< Reference< XDrawPage > > vUsedPageList; PageCollector::CollectCustomShowPages( rxModel, rCustomShowName, vUsedPageList ); - if ( vUsedPageList.size() ) + if ( !vUsedPageList.empty() ) { Reference< XDrawPagesSupplier > xDrawPagesSupplier( rxModel, UNO_QUERY_THROW ); Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW ); diff --git a/sdext/source/pdfimport/tree/pdfiprocessor.cxx b/sdext/source/pdfimport/tree/pdfiprocessor.cxx index 102480306bf9..c14e489deae8 100644 --- a/sdext/source/pdfimport/tree/pdfiprocessor.cxx +++ b/sdext/source/pdfimport/tree/pdfiprocessor.cxx @@ -316,7 +316,7 @@ void PDFIProcessor::processGlyphLine() ParagraphElement* pPara= NULL ; FrameElement* pFrame= NULL ; - if(m_GlyphsList.size()>0) + if(!m_GlyphsList.empty()) { pFrame = m_pElFactory->createFrameElement( m_GlyphsList[0].getCurElement(), getGCId( getTransformGlyphContext( m_GlyphsList[0])) ); pFrame->ZOrder = m_nNextZOrder++; diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 03ee5a1242d7..0da4e0adb383 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -224,7 +224,7 @@ void SwAccessiblePortionData::LineBreak() void SwAccessiblePortionData::Skip(sal_uInt16 nLength) { OSL_ENSURE( !bFinished, "We are already done!" ); - OSL_ENSURE( aModelPositions.size() == 0, "Never Skip() after portions" ); + OSL_ENSURE( aModelPositions.empty(), "Never Skip() after portions" ); OSL_ENSURE( nLength <= pTxtNode->GetTxt().Len(), "skip exceeds model string!" ); nModelPosition += nLength; diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 310e27185a80..779670befb57 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3293,7 +3293,7 @@ void lcl_FillRecognizerData( uno::Sequence< rtl::OUString >& rSmartTagTypes, } } - if ( aSmartTagTypes.size() ) + if ( !aSmartTagTypes.empty() ) { rSmartTagTypes.realloc( aSmartTagTypes.size() ); rStringKeyMaps.realloc( aSmartTagTypes.size() ); diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 91613c65db4f..638676037ef5 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -330,7 +330,7 @@ void SwSelPaintRects::Show() if(mpCursorOverlay) { - if(aNewRanges.size()) + if(!aNewRanges.empty()) { static_cast< sdr::overlay::OverlaySelection* >(mpCursorOverlay)->setRanges(aNewRanges); } diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 5ba43b4071ee..dcb9b1a69446 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1052,7 +1052,7 @@ sal_Bool SwDoc::DelNumRule( const String& rName, sal_Bool bBroadcast ) ++aListIter; } - while ( aListsForDeletion.size() > 0 ) + while ( !aListsForDeletion.empty() ) { SwList* pList = aListsForDeletion.back(); aListsForDeletion.pop_back(); diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx index 0a34e6f77ade..30a7713f7dc4 100644 --- a/sw/source/filter/html/swhtml.hxx +++ b/sw/source/filter/html/swhtml.hxx @@ -298,7 +298,7 @@ public: inline sal_Bool IsULSpaceChanged() const { return bULSpaceChanged; } inline void GetULSpace( sal_uInt16& rUpper, sal_uInt16& rLower ) const; - sal_Bool HasAttrs() const { return aAttrs.size() != 0; } + sal_Bool HasAttrs() const { return !aAttrs.empty(); } const _HTMLAttrs& GetAttrs() const { return aAttrs; } _HTMLAttrs& GetAttrs() { return aAttrs; } diff --git a/sw/source/filter/ww8/rtfstringbuffer.cxx b/sw/source/filter/ww8/rtfstringbuffer.cxx index 554adb1f48cb..13546db0d40a 100644 --- a/sw/source/filter/ww8/rtfstringbuffer.cxx +++ b/sw/source/filter/ww8/rtfstringbuffer.cxx @@ -91,7 +91,7 @@ rtl::OString RtfStringBuffer::makeStringAndClear() rtl::OStringBuffer& RtfStringBuffer::getLastBuffer() { - if (!m_aValues.size() || m_aValues.back().isGraphic()) + if (m_aValues.empty() || m_aValues.back().isGraphic()) m_aValues.push_back(RtfStringBufferValue()); return m_aValues.back().m_aBuffer; } diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 477e2b0e9436..bf1b1931952b 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -600,7 +600,7 @@ const SfxPoolItem* SwWW8AttrIter::HasTextItem( sal_uInt16 nWhich ) const const SfxPoolItem* pRet = 0; const SwpHints* pTxtAttrs = rNd.GetpSwpHints(); - if (pTxtAttrs && m_rExport.m_aCurrentCharPropStarts.size()) + if (pTxtAttrs && !m_rExport.m_aCurrentCharPropStarts.empty()) { xub_StrLen nTmpSwPos = m_rExport.m_aCurrentCharPropStarts.top(); for (sal_uInt16 i = 0; i < pTxtAttrs->Count(); ++i) diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 43cb6829dd50..039181365b32 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -317,13 +317,13 @@ namespace cmis } catch ( const libcmis::Exception& ) { - if ( m_pObjectProps.size() > 0 ) + if ( !m_pObjectProps.empty() ) { map< string, libcmis::PropertyPtr >::iterator it = m_pObjectProps.find( "cmis:name" ); if ( it != m_pObjectProps.end( ) ) { vector< string > values = it->second->getStrings( ); - if ( values.size() > 0 ) + if ( !values.empty() ) sTitle = STD_TO_OUSTR( values.front( ) ); } } @@ -355,7 +355,7 @@ namespace cmis try { vector< string > paths = getObject( )->getPaths( ); - if ( paths.size( ) > 0 ) + if ( !paths.empty( ) ) path = paths.front( ); else path = getObject()->getName( ); @@ -921,7 +921,7 @@ namespace cmis if ( NULL != document ) { vector< boost::shared_ptr< libcmis::Folder > > parents = document->getParents( ); - if ( parents.size( ) > 0 ) + if ( !parents.empty( ) ) parentPath = parents.front( )->getPath( ); } else diff --git a/ucb/source/ucp/cmis/cmis_datasupplier.cxx b/ucb/source/ucp/cmis/cmis_datasupplier.cxx index edddc9e8e3b9..710f82a0824a 100644 --- a/ucb/source/ucp/cmis/cmis_datasupplier.cxx +++ b/ucb/source/ucp/cmis/cmis_datasupplier.cxx @@ -94,7 +94,7 @@ namespace cmis { string sObjectPath; vector< string > paths = maResults[nIndex]->pObject->getPaths( ); - if ( paths.size( ) > 0 ) + if ( !paths.empty( ) ) sObjectPath = paths.front( ); // TODO Handle the unfiled objects with their id... but can they manage to come here? diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 39f2a65686fa..9840fa4d2a0c 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -215,7 +215,7 @@ void FTPURL::parse(const rtl::OUString& url) *p1 = 0; if(buffer[0]) { - if( strcmp(buffer,"..") == 0 && m_aPathSegmentVec.size() && m_aPathSegmentVec.back() != ".." ) + if( strcmp(buffer,"..") == 0 && !m_aPathSegmentVec.empty() && m_aPathSegmentVec.back() != ".." ) m_aPathSegmentVec.pop_back(); else if(strcmp(buffer,".") == 0) ; // Ignore diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 88e2d9b77d04..64a369a40548 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -1715,7 +1715,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( } } // for - if ( !bTransient && aProppatchValues.size() ) + if ( !bTransient && !aProppatchValues.empty() ) { try { diff --git a/ucbhelper/source/client/proxydecider.cxx b/ucbhelper/source/client/proxydecider.cxx index 41217ee54b3c..b67e10929acc 100644 --- a/ucbhelper/source/client/proxydecider.cxx +++ b/ucbhelper/source/client/proxydecider.cxx @@ -483,7 +483,7 @@ const InternetProxyServer & InternetProxyDecider_Impl::getProxy( return m_aEmptyProxy; } - if ( !rHost.isEmpty() && m_aNoProxyList.size() ) + if ( !rHost.isEmpty() && !m_aNoProxyList.empty() ) { ////////////////////////////////////////////////////////////////// // First, try direct hostname match - #110515# |