diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2011-02-06 23:16:23 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2011-02-06 23:16:23 +0100 |
commit | dfda11c7f9b8681b4ad427b25e7a3df9ba1e8a20 (patch) | |
tree | 6127aeb5de731dc6b78e4ac44a55534655d59fda | |
parent | 22ebf4ead44c2896a3fcc13b798176d9207af678 (diff) |
Some cppcheck cleaning
-rw-r--r-- | basctl/source/basicide/basobj3.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/hangulhanjadlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/iconcdlg.cxx | 5 | ||||
-rw-r--r-- | cui/source/options/connpoolsettings.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/connpoolsettings.hxx | 2 | ||||
-rw-r--r-- | cui/source/options/optinet2.cxx | 28 | ||||
-rw-r--r-- | cui/source/tabpages/transfrm.cxx | 3 | ||||
-rw-r--r-- | package/source/zipapi/XUnbufferedStream.cxx | 4 |
8 files changed, 25 insertions, 23 deletions
diff --git a/basctl/source/basicide/basobj3.cxx b/basctl/source/basicide/basobj3.cxx index 857445cd6..e8fad867e 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 67f30ba70..d0c95bd64 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 e68acd7be..29d7f6d6e 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 f3756627e..4505e8191 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 8534d2f8b..17f052afa 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 7fee6788b..e5745e46c 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 c54658e49..d5e483ccd 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 35e9dfe6b..1cad883f9 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; |