diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-16 00:52:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-16 09:15:37 +0100 |
commit | 75705b69c049a2ca10b8e5f2c04232bb82004418 (patch) | |
tree | fdadfde018dbf91b4b5fb7ffa115440eb2a6f34a | |
parent | 43afab8818d7bca24897ddee9b74fbeb74bf4c56 (diff) |
catch by const reference
-rw-r--r-- | vbahelper/source/msforms/vbacontrol.cxx | 8 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbacommandbar.cxx | 4 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbadocumentbase.cxx | 15 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbashapes.cxx | 4 |
4 files changed, 16 insertions, 15 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index 143db79e9c01..8bebe6050d44 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -93,7 +93,7 @@ ScVbaControl::getWindowPeer() throw (uno::RuntimeException) uno::Reference< awt::XControl > xControl( xControlAccess->getControl( xControlModel ), uno::UNO_QUERY ); xWinPeer = xControl->getPeer(); } - catch( uno::Exception ) + catch(const uno::Exception&) { throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("The Control does not exsit")), uno::Reference< uno::XInterface >() ); @@ -305,7 +305,7 @@ ScVbaControl::getControlSource() throw (uno::RuntimeException) xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address") ), uno::makeAny( aAddress ) ); xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sControlSource; } - catch( uno::Exception& ) + catch(const uno::Exception&) { } } @@ -345,7 +345,7 @@ ScVbaControl::getRowSource() throw (uno::RuntimeException) xConvertor->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Address")), uno::makeAny( aAddress ) ); xConvertor->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("XL_A1_Representation") ) ) >>= sRowSource; } - catch( uno::Exception& ) + catch(const uno::Exception&) { } } @@ -469,7 +469,7 @@ void ScVbaControl::fireEvent( script::ScriptEvent& evt ) } } } - catch( uno::Exception& e ) + catch(const uno::Exception&) { } } diff --git a/vbahelper/source/vbahelper/vbacommandbar.cxx b/vbahelper/source/vbahelper/vbacommandbar.cxx index e51aadbe6364..e377fe19d9fc 100644 --- a/vbahelper/source/vbahelper/vbacommandbar.cxx +++ b/vbahelper/source/vbahelper/vbacommandbar.cxx @@ -100,7 +100,7 @@ ScVbaCommandBar::getVisible() throw (uno::RuntimeException) getPropertyValue( aToolBar, rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Visible") ) ) >>= bVisible; } } - catch ( uno::Exception e ) + catch (const uno::Exception&) { } return bVisible; @@ -122,7 +122,7 @@ ScVbaCommandBar::setVisible( ::sal_Bool _visible ) throw (uno::RuntimeException) xLayoutManager->destroyElement( m_sResourceUrl ); } } - catch( uno::Exception& ) + catch(const uno::Exception&) { OSL_TRACE( "SetVisible get an exception\n" ); } diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index e8aa501a40df..156d386b3880 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -157,7 +157,7 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg, xDispatch->dispatch( aURL, uno::Sequence< beans::PropertyValue >() ); bUIClose = sal_True; } - catch( uno::Exception& ) + catch(const uno::Exception&) { } @@ -172,10 +172,11 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg, // The boolean parameter DeliverOwnership tells objects vetoing the close process that they may // assume ownership if they object the closure by throwing a CloseVetoException // Here we give up ownership. To be on the safe side, catch possible veto exception anyway. - try{ + try + { xCloseable->close(sal_True); } - catch( util::CloseVetoException ) + catch(const util::CloseVetoException&) { //close is cancelled, nothing to do } @@ -193,7 +194,7 @@ VbaDocumentBase::Close( const uno::Any &rSaveArg, const uno::Any &rFileArg, { xDisposable->dispose(); } - catch( uno::Exception& ) + catch(const uno::Exception&) { } } @@ -239,11 +240,11 @@ VbaDocumentBase::setSaved( sal_Bool bSave ) throw (uno::RuntimeException) { xModifiable->setModified( !bSave ); } - catch ( lang::DisposedException& ) + catch (const lang::DisposedException&) { // impossibility to set the modified state on disposed document should not trigger an error } - catch ( beans::PropertyVetoException& ) + catch (const beans::PropertyVetoException&) { uno::Any aCaught( ::cppu::getCaughtException() ); throw lang::WrappedTargetRuntimeException( @@ -289,7 +290,7 @@ VbaDocumentBase::getVBProject() throw (uno::RuntimeException) mxVBProject = xServiceManager->createInstanceWithArgumentsAndContext( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.vbide.VBProject" ) ), aArgs, mxContext ); } - catch( uno::Exception& ) + catch(const uno::Exception&) { } return uno::Any( mxVBProject ); diff --git a/vbahelper/source/vbahelper/vbashapes.cxx b/vbahelper/source/vbahelper/vbashapes.cxx index 761d8de625f3..2a2e0ef7c407 100644 --- a/vbahelper/source/vbahelper/vbashapes.cxx +++ b/vbahelper/source/vbahelper/vbashapes.cxx @@ -220,7 +220,7 @@ ScVbaShapes::SelectAll() throw (uno::RuntimeException) // viewuno.cxx ScTabViewObj::select will throw IllegalArgumentException // if one of the shapes is no 'markable' e.g. a button // the method still works - catch( lang::IllegalArgumentException& ) + catch(const lang::IllegalArgumentException&) { } } @@ -463,7 +463,7 @@ ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShap { xPropertySet->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), uno::makeAny( sName ) ); } - catch( script::BasicErrorException e ) + catch(const script::BasicErrorException&) { } } |