diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-19 22:48:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-20 11:01:54 +0100 |
commit | 347738eade7b1077067926930b8efef257d4776d (patch) | |
tree | 32643ba155a4029de7e9eecfdc9c49ef36a5d9dc /framework | |
parent | c4ed8d454818971d959af7a80a986b7691bf43fb (diff) |
catch by const reference
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/fwe/classes/framelistanalyzer.cxx | 12 | ||||
-rw-r--r-- | framework/source/fwe/helper/actiontriggerhelper.cxx | 16 | ||||
-rw-r--r-- | framework/source/layoutmanager/layoutmanager.cxx | 87 | ||||
-rw-r--r-- | framework/source/layoutmanager/toolbarlayoutmanager.cxx | 118 | ||||
-rw-r--r-- | framework/source/lomenubar/FrameHelper.cxx | 2 | ||||
-rw-r--r-- | framework/source/services/backingwindow.cxx | 12 |
6 files changed, 176 insertions, 71 deletions
diff --git a/framework/source/fwe/classes/framelistanalyzer.cxx b/framework/source/fwe/classes/framelistanalyzer.cxx index fadd3cae0545..25c7f921bbd9 100644 --- a/framework/source/fwe/classes/framelistanalyzer.cxx +++ b/framework/source/fwe/classes/framelistanalyzer.cxx @@ -163,8 +163,9 @@ void FrameListAnalyzer::impl_analyze() ::rtl::OUString sModule = xModuleMgr->identify(m_xReferenceFrame); m_bReferenceIsBacking = (sModule.equals(SERVICENAME_STARTMODULE)); } - catch(const css::uno::Exception&) - {} + catch (const css::uno::Exception&) + { + } } // check, if the reference frame includes the help module. @@ -237,8 +238,9 @@ void FrameListAnalyzer::impl_analyze() continue; } } - catch(const css::uno::Exception&) - {} + catch (const css::uno::Exception&) + { + } } // ------------------------------------------------- @@ -285,7 +287,7 @@ void FrameListAnalyzer::impl_analyze() } } } - catch(css::lang::IndexOutOfBoundsException) + catch (const css::lang::IndexOutOfBoundsException&) { // stop copying if index seams to be wrong. // This interface can't realy guarantee its count for multithreaded diff --git a/framework/source/fwe/helper/actiontriggerhelper.cxx b/framework/source/fwe/helper/actiontriggerhelper.cxx index 44518a3458b9..9ce2884da366 100644 --- a/framework/source/fwe/helper/actiontriggerhelper.cxx +++ b/framework/source/fwe/helper/actiontriggerhelper.cxx @@ -67,7 +67,7 @@ sal_Bool IsSeparator( Reference< XPropertySet > xPropertySet ) { return xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( SERVICENAME_ACTIONTRIGGERSEPARATOR )) ); } - catch ( Exception& ) + catch (const Exception&) { } @@ -95,7 +95,7 @@ void GetMenuItemAttributes( Reference< XPropertySet > xActionTriggerPropertySet, a = xActionTriggerPropertySet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "SubContainer" )) ); a >>= xSubContainer; } - catch ( Exception& ) + catch (const Exception&) { } @@ -105,7 +105,7 @@ void GetMenuItemAttributes( Reference< XPropertySet > xActionTriggerPropertySet, a = xActionTriggerPropertySet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" )) ); a >>= aHelpURL; } - catch ( Exception& ) + catch (const Exception&) { } } @@ -234,15 +234,15 @@ void InsertSubMenuItems( Menu* pSubMenu, sal_uInt16& nItemId, Reference< XIndexC } } } - catch ( IndexOutOfBoundsException ) + catch (const IndexOutOfBoundsException&) { return; } - catch ( WrappedTargetException ) + catch (const WrappedTargetException&) { return; } - catch ( RuntimeException ) + catch (const RuntimeException&) { return; } @@ -295,7 +295,7 @@ Reference< XPropertySet > CreateActionTrigger( sal_uInt16 nItemId, const Menu* p xPropSet->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Image" )), a ); } } - catch ( Exception& ) + catch (const Exception&) { } } @@ -369,7 +369,7 @@ void FillActionTriggerContainerWithMenu( const Menu* pMenu, Reference< XIndexCon } } } - catch ( Exception& ) + catch (const Exception&) { } } diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index a7bc56cbd954..c92ec7ea8cf7 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -221,8 +221,12 @@ void LayoutManager::impl_clearUpMenuBar() { xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" ))) >>= xMenuBar; } - catch ( beans::UnknownPropertyException ) {} - catch ( lang::WrappedTargetException ) {} + catch (const beans::UnknownPropertyException&) + { + } + catch (const lang::WrappedTargetException&) + { + } } VCLXMenu* pAwtMenuBar = VCLXMenu::GetImplementation( xMenuBar ); @@ -310,7 +314,9 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) // Remove listener to old module ui configuration manager xModuleCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } } try @@ -320,7 +326,9 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) if ( xModuleCfgMgr.is() ) xModuleCfgMgr->addConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } try { @@ -328,8 +336,12 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) if ( xPersistentWindowStateSupplier.is() ) xPersistentWindowStateSupplier->getByName( aModuleIdentifier ) >>= xPersistentWindowState; } - catch ( NoSuchElementException& ) {} - catch ( WrappedTargetException& ) {} + catch (const NoSuchElementException&) + { + } + catch (const WrappedTargetException&) + { + } } xModel = impl_getModelFromFrame( xFrame ); @@ -345,7 +357,9 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) // Remove listener to old ui configuration manager xDocCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } } try @@ -354,7 +368,9 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) if ( xDocCfgMgr.is() ) xDocCfgMgr->addConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } } } } @@ -368,7 +384,9 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) xModuleCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } } if ( xDocCfgMgr.is() ) @@ -378,7 +396,9 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) xDocCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } } // Release references to our configuration managers as we currently don't have @@ -636,7 +656,9 @@ sal_Bool LayoutManager::implts_readWindowStateData( const rtl::OUString& aName, return sal_True; } - catch ( NoSuchElementException& ) {} + catch (const NoSuchElementException&) + { + } } return sal_False; @@ -660,12 +682,14 @@ void LayoutManager::implts_writeWindowStateData( const rtl::OUString& aName, con // Check persistent flag of the user interface element xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" ))) >>= bPersistent; } - catch ( beans::UnknownPropertyException ) + catch (const beans::UnknownPropertyException&) { // Non-configurable elements should at least store their dimension/position bPersistent = sal_True; } - catch ( lang::WrappedTargetException ) {} + catch (const lang::WrappedTargetException&) + { + } } if ( bPersistent && xPersistentWindowState.is() ) @@ -714,7 +738,9 @@ void LayoutManager::implts_writeWindowStateData( const rtl::OUString& aName, con xInsert->insertByName( aName, makeAny( aWindowState )); } } - catch ( Exception& ) {} + catch (const Exception&) + { + } } // Reset flag @@ -752,8 +778,12 @@ Reference< XUIElement > LayoutManager::implts_createElement( const rtl::OUString { xUIElement = m_xUIElementFactoryManager->createUIElement( aName, aPropSeq ); } - catch ( NoSuchElementException& ) {} - catch ( IllegalArgumentException& ) {} + catch (const NoSuchElementException&) + { + } + catch (const IllegalArgumentException&) + { + } return xUIElement; } @@ -1412,8 +1442,13 @@ void LayoutManager::implts_reparentChildWindows() { xStatusBarWindow = Reference< awt::XWindow >( aStatusBarElement.m_xUIElement->getRealInterface(), UNO_QUERY ); } - catch ( RuntimeException& ) { throw; } - catch ( Exception& ) {} + catch (const RuntimeException&) + { + throw; + } + catch (const Exception&) + { + } } if ( xStatusBarWindow.is() ) @@ -1519,8 +1554,12 @@ throw (RuntimeException) { xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "XMenuBar" ))) >>= xMenuBar; } - catch ( beans::UnknownPropertyException ) {} - catch ( lang::WrappedTargetException ) {} + catch (const beans::UnknownPropertyException&) + { + } + catch (const lang::WrappedTargetException&) + { + } } if ( xMenuBar.is() ) @@ -2917,7 +2956,9 @@ throw( RuntimeException ) xModuleCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } } if ( m_xDocCfgMgr.is() ) @@ -2928,7 +2969,9 @@ throw( RuntimeException ) xDocCfgMgr->removeConfigurationListener( Reference< XUIConfigurationListener >( static_cast< OWeakObject* >( this ), UNO_QUERY )); } - catch ( Exception& ) {} + catch (const Exception&) + { + } } m_xDocCfgMgr.clear(); diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index dafaa415ed37..1ea2c84996c5 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -506,7 +506,9 @@ bool ToolbarLayoutManager::destroyToolbar( const ::rtl::OUString& rResourceURL ) xWindow->removeWindowListener( uno::Reference< awt::XWindowListener >( static_cast< OWeakObject * >( this ), uno::UNO_QUERY )); } - catch( uno::Exception& ) {} + catch (const uno::Exception&) + { + } try { @@ -514,7 +516,9 @@ bool ToolbarLayoutManager::destroyToolbar( const ::rtl::OUString& rResourceURL ) xDockWindow->removeDockableWindowListener( uno::Reference< awt::XDockableWindowListener >( static_cast< OWeakObject * >( this ), uno::UNO_QUERY )); } - catch ( uno::Exception& ) {} + catch (const uno::Exception&) + { + } } else { @@ -768,7 +772,9 @@ bool ToolbarLayoutManager::dockToolbar( const ::rtl::OUString& rResourceURL, ui: return true; } } - catch ( lang::DisposedException& ) {} + catch (const lang::DisposedException&) + { + } } return false; @@ -844,9 +850,17 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent ) const sal_uInt32 nCount = aListenerArray.size(); for ( sal_uInt32 i = 0; i < nCount; ++i ) { - try { aListenerArray[i]->functionExecute( aToolbarName, aCommand ); } - catch ( uno::RuntimeException& ) { throw; } - catch ( uno::Exception& ) {} + try + { + aListenerArray[i]->functionExecute( aToolbarName, aCommand ); + } + catch (const uno::RuntimeException&) + { + throw; + } + catch (const uno::Exception&) + { + } } } } @@ -1012,7 +1026,9 @@ void ToolbarLayoutManager::implts_createAddonsToolBars() if ( xWindow.is() ) xWindow->addWindowListener( uno::Reference< awt::XWindowListener >( static_cast< OWeakObject * >( this ), uno::UNO_QUERY )); } - catch ( uno::Exception& ) {} + catch (const uno::Exception&) + { + } } ::rtl::OUString aGenericAddonTitle = implts_generateGenericAddonToolbarTitle( i+1 ); @@ -1060,8 +1076,12 @@ void ToolbarLayoutManager::implts_createAddonsToolBars() } } } - catch ( container::NoSuchElementException& ) {} - catch ( lang::IllegalArgumentException& ) {} + catch (const container::NoSuchElementException&) + { + } + catch (const lang::IllegalArgumentException&) + { + } } } @@ -1158,8 +1178,13 @@ void ToolbarLayoutManager::implts_createNonContextSensitiveToolBars() /* SAFE AREA ----------------------------------------------------------------------------------------------- */ } } - catch ( uno::RuntimeException& ) { throw; } - catch ( uno::Exception& ) {} + catch (const uno::RuntimeException&) + { + throw; + } + catch (const uno::Exception&) + { + } if ( !aMakeVisibleToolbars.empty() ) ::std::for_each( aMakeVisibleToolbars.begin(), aMakeVisibleToolbars.end(),::boost::bind( &ToolbarLayoutManager::requestToolbar, this,_1 )); @@ -1233,8 +1258,13 @@ void ToolbarLayoutManager::implts_reparentToolbars() // possible that all elements have been disposed! xWindow = uno::Reference< awt::XWindow >( xUIElement->getRealInterface(), uno::UNO_QUERY ); } - catch ( uno::RuntimeException& ) { throw; } - catch ( uno::Exception& ) {} + catch (const uno::RuntimeException&) + { + throw; + } + catch (const uno::Exception&) + { + } Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); if ( pWindow ) @@ -1306,7 +1336,9 @@ void ToolbarLayoutManager::implts_createToolBar( const ::rtl::OUString& aName, b static_cast< OWeakObject * >( this ), uno::UNO_QUERY )); xDockWindow->enableDocking( sal_True ); } - catch ( uno::Exception& ) {} + catch (const uno::Exception&) + { + } } /* SAFE AREA ----------------------------------------------------------------------------------------------- */ @@ -1378,8 +1410,12 @@ uno::Reference< ui::XUIElement > ToolbarLayoutManager::implts_createElement( con if ( xUIElementFactory.is() ) xUIElement = xUIElementFactory->createUIElement( aName, aPropSeq ); } - catch ( container::NoSuchElementException& ) {} - catch ( lang::IllegalArgumentException& ) {} + catch (const container::NoSuchElementException&) + { + } + catch (const lang::IllegalArgumentException&) + { + } implts_setToolbarCreation( false ); return xUIElement; @@ -1674,7 +1710,9 @@ sal_Bool ToolbarLayoutManager::implts_readWindowStateData( const rtl::OUString& return sal_True; } - catch ( container::NoSuchElementException& ) {} + catch (const container::NoSuchElementException&) + { + } } return sal_False; @@ -1696,11 +1734,13 @@ void ToolbarLayoutManager::implts_writeWindowStateData( const UIElement& rElemen // Check persistent flag of the user interface element xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Persistent" ))) >>= bPersistent; } - catch ( beans::UnknownPropertyException ) + catch (const beans::UnknownPropertyException&) { bPersistent = true; // Non-configurable elements should at least store their dimension/position } - catch ( lang::WrappedTargetException ) {} + catch (const lang::WrappedTargetException&) + { + } } if ( bPersistent && xPersistentWindowState.is() ) @@ -1749,7 +1789,9 @@ void ToolbarLayoutManager::implts_writeWindowStateData( const UIElement& rElemen xInsert->insertByName( aName, uno::makeAny( aWindowState )); } } - catch ( uno::Exception& ) {} + catch (const uno::Exception&) + { + } } // Reset flag @@ -3342,11 +3384,15 @@ void ToolbarLayoutManager::implts_renumberRowColumnData( xReplace->replaceByName( aWindowElements[i], makeAny( aPropValueSeq )); } } - catch ( uno::Exception& ) {} + catch (const uno::Exception&) + { + } } } } - catch ( uno::Exception& ) {} + catch (const uno::Exception&) + { + } } } @@ -3641,7 +3687,9 @@ throw (uno::RuntimeException) m_aDockUIElement.m_aFloatingData = aUIDockingElement.m_aFloatingData; aWriteLock.unlock(); } - catch ( uno::Exception& ) {} + catch (const uno::Exception&) + { + } } return aDockingData; @@ -4004,9 +4052,15 @@ throw (uno::RuntimeException) if ( xPropSet.is() ) xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UIName" ))) >>= aUIName; } - catch ( container::NoSuchElementException& ) {} - catch ( beans::UnknownPropertyException& ) {} - catch ( lang::WrappedTargetException& ) {} + catch (const container::NoSuchElementException&) + { + } + catch (const beans::UnknownPropertyException&) + { + } + catch (const lang::WrappedTargetException&) + { + } { SolarMutexGuard aGuard; @@ -4151,7 +4205,9 @@ bool ToolbarLayoutManager::floatToolbar( const ::rtl::OUString& rResourceURL ) return true; } } - catch ( lang::DisposedException& ) {} + catch (const lang::DisposedException&) + { + } } return false; @@ -4176,7 +4232,9 @@ bool ToolbarLayoutManager::lockToolbar( const ::rtl::OUString& rResourceURL ) return true; } } - catch ( lang::DisposedException& ) {} + catch (const lang::DisposedException&) + { + } } return false; @@ -4201,7 +4259,9 @@ bool ToolbarLayoutManager::unlockToolbar( const ::rtl::OUString& rResourceURL ) return true; } } - catch ( lang::DisposedException& ) {} + catch (const lang::DisposedException&) + { + } } return false; diff --git a/framework/source/lomenubar/FrameHelper.cxx b/framework/source/lomenubar/FrameHelper.cxx index 8153ad6fa9df..b31335102fc7 100644 --- a/framework/source/lomenubar/FrameHelper.cxx +++ b/framework/source/lomenubar/FrameHelper.cxx @@ -647,7 +647,7 @@ FrameHelper::getLabelFromCommandURL (OUString commandURL) { m_xUICommands->getByName (commandURL) >>= commandProps; } - catch (com::sun::star::container::NoSuchElementException e) + catch (const com::sun::star::container::NoSuchElementException&) { return label; } diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index 14f6dc954588..32616a1e1d5e 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -185,7 +185,7 @@ BackingWindow::BackingWindow( Window* i_pParent ) : } } } - catch (Exception& ) + catch (const Exception&) { } @@ -920,7 +920,7 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) xProductRegistration->trigger( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "RegistrationRequired" ) ) ); } } - catch( const Exception& ) + catch (const Exception&) { } break; @@ -967,7 +967,7 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) } } } - catch (Exception& ) + catch (const Exception&) { } } @@ -1060,7 +1060,7 @@ static long implDispatchDelayed( void*, void* pArg ) { pDispatch->xDispatch->dispatch( pDispatch->aDispatchURL, pDispatch->aArgs ); } - catch( Exception ) + catch (const Exception&) { } @@ -1108,11 +1108,11 @@ void BackingWindow::dispatchURL( const rtl::OUString& i_rURL, delete pDisp; // event could not be posted for unknown reason, at least don't leak } } - catch ( com::sun::star::uno::RuntimeException& ) + catch (const com::sun::star::uno::RuntimeException&) { throw; } - catch ( com::sun::star::uno::Exception& ) + catch (const com::sun::star::uno::Exception&) { } } |