[Libreoffice-commits] .: basctl/source cui/source package/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sun Feb 6 14:17:00 PST 2011


 basctl/source/basicide/basobj3.cxx          |    2 +-
 cui/source/dialogs/hangulhanjadlg.cxx       |    2 +-
 cui/source/dialogs/iconcdlg.cxx             |    5 +++--
 cui/source/options/connpoolsettings.cxx     |    2 +-
 cui/source/options/connpoolsettings.hxx     |    2 +-
 cui/source/options/optinet2.cxx             |   28 ++++++++++++++--------------
 cui/source/tabpages/transfrm.cxx            |    3 +--
 package/source/zipapi/XUnbufferedStream.cxx |    4 +++-
 8 files changed, 25 insertions(+), 23 deletions(-)

New commits:
commit dfda11c7f9b8681b4ad427b25e7a3df9ba1e8a20
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Feb 6 23:16:23 2011 +0100

    Some cppcheck cleaning

diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx
index 857445c..e8fad86 100644
--- a/basctl/source/basicide/basobj3.cxx
+++ b/basctl/source/basicide/basobj3.cxx
@@ -372,10 +372,10 @@ void BasicStopped( BOOL* pbAppWindowDisabled,
         *ppSWLockViewCount = 0;
 
     // AppWait ?
-    USHORT nWait = 0;
     BasicIDEShell* pIDEShell = IDE_DLL()->GetShell();
     if( pIDEShell )
     {
+        USHORT nWait = 0;
         while ( pIDEShell->GetViewFrame()->GetWindow().IsWait() )
         {
             pIDEShell->GetViewFrame()->GetWindow().LeaveWait();
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx
index 67f30ba..d0c95bd 100644
--- a/cui/source/dialogs/hangulhanjadlg.cxx
+++ b/cui/source/dialogs/hangulhanjadlg.cxx
@@ -1758,13 +1758,13 @@ namespace svx
 
             //fill found entries into boxes
             sal_uInt32 nCnt = aEntries.getLength();
-            sal_uInt32 n = 0;
             if( nCnt )
             {
                 if( !m_pSuggestions )
                     m_pSuggestions = new SuggestionList( MAXNUM_SUGGESTIONS );
 
                 const OUString* pSugg = aEntries.getConstArray();
+                sal_uInt32 n = 0;
                 while( nCnt )
                 {
                     m_pSuggestions->Set( pSugg[ n ], sal_uInt16( n ) );
diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index e68acd7..29d7f6d 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -877,6 +877,7 @@ void IconChoiceDialog::ActivatePageImpl ()
     DBG_ASSERT( !maPageList.empty(), "keine Pages angemeldet" );
     IconChoicePageData* pData = GetPageData ( mnCurrentPageId );
     DBG_ASSERT( pData, "Id nicht bekannt" );
+    BOOL bReadOnly = FALSE;
     if ( pData )
     {
         if ( !pData->pPage )
@@ -916,11 +917,11 @@ void IconChoiceDialog::ActivatePageImpl ()
 
         if ( pExampleSet )
             pData->pPage->ActivatePage( *pExampleSet );
+        SetHelpId( pData->pPage->GetHelpId() );
+        bReadOnly = pData->pPage->IsReadOnly();
     }
 
-    SetHelpId( pData->pPage->GetHelpId() );
 
-    BOOL bReadOnly = pData->pPage->IsReadOnly();
     if ( bReadOnly || bHideResetBtn )
         aResetBtn.Hide();
     else
diff --git a/cui/source/options/connpoolsettings.cxx b/cui/source/options/connpoolsettings.cxx
index f375662..4505e81 100644
--- a/cui/source/options/connpoolsettings.cxx
+++ b/cui/source/options/connpoolsettings.cxx
@@ -75,7 +75,7 @@ namespace offapp
     //====================================================================
     TYPEINIT1( DriverPoolingSettingsItem, SfxPoolItem )
     //--------------------------------------------------------------------
-    DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings )
+    DriverPoolingSettingsItem::DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings &_rSettings )
         :SfxPoolItem(_nId)
         ,m_aSettings(_rSettings)
     {
diff --git a/cui/source/options/connpoolsettings.hxx b/cui/source/options/connpoolsettings.hxx
index 8534d2f..17f052a 100644
--- a/cui/source/options/connpoolsettings.hxx
+++ b/cui/source/options/connpoolsettings.hxx
@@ -92,7 +92,7 @@ namespace offapp
     public:
         TYPEINFO();
 
-        DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings _rSettings );
+        DriverPoolingSettingsItem( sal_uInt16 _nId, const DriverPoolingSettings &_rSettings );
 
         virtual int              operator==( const SfxPoolItem& ) const;
         virtual SfxPoolItem*     Clone( SfxItemPool *pPool = 0 ) const;
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 7fee678..e5745e4 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -342,15 +342,15 @@ void SvxProxyTabPage::ReadConfigData_Impl()
         }
     }
 
-    catch(container::NoSuchElementException e) {
+    catch(container::NoSuchElementException &e) {
         OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: NoSuchElementException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException e) {
+    catch(com::sun::star::lang::WrappedTargetException &e) {
         OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException e) {
+    catch(RuntimeException &e) {
         OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: RuntimeException caught" );
     }
 
@@ -400,16 +400,16 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl()
             aNoProxyForED.SetText( aStringValue );
         }
     }
-    catch(beans::UnknownPropertyException e)
+    catch(beans::UnknownPropertyException &e)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException e) {
+    catch(com::sun::star::lang::WrappedTargetException &e) {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException e)
+    catch(RuntimeException &e)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" );
     }
@@ -434,16 +434,16 @@ void SvxProxyTabPage::RestoreConfigDefaults_Impl()
         xChangesBatch->commitChanges();
     }
 
