[Libreoffice-commits] .: basic/source desktop/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sat Jul 30 01:09:04 PDT 2011


 basic/source/runtime/methods.cxx                      |    2 +-
 basic/source/sbx/sbxcurr.cxx                          |    1 -
 basic/source/sbx/sbxdec.cxx                           |    2 +-
 basic/source/sbx/sbxstr.cxx                           |    2 +-
 desktop/source/app/app.cxx                            |    2 +-
 desktop/source/app/dispatchwatcher.cxx                |    2 +-
 desktop/source/deployment/gui/dp_gui_updatedialog.cxx |    4 ++--
 7 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 006eaba76ef679449f312151c85164fe4dc46f24
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Jul 30 10:08:45 2011 +0200

    Some cppcheck cleaning

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 25670dd..57cb915 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3947,7 +3947,7 @@ RTLFUNC(StrConv)
         sal_Char* pChar = new sal_Char[nSize+1];
         for( sal_uInt16 i=0; i < nSize; i++ )
         {
-            pChar[i] = static_cast< sal_Char >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
+            pChar[i] = static_cast< sal_Char >( (i%2) ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
             if( i%2 )
                 pSrc++;
         }
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index 0ea500b..574c804 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -529,7 +529,6 @@ start:
                 SbxBase::SetError( SbxERR_OVERFLOW ); val = 0;
             }
             *p->pULong = (sal_uInt32) val; break;
-            break;
         }
         case SbxBYREF | SbxCURRENCY:
             *p->pnInt64 = r; break;
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index b0f146c..f786277 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -239,7 +239,7 @@ bool SbxDecimal::setString( ::rtl::OUString* pOUString )
             i++;
         }
         hResult = VarDecFromStr( (OLECHAR*)pBuffer, nLANGID, 0, &maDec );
-        delete pBuffer;
+        delete pBuffer[];
     }
     else
     {
diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx
index 4ac819c..6ef6307 100644
--- a/basic/source/sbx/sbxstr.cxx
+++ b/basic/source/sbx/sbxstr.cxx
@@ -278,7 +278,7 @@ SbxArray* StringToByteArray(const ::rtl::OUString& rStr)
     for( sal_uInt16	i=0; i< nArraySize; i++)
     {
         SbxVariable* pNew = new SbxVariable( SbxBYTE );
-        sal_uInt8 aByte = static_cast< sal_uInt8 >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
+        sal_uInt8 aByte = static_cast< sal_uInt8 >( (i%2) ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff );
         pNew->PutByte( aByte );
         pNew->SetFlag( SBX_WRITE );
         pArray->Put( pNew, i );	
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index a3b3ceb..4b94b20 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1690,7 +1690,7 @@ int Desktop::Main()
         std::vector< String > aUnrestrictedFolders;
         svt::getUnrestrictedFolders( aUnrestrictedFolders );
 
-        if ( aUnrestrictedFolders.size() > 0 )
+        if ( !aUnrestrictedFolders.empty() )
         {
             // Set different working directory. The first entry is
             // the new work path.
diff --git a/desktop/source/app/dispatchwatcher.cxx b/desktop/source/app/dispatchwatcher.cxx
index 04816ff..7ed4adf 100644
--- a/desktop/source/app/dispatchwatcher.cxx
+++ b/desktop/source/app/dispatchwatcher.cxx
@@ -576,7 +576,7 @@ sal_Bool DispatchWatcher::executeDispatchRequests( const DispatchList& aDispatch
         }
     }
 
-    if ( aDispatches.size() > 0 )
+    if ( !aDispatches.empty() )
     {
         // Execute all asynchronous dispatches now after we placed them into our request container!
         Sequence < PropertyValue > aArgs( 2 );
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
index a1e3c0f..6d4d1d9 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx
@@ -1105,7 +1105,7 @@ void UpdateDialog::getIgnoredUpdates()
 //------------------------------------------------------------------------------
 void UpdateDialog::storeIgnoredUpdates()
 {
-    if ( m_bModified && ( m_ignoredUpdates.size() != 0 ) )
+    if ( m_bModified && ( !m_ignoredUpdates.empty() ) )
     {
         uno::Reference< lang::XMultiServiceFactory > xConfig( m_context->getServiceManager()->createInstanceWithContext(
             OUSTR("com.sun.star.configuration.ConfigurationProvider"), m_context ), uno::UNO_QUERY_THROW );
@@ -1146,7 +1146,7 @@ bool UpdateDialog::isIgnoredUpdate( UpdateDialog::Index * index )
 {
     bool bIsIgnored = false;
 
-    if ( m_ignoredUpdates.size() != 0 )
+    if (! m_ignoredUpdates.empty() )
     {
         rtl::OUString aExtensionID;
         rtl::OUString aVersion;


More information about the Libreoffice-commits mailing list