[Libreoffice-commits] .: oox/source ucb/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Dec 15 00:34:18 PST 2012


 oox/source/vml/vmlshapecontainer.cxx           |    7 +++++--
 ucb/source/ucp/webdav/webdavresponseparser.cxx |   10 +++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit b82b9a93caaf27855d6059885de29d1989a1907d
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Dec 15 09:31:09 2012 +0100

    Some cppcheck cleaning
    
    Change-Id: I73b5eb0f12f0e9fcc4b691fadca17cd97e5fd079

diff --git a/oox/source/vml/vmlshapecontainer.cxx b/oox/source/vml/vmlshapecontainer.cxx
index 31ad4cc..6b999bd 100644
--- a/oox/source/vml/vmlshapecontainer.cxx
+++ b/oox/source/vml/vmlshapecontainer.cxx
@@ -46,8 +46,11 @@ void lclMapShapesById( RefMap< OUString, ShapeType >& orMap, const RefVector< Sh
         OSL_ENSURE( !rShapeId.isEmpty(), "lclMapShapesById - missing shape identifier" );
         if( !rShapeId.isEmpty() )
         {
-            OSL_ENSURE( orMap.find( rShapeId ) == orMap.end(), "lclMapShapesById - shape identifier already used" );
-            orMap[ rShapeId ] = *aIt;
+            OSL_ENSURE( orMap.find( rShapeId ) == orMap.end(), "lclMapShapesById - shape identifier already used JUL" );
+            if (orMap.find( rShapeId ) == orMap.end())
+            {
+               orMap[ rShapeId ] = *aIt;
+            }
         }
     }
 }
diff --git a/ucb/source/ucp/webdav/webdavresponseparser.cxx b/ucb/source/ucp/webdav/webdavresponseparser.cxx
index ffa4881..88b51da 100644
--- a/ucb/source/ucp/webdav/webdavresponseparser.cxx
+++ b/ucb/source/ucp/webdav/webdavresponseparser.cxx
@@ -237,7 +237,7 @@ namespace
         {
             const sal_Int32 nIndex(rSource.indexOf(sal_Unicode(':'), 0));
 
-            if(-1 != nIndex && nIndex > 0 && nIndex + 1 < nLen)
+            if(nIndex > 0 && ((nIndex + 1) < nLen))
             {
                 maNamespace = mapNamespaceToken(rSource.copy(0, nIndex));
                 maName = rSource.copy(nIndex + 1);
@@ -695,7 +695,7 @@ namespace
                                     {
                                         if(isCollectingProperties())
                                         {
-                                            if(maPropStatProperties.size())
+                                            if(!maPropStatProperties.empty())
                                             {
                                                 // append to maResponseProperties if okay
                                                 maResponseProperties.insert(maResponseProperties.end(), maPropStatProperties.begin(), maPropStatProperties.end());
@@ -703,7 +703,7 @@ namespace
                                         }
                                         else
                                         {
-                                            if(maPropStatNames.size())
+                                            if(!maPropStatNames.empty())
                                             {
                                                 // when collecting properties append to
                                                 maResponseNames.insert(maResponseNames.end(), maPropStatNames.begin(), maPropStatNames.end());
@@ -721,7 +721,7 @@ namespace
                                     if(isCollectingProperties())
                                     {
                                         // create DAVResource when we have content
-                                        if(maResponseProperties.size())
+                                        if(!maResponseProperties.empty())
                                         {
                                             http_dav_ucp::DAVResource aDAVResource;
 
@@ -733,7 +733,7 @@ namespace
                                     else
                                     {
                                         // when collecting properties add them to result when there are some
-                                        if(maResponseNames.size())
+                                        if(!maResponseNames.empty())
                                         {
                                             http_dav_ucp::DAVResourceInfo aDAVResourceInfo(maHref);
 


More information about the Libreoffice-commits mailing list