-    catch(beans::UnknownPropertyException e)
+    catch(beans::UnknownPropertyException &e)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException e) {
+    catch(com::sun::star::lang::WrappedTargetException &e) {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException e)
+    catch(RuntimeException &e)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" );
     }
@@ -539,23 +539,23 @@ BOOL SvxProxyTabPage::FillItemSet(SfxItemSet& )
         xChangesBatch->commitChanges();
     }
 
-    catch(com::sun::star::lang::IllegalArgumentException e) {
+    catch(com::sun::star::lang::IllegalArgumentException &e) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: IllegalArgumentException caught" );
     }
 
-    catch(beans::UnknownPropertyException e) {
+    catch(beans::UnknownPropertyException &e) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: UnknownPropertyException caught" );
     }
 
-    catch(beans::PropertyVetoException e) {
+    catch(beans::PropertyVetoException &e) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: PropertyVetoException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException e) {
+    catch(com::sun::star::lang::WrappedTargetException &e) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException e) {
+    catch(RuntimeException &e) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: RuntimeException caught" );
     }
 
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index c54658e..d5e483c 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -558,7 +558,6 @@ void SvxSlantTabPage::Construct()
 BOOL SvxSlantTabPage::FillItemSet(SfxItemSet& rAttrs)
 {
     BOOL  bModified = FALSE;
-    INT32 nValue = 0L;
     String aStr = aMtrRadius.GetText();
 
     if( aStr != aMtrRadius.GetSavedValue() )
@@ -575,7 +574,7 @@ BOOL SvxSlantTabPage::FillItemSet(SfxItemSet& rAttrs)
 
     if( aStr != aMtrAngle.GetSavedValue() )
     {
-        nValue = static_cast<INT32>(aMtrAngle.GetValue());
+        INT32 nValue = static_cast<INT32>(aMtrAngle.GetValue());
         rAttrs.Put( SfxInt32Item( SID_ATTR_TRANSFORM_SHEAR, nValue ) );
         bModified = TRUE;
     }
diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx
index 35e9dfe..1cad883 100644
--- a/package/source/zipapi/XUnbufferedStream.cxx
+++ b/package/source/zipapi/XUnbufferedStream.cxx
@@ -169,10 +169,12 @@ sal_Int32 SAL_CALL XUnbufferedStream::readBytes( Sequence< sal_Int8 >& aData, sa
     if ( mnMyCurrent + nRequestedBytes > mnZipSize + maHeader.getLength() )
         nRequestedBytes = static_cast < sal_Int32 > ( mnZipSize + maHeader.getLength() - mnMyCurrent );
 
-    sal_Int32 nRead = 0, nLastRead = 0, nTotal = 0;
+    sal_Int32 nTotal = 0;
     aData.realloc ( nRequestedBytes );
     if ( nRequestedBytes )
     {
+        sal_Int32 nRead = 0;
+        sal_Int32 nLastRead = 0;
         if ( mbRawStream )
         {
             sal_Int64 nDiff = mnZipEnd - mnZipCurrent;


More information about the Libreoffice-commits mailing list