diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2011-07-31 00:52:12 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2011-07-31 00:52:12 +0200 |
commit | 4f4139a28679794b8372ea723a78c8834c56843e (patch) | |
tree | 276c553b0cd4166f31f4ef42d444b83054ae093d /svx | |
parent | 1f7b66104dcb8ccad3efd2bd116c42e090ee9981 (diff) |
Some cppcheck cleaning + 2 fixes of last commit
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoedge.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdotextdecomposition.cxx | 6 | ||||
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoprov.cxx | 7 |
8 files changed, 19 insertions, 22 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 89c0e1ab3211..3984e1dea170 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -500,7 +500,7 @@ void SdrDragMethod::createSdrDragEntries_PointDrag() } } - if(aPositions.size()) + if(!aPositions.empty()) { addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, true)); } @@ -544,7 +544,7 @@ void SdrDragMethod::createSdrDragEntries_GlueDrag() } } - if(aPositions.size()) + if(!aPositions.empty()) { addSdrDragEntry(new SdrDragEntryPointGlueDrag(aPositions, false)); } diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index abf0661ac235..8874f112223f 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -794,7 +794,7 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); @@ -803,7 +803,7 @@ void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark) if( !bUndo ) { // now delete removed scene objects - while(aRemoved3DObjects.size()) + while(!aRemoved3DObjects.empty()) { SdrObject::Free( aRemoved3DObjects.back() ); aRemoved3DObjects.pop_back(); @@ -849,7 +849,7 @@ void SdrEditView::DeleteMarkedObj() if(pParent) { - if(aParents.size()) + if(!aParents.empty()) { std::vector< SdrObject* >::iterator aFindResult = std::find(aParents.begin(), aParents.end(), pParent); @@ -866,7 +866,7 @@ void SdrEditView::DeleteMarkedObj() } } - if(aParents.size()) + if(!aParents.empty()) { // in a 2nd run, remove all objects which may already be scheduled for // removal. I am not sure if this can happen, but theoretically diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 8081ab2a48db..24fc44befbc0 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -319,7 +319,7 @@ void SdrEditView::RotateMarkedObj(const Point& rRef, long nWink, bool bCopy) } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); @@ -379,7 +379,7 @@ void SdrEditView::MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool b } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); @@ -1052,7 +1052,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll) { SdrTextObj* pTextObj = ((SdrTextObj*)pObj); - if(0 != aCharWhichIds.size()) + if(!aCharWhichIds.empty()) { Rectangle aOldBoundRect = pTextObj->GetLastBoundRect(); @@ -1080,7 +1080,7 @@ void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, sal_Bool bReplaceAll) } // fire scene updaters - while(aUpdaters.size()) + while(!aUpdaters.empty()) { delete aUpdaters.back(); aUpdaters.pop_back(); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 3cea9733a202..4aea97282d70 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -408,7 +408,7 @@ SdrObject::~SdrObject() { // tell all the registered ObjectUsers that the page is in destruction ::sdr::ObjectUserVector aListCopy(maObjectUsers.begin(), maObjectUsers.end()); - for(::sdr::ObjectUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); aIterator++) + for(::sdr::ObjectUserVector::iterator aIterator = aListCopy.begin(); aIterator != aListCopy.end(); ++aIterator) { sdr::ObjectUser* pObjectUser = *aIterator; DBG_ASSERT(pObjectUser, "SdrObject::~SdrObject: corrupt ObjectUser list (!)"); diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 98a318c1b04d..fd63fc633599 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1234,8 +1234,6 @@ XPolygon SdrEdgeObj::ImpCalcEdgeTrack(const Point& rPt1, long nAngle1, const Rec else if (nPntAnz==4) { // Z oder U if (nAngle1==nAngle2) cForm='U'; else cForm='Z'; - } else if (nPntAnz==4) { /* �-� �-� */ - /* ... -� -� */ } else if (nPntAnz==6) { // S oder C oder ... if (nAngle1!=nAngle2) { // Fuer Typ S hat Linie2 dieselbe Richtung wie Linie4. diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx index 7a47c14d254e..dcd6ce9772c4 100644 --- a/svx/source/svdraw/svdotextdecomposition.cxx +++ b/svx/source/svdraw/svdotextdecomposition.cxx @@ -494,7 +494,7 @@ namespace { // only create a line primitive when we had content; there is no need for // empty line primitives (contrary to paragraphs, see below). - if(maTextPortionPrimitives.size()) + if(!maTextPortionPrimitives.empty()) { drawinglayer::primitive2d::Primitive2DSequence aLineSequence(impConvertVectorToPrimitive2DSequence(maTextPortionPrimitives)); maTextPortionPrimitives.clear(); @@ -661,13 +661,13 @@ namespace drawinglayer::primitive2d::Primitive2DSequence impTextBreakupHandler::getPrimitive2DSequence() { - if(maTextPortionPrimitives.size()) + if(!maTextPortionPrimitives.empty()) { // collect non-closed lines impFlushTextPortionPrimitivesToLinePrimitives(); } - if(maLinePrimitives.size()) + if(!maLinePrimitives.empty()) { // collect non-closed paragraphs impFlushLinePrimitivesToParagraphPrimitives(); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index cb8ba42fc04f..956773a4c6a3 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -819,7 +819,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aShapes.push_back( pObj ); } - if( 0 == aShapes.size() ) + if( aShapes.empty() ) bRet = false; } @@ -949,7 +949,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, } } - if(aShapes.size()) + if(!aShapes.empty()) { // more effective way to paint a vector of SdrObjects. Hand over the processed page // to have it in the diff --git a/svx/source/unodraw/unoprov.cxx b/svx/source/unodraw/unoprov.cxx index b07eaa84206d..d9fea7e28f9b 100644 --- a/svx/source/unodraw/unoprov.cxx +++ b/svx/source/unodraw/unoprov.cxx @@ -893,7 +893,7 @@ rtl::OUString UHashMap::getNameFromId(sal_uInt32 nId) { const UHashMapImpl &rMap = GetUHashImpl(); - for (UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); it++) + for (UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); ++it) { if (it->second == nId) return it->first; @@ -906,12 +906,11 @@ uno::Sequence< OUString > UHashMap::getServiceNames() { const UHashMapImpl &rMap = GetUHashImpl(); - int i = 0; uno::Sequence< OUString > aSeq( rMap.size() ); OUString* pStrings = aSeq.getArray(); - for (UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); it++) - pStrings[i++] = it->first; + for (int i = 0, UHashMapImpl::const_iterator it = rMap.begin(); it != rMap.end(); ++it, ++i) + pStrings[i] = it->first; return aSeq; } |