From 93774fa4d53d0af09c4beba53bf0d6fafca59ce8 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 31 Jul 2011 01:17:59 +0200 Subject: [PATCH] Some cppcheck cleaning --- svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 +- .../customshapes/EnhancedCustomShapeFontWork.cxx | 4 ++-- svx/source/dialog/dlgctl3d.cxx | 2 +- svx/source/form/filtnav.cxx | 10 +++++----- svx/source/form/fmvwimp.cxx | 2 +- svx/source/form/formcontroller.cxx | 4 ++-- svx/source/gengal/gengal.cxx | 2 +- svx/source/sdr/animation/scheduler.cxx | 2 +- svx/source/sdr/contact/viewcontactofsdrobj.cxx | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index c660efd855f6..ea757e9ec0fc 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2103,7 +2103,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( sal_Bool bLineGeometryNeededOnl } // #i37011# - if(vObjectList.size()) + if(!vObjectList.empty()) { // copy remaining objects to pRet if(vObjectList.size() > 1L) diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 82b16df44df2..10f803af8a45 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -662,7 +662,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW std::vector< double > vDistances; vDistances.reserve( nPointCount ); CalcDistances( rOutlinePoly, vDistances ); - if ( vDistances.size() ) + if ( !vDistances.empty() ) { std::vector< FWParagraphData >::iterator aParagraphIter( aTextAreaIter->vParagraphs.begin() ); std::vector< FWParagraphData >::iterator aParagraphIEnd( aTextAreaIter->vParagraphs.end() ); @@ -793,7 +793,7 @@ void FitTextOutlinesToShapeOutlines( const PolyPolygon& aOutlines2d, FWData& rFW SdrObject* CreateSdrObjectFromParagraphOutlines( const FWData& rFWData, const SdrObject* pCustomShape ) { SdrObject* pRet = NULL; - if ( rFWData.vTextAreas.size() ) + if ( !rFWData.vTextAreas.empty() ) { pRet = new SdrObjGroup(); std::vector< FWTextArea >::const_iterator aTextAreaIter = rFWData.vTextAreas.begin(); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 143b67091f10..09df1e8235b4 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -511,7 +511,7 @@ void Svx3DLightControl::TrySelection(Point aPosPixel) std::vector< const E3dCompoundObject* > aResult; getAllHit3DObjectsSortedFrontToBack(aPoint, *mpScene, aResult); - if(aResult.size()) + if(!aResult.empty()) { // exclude expansion object which will be part of // the hits. It's invisible, but for HitTest, it's included diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 1a9a2de3c636..d838fe6633e0 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -161,7 +161,7 @@ TYPEINIT1(FmParentData, FmFilterData); FmParentData::~FmParentData() { for (::std::vector::const_iterator i = m_aChildren.begin(); - i != m_aChildren.end(); i++) + i != m_aChildren.end(); ++i) delete (*i); } @@ -588,7 +588,7 @@ void FmFilterModel::Clear() m_xControllers = NULL; for (::std::vector::const_iterator i = m_aChildren.begin(); - i != m_aChildren.end(); i++) + i != m_aChildren.end(); ++i) delete (*i); m_aChildren.clear(); @@ -700,7 +700,7 @@ void FmFilterModel::Update(const Reference< XIndexAccess > & xControllers, FmPar FmFormItem* FmFilterModel::Find(const ::std::vector& rItems, const Reference< XFormController > & xController) const { for (::std::vector::const_iterator i = rItems.begin(); - i != rItems.end(); i++) + i != rItems.end(); ++i) { FmFormItem* pForm = PTR_CAST(FmFormItem,*i); if (pForm) @@ -722,7 +722,7 @@ FmFormItem* FmFilterModel::Find(const ::std::vector& rItems, cons FmFormItem* FmFilterModel::Find(const ::std::vector& rItems, const Reference< XForm >& xForm) const { for (::std::vector::const_iterator i = rItems.begin(); - i != rItems.end(); i++) + i != rItems.end(); ++i) { FmFormItem* pForm = PTR_CAST(FmFormItem,*i); if (pForm) @@ -1903,7 +1903,7 @@ void FmFilterNavigator::DeleteSelection() for (::std::vector::reverse_iterator i = aEntryList.rbegin(); // link problems with operator == - i.base() != aEntryList.rend().base(); i++) + i.base() != aEntryList.rend().base(); ++i) { m_pModel->Remove((FmFilterData*)(*i)->GetUserData()); } diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx index 8bbacd5b0a8e..3dccb36694c2 100644 --- a/svx/source/form/fmvwimp.cxx +++ b/svx/source/form/fmvwimp.cxx @@ -329,7 +329,7 @@ Reference< XFormController > FormViewPageWindowAdapter::getController( const Re { Reference< XTabControllerModel > xModel(xForm, UNO_QUERY); for (::std::vector< Reference< XFormController > >::const_iterator i = m_aControllerList.begin(); - i != m_aControllerList.end(); i++) + i != m_aControllerList.end(); ++i) { if ((XTabControllerModel*)(*i)->getModel().get() == (XTabControllerModel*)xModel.get()) return *i; diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx index 638072f1cd2b..83c653664222 100644 --- a/svx/source/form/formcontroller.cxx +++ b/svx/source/form/formcontroller.cxx @@ -3153,7 +3153,7 @@ void FormController::setFilter(::std::vector& rFieldInfos) Reference< XColumnsSupplier >( m_xComposer, UNO_QUERY_THROW )->getColumns(); for (::std::vector::iterator iter = rFieldInfos.begin(); - iter != rFieldInfos.end(); iter++) + iter != rFieldInfos.end(); ++iter) { if ( xQueryColumns->hasByName((*iter).aFieldName) ) { @@ -3229,7 +3229,7 @@ void FormController::setFilter(::std::vector& rFieldInfos) // find the text component for (::std::vector::iterator iter = rFieldInfos.begin(); - iter != rFieldInfos.end(); iter++) + iter != rFieldInfos.end(); ++iter) { // we found the field so insert a new entry to the filter row if ((*iter).xField == xField) diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx index 5c3b3efe4e14..d8daa1c2884a 100644 --- a/svx/source/gengal/gengal.cxx +++ b/svx/source/gengal/gengal.cxx @@ -144,7 +144,7 @@ static void createTheme( rtl::OUString aThemeName, FileNameList::const_iterator aIter; - for( aIter = rFiles.begin(); aIter != rFiles.end(); aIter++ ) + for( aIter = rFiles.begin(); aIter != rFiles.end(); ++aIter ) { // Should/could use: // if ( ! pGalTheme->InsertFileOrDirURL( aURL ) ) { diff --git a/svx/source/sdr/animation/scheduler.cxx b/svx/source/sdr/animation/scheduler.cxx index d203de342e3f..99a5cc52208d 100644 --- a/svx/source/sdr/animation/scheduler.cxx +++ b/svx/source/sdr/animation/scheduler.cxx @@ -214,7 +214,7 @@ namespace sdr // execute events from the vector for(::std::vector< Event* >::iterator aCandidate = EventPointerVector.begin(); - aCandidate != EventPointerVector.end(); aCandidate++) + aCandidate != EventPointerVector.end(); ++aCandidate) { // trigger event. This may re-insert the event to the scheduler again (*aCandidate)->Trigger(mnTime); diff --git a/svx/source/sdr/contact/viewcontactofsdrobj.cxx b/svx/source/sdr/contact/viewcontactofsdrobj.cxx index e26c048b69ae..1d83ee3ef81a 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobj.cxx @@ -174,7 +174,7 @@ namespace sdr aGluepointVector.push_back(basegfx::B2DPoint(aPosition.X(), aPosition.Y())); } - if(aGluepointVector.size()) + if(!aGluepointVector.empty()) { const basegfx::BColor aBackPen(1.0, 1.0, 1.0); const basegfx::BColor aRGBFrontColor(0.0, 0.0, 1.0); // COL_LIGHTBLUE