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 | e028b577173b402c250724a732db590a78109a69 (patch) | |
tree | 67a400bf729708c60e0071888a2bb09317e4ec6a | |
parent | 61a718a36525dcc570be0fec8611c9106ed73208 (diff) |
Some cppcheck cleaning + 2 fixes of last commit
-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 | ||||
-rw-r--r-- | xmloff/inc/xmloff/txtimp.hxx | 4 |
9 files changed, 21 insertions, 24 deletions
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 60c8d4eda0..f60d7aeb08 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 93e3075dc9..b1d86beb4c 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 ca170aecfd..2d00eb636c 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 5c40cfd5b2..95e4319ed9 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 5a71a00ef4..0835f6ec58 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 bf0b03a062..66e7231d62 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 e753cdd647..b58d86ea82 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 73f02e8b4e..dea8b3be7a 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; } diff --git a/xmloff/inc/xmloff/txtimp.hxx b/xmloff/inc/xmloff/txtimp.hxx index 14602758e6..b1efbbbc47 100644 --- a/xmloff/inc/xmloff/txtimp.hxx +++ b/xmloff/inc/xmloff/txtimp.hxx @@ -582,7 +582,7 @@ public: /// save the start of a range reference void InsertBookmarkStartRange( - const ::rtl::OUString sName, + const ::rtl::OUString & sName, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange> & rRange, ::rtl::OUString const& i_rXmlId, @@ -591,7 +591,7 @@ public: /// process the start of a range reference sal_Bool FindAndRemoveBookmarkStartRange( - const ::rtl::OUString sName, + const ::rtl::OUString & sName, ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange> & o_rRange, ::rtl::OUString & o_rXmlId, |