[Libreoffice-commits] .: 2 commits - svx/source xmloff/inc xmloff/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sat Jul 30 15:53:55 PDT 2011


 svx/source/svdraw/svddrgmt.cxx              |    4 ++--
 svx/source/svdraw/svdedtv.cxx               |    8 ++++----
 svx/source/svdraw/svdedtv1.cxx              |    8 ++++----
 svx/source/svdraw/svdobj.cxx                |    2 +-
 svx/source/svdraw/svdoedge.cxx              |    2 --
 svx/source/svdraw/svdotextdecomposition.cxx |    6 +++---
 svx/source/unodraw/UnoGraphicExporter.cxx   |    4 ++--
 svx/source/unodraw/unoprov.cxx              |    7 +++----
 xmloff/inc/xmloff/txtimp.hxx                |    4 ++--
 xmloff/source/text/XMLTextNumRuleInfo.hxx   |    1 -
 10 files changed, 21 insertions(+), 25 deletions(-)

New commits:
commit 5d57376bbdd25d09ce5f8081a8d8dc726e25a175
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jul 31 00:53:27 2011 +0200

    Revert a specific line.

diff --git a/xmloff/source/text/XMLTextNumRuleInfo.hxx b/xmloff/source/text/XMLTextNumRuleInfo.hxx
index d81cf32..2c487c2 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.hxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.hxx
@@ -159,7 +159,6 @@ inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
     msListId = rInfo.msListId;
     mnListStartValue = rInfo.mnListStartValue;
     mnListLevel = rInfo.mnListLevel;
-    mnListLevelStartValue = rInfo.mnListLevelStartValue;
     mbIsNumbered = rInfo.mbIsNumbered;
     mbIsRestart = rInfo.mbIsRestart;
     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
commit e028b577173b402c250724a732db590a78109a69
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jul 31 00:52:12 2011 +0200

    Some cppcheck cleaning + 2 fixes of last commit

diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 60c8d4e..f60d7ae 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 93e3075..b1d86be 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 ca170ae..2d00eb6 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 5c40cfd..95e4319 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 5a71a00..0835f6e 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 bf0b03a..66e7231 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 e753cdd..b58d86e 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 73f02e8..dea8b3b 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 1460275..b1efbbb 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,


More information about the Libreoffice-commits mailing list