diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-09 02:56:30 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2011-12-09 09:59:02 +0900 |
commit | 9262039e908b3ea897180bc723d947d3d7546d4e (patch) | |
tree | 0937618fd39b4d73e770664fae96166304df7d68 /embeddedobj/source/commonembedding | |
parent | Revert "mysqlcppconn: force recompilation when switching between different bi... (diff) | |
download | core-9262039e908b3ea897180bc723d947d3d7546d4e.tar.gz core-9262039e908b3ea897180bc723d947d3d7546d4e.zip |
catch exception by constant reference
Diffstat (limited to 'embeddedobj/source/commonembedding')
-rw-r--r-- | embeddedobj/source/commonembedding/embedobj.cxx | 12 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/miscobj.cxx | 18 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/persistence.cxx | 76 | ||||
-rw-r--r-- | embeddedobj/source/commonembedding/xfactory.cxx | 4 |
4 files changed, 55 insertions, 55 deletions
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx index 151b45c663ee..4303a18f8221 100644 --- a/embeddedobj/source/commonembedding/embedobj.cxx +++ b/embeddedobj/source/commonembedding/embedobj.cxx @@ -103,10 +103,10 @@ void OCommonEmbeddedObject::Deactivate() try { xClientSite->saveObject(); } - catch( embed::ObjectSaveVetoException& ) + catch( const embed::ObjectSaveVetoException& ) { } - catch( uno::Exception& e ) + catch( const uno::Exception& e ) { throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "The client could not store the object!" )), @@ -144,7 +144,7 @@ void OCommonEmbeddedObject::StateChangeNotification_Impl( sal_Bool bBeforeChange else ((embed::XStateChangeListener*)pIterator.next())->stateChanged( aSource, nOldState, nNewState ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { // even if the listener complains ignore it for now } @@ -329,7 +329,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState ) aModuleName = xManager->identify( xContDoc ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} // if currently another object is UIactive it will be deactivated; usually this will activate the LM of @@ -481,7 +481,7 @@ void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState ) SwitchStateTo_Impl( nNewState ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { if ( nOldState != m_nObjectState ) // notify listeners that the object has changed the state @@ -555,7 +555,7 @@ void SAL_CALL OCommonEmbeddedObject::doVerb( sal_Int32 nVerbID ) { nNewState = ConvertVerbToState_Impl( nVerbID ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} if ( nNewState == -1 ) diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index de052802135c..1a34b4c615bd 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -283,7 +283,7 @@ OCommonEmbeddedObject::~OCommonEmbeddedObject() delete m_pInterfaceContainer; m_pInterfaceContainer = NULL; } - } catch( uno::Exception& ) {} + } catch( const uno::Exception& ) {} try { if ( m_pDocHolder ) @@ -291,13 +291,13 @@ OCommonEmbeddedObject::~OCommonEmbeddedObject() m_pDocHolder->CloseFrame(); try { m_pDocHolder->CloseDocument( sal_True, sal_True ); - } catch ( uno::Exception& ) {} + } catch ( const uno::Exception& ) {} m_pDocHolder->FreeOffice(); m_pDocHolder->release(); m_pDocHolder = NULL; } - } catch( uno::Exception& ) {} + } catch( const uno::Exception& ) {} } } @@ -317,7 +317,7 @@ void OCommonEmbeddedObject::requestPositioning( const awt::Rectangle& aRect ) try { xInplaceClient->changedPlacement( aRect ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { OSL_FAIL( "Exception on request to resize!\n" ); } @@ -348,7 +348,7 @@ void OCommonEmbeddedObject::PostEvent_Impl( const ::rtl::OUString& aEventName, { ((document::XEventListener *)aIt.next())->notifyEvent( aEvent ); } - catch( uno::RuntimeException& ) + catch( const uno::RuntimeException& ) { aIt.remove(); } @@ -570,7 +570,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership ) { ((util::XCloseListener*)pIterator.next())->queryClosing( aSource, bDeliverOwnership ); } - catch( uno::RuntimeException& ) + catch( const uno::RuntimeException& ) { pIterator.remove(); } @@ -588,7 +588,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership ) { ((util::XCloseListener*)pCloseIterator.next())->notifyClosing( aSource ); } - catch( uno::RuntimeException& ) + catch( const uno::RuntimeException& ) { pCloseIterator.remove(); } @@ -611,7 +611,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership ) try { m_pDocHolder->CloseDocument( bDeliverOwnership, bDeliverOwnership ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { if ( bDeliverOwnership ) { @@ -640,7 +640,7 @@ void SAL_CALL OCommonEmbeddedObject::close( sal_Bool bDeliverOwnership ) { try { xComp->dispose(); - } catch ( uno::Exception& ) {} + } catch ( const uno::Exception& ) {} } m_xObjectStorage.clear(); diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index a3c83948f64c..8afe92d881b1 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -159,7 +159,7 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor( try { xStorage->copyToStorage( xTempStorage ); - } catch( uno::Exception& e ) + } catch( const uno::Exception& e ) { throw embed::StorageWrappedTargetException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Can't copy storage!" )), @@ -173,7 +173,7 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor( if ( xComponent.is() ) xComponent->dispose(); } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } @@ -182,7 +182,7 @@ uno::Reference< io::XInputStream > createTempInpStreamFromStor( if ( xTempOut.is() ) xTempOut->closeOutput(); } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } @@ -253,7 +253,7 @@ static void SetDocToEmbedded( const uno::Reference< frame::XModel > xDocument, c uno::Reference< frame::XModule > xModule( xDocument, uno::UNO_QUERY_THROW ); xModule->setIdentifier( aModuleName ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} } } @@ -291,7 +291,7 @@ void OCommonEmbeddedObject::SwitchOwnPersistence( const uno::Reference< embed::X if ( xComponent.is() ) xComponent->dispose(); } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } } @@ -368,7 +368,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() } xModel->attachResource( xModel->getURL(), m_aDocMediaDescriptor ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { uno::Reference< util::XCloseable > xCloseable( xDocument, uno::UNO_QUERY ); if ( xCloseable.is() ) @@ -377,7 +377,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::InitNewDocument_Impl() { xCloseable->close( sal_True ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } } @@ -440,7 +440,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() } } } - catch( uno::Exception& ) + catch( const uno::Exception& ) { uno::Reference< util::XCloseable > xCloseable( xDocument, uno::UNO_QUERY ); if ( xCloseable.is() ) @@ -449,7 +449,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() { xCloseable->close( sal_True ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } } @@ -470,7 +470,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadLink_Impl() try { ::comphelper::MimeConfigurationHelper aHelper( m_xFactory ); aFilterName = aHelper.GetDefaultFilterFromServiceName( GetDocumentServiceName(), nVersion ); - } catch( uno::Exception& ) + } catch( const uno::Exception& ) {} } @@ -539,7 +539,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag uno::Reference< beans::XPropertySet > xTempStreamProps( xTempInpStream, uno::UNO_QUERY_THROW ); xTempStreamProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Uri" )) ) >>= aTempFileURL; } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } @@ -566,7 +566,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag else xLoadable->load( aLoadArgs.getPropertyValues() ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { uno::Reference< util::XCloseable > xCloseable( xDocument, uno::UNO_QUERY ); if ( xCloseable.is() ) @@ -575,7 +575,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag { xCloseable->close( sal_True ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { DBG_UNHANDLED_EXCEPTION(); } @@ -632,7 +632,7 @@ uno::Reference< io::XInputStream > OCommonEmbeddedObject::StoreDocumentToTempStr { xTempOut->closeOutput(); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { OSL_FAIL( "Looks like stream was closed already" ); } @@ -653,13 +653,13 @@ void OCommonEmbeddedObject::SaveObject_Impl() if ( xModifiable.is() && !xModifiable->isModified() ) return; } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} try { m_xClientSite->saveObject(); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { OSL_FAIL( "The object was not stored!\n" ); } @@ -688,7 +688,7 @@ void OCommonEmbeddedObject::SaveObject_Impl() } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} } @@ -834,7 +834,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateDocFromMediaDesc xLoadable->load( addAsTemplate( aMedDescr ) ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { uno::Reference< util::XCloseable > xCloseable( xDocument, uno::UNO_QUERY ); if ( xCloseable.is() ) @@ -843,7 +843,7 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateDocFromMediaDesc { xCloseable->close( sal_True ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } } @@ -867,11 +867,11 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateTempDocFromLink_ try { nStorageFormat = ::comphelper::OStorageHelper::GetXStorageFormat( m_xParentStorage ); } - catch ( beans::IllegalTypeException& ) + catch ( const beans::IllegalTypeException& ) { // the container just has an unknown type, use current file format } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { OSL_FAIL( "Can not retrieve storage media type!\n" ); } @@ -892,11 +892,11 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::CreateTempDocFromLink_ uno::Reference< beans::XPropertySet > xTempStreamProps( xTempStream, uno::UNO_QUERY_THROW ); xTempStreamProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Uri" )) ) >>= aTempFileURL; } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } - OSL_ENSURE( aTempFileURL.getLength(), "Coudn't retrieve temporary file URL!\n" ); + OSL_ENSURE( aTempFileURL.getLength(), "Couldn't retrieve temporary file URL!\n" ); aTempMediaDescr[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "URL" )); aTempMediaDescr[0].Value <<= aTempFileURL; @@ -1193,11 +1193,11 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed:: try { nTargetStorageFormat = ::comphelper::OStorageHelper::GetXStorageFormat( xStorage ); } - catch ( beans::IllegalTypeException& ) + catch ( const beans::IllegalTypeException& ) { // the container just has an unknown type, use current file format } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { OSL_FAIL( "Can not retrieve target storage media type!\n" ); } @@ -1206,11 +1206,11 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed:: { nOriginalStorageFormat = ::comphelper::OStorageHelper::GetXStorageFormat( m_xParentStorage ); } - catch ( beans::IllegalTypeException& ) + catch ( const beans::IllegalTypeException& ) { // the container just has an unknown type, use current file format } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { OSL_FAIL( "Can not retrieve own storage media type!\n" ); } @@ -1242,7 +1242,7 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed:: xSource->copyElementDirectlyTo( m_aEntryName, xTarget, sEntName ); bOptimizationWorks = sal_True; } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } } @@ -1324,11 +1324,11 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed:: try { nTargetStorageFormat = ::comphelper::OStorageHelper::GetXStorageFormat( xStorage ); } - catch ( beans::IllegalTypeException& ) + catch ( const beans::IllegalTypeException& ) { // the container just has an unknown type, use current file format } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { OSL_FAIL( "Can not retrieve target storage media type!\n" ); } @@ -1337,11 +1337,11 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed:: { nOriginalStorageFormat = ::comphelper::OStorageHelper::GetXStorageFormat( m_xParentStorage ); } - catch ( beans::IllegalTypeException& ) + catch ( const beans::IllegalTypeException& ) { // the container just has an unknown type, use current file format } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { OSL_FAIL( "Can not retrieve own storage media type!\n" ); } @@ -1375,7 +1375,7 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed:: xSource->copyElementDirectlyTo( m_aEntryName, xTarget, sEntName ); bOptimizationWorks = sal_True; } - catch( uno::Exception& ) + catch( const uno::Exception& ) { } } @@ -1480,7 +1480,7 @@ void SAL_CALL OCommonEmbeddedObject::saveCompleted( sal_Bool bUseNew ) if ( xComponent.is() ) xComponent->dispose(); } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } } @@ -1613,11 +1613,11 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn() try { nStorageFormat = ::comphelper::OStorageHelper::GetXStorageFormat( m_xParentStorage ); } - catch ( beans::IllegalTypeException& ) + catch ( const beans::IllegalTypeException& ) { // the container just has an unknown type, use current file format } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { OSL_FAIL( "Can not retrieve storage media type!\n" ); } @@ -1774,7 +1774,7 @@ void SAL_CALL OCommonEmbeddedObject::reload( if ( xComponent.is() ) xComponent->dispose(); } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } @@ -1857,7 +1857,7 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt { xModif->setModified( sal_True ); } - catch( uno::Exception& ) + catch( const uno::Exception& ) {} m_pDocHolder->SetComponent( xDocument, m_bReadOnly ); diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx index 3e51fb63915d..e12a939f88c9 100644 --- a/embeddedobj/source/commonembedding/xfactory.cxx +++ b/embeddedobj/source/commonembedding/xfactory.cxx @@ -114,7 +114,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta uno::Any aAny = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MediaType" )) ); aAny >>= aMediaType; } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } @@ -123,7 +123,7 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta if ( xComp.is() ) xComp->dispose(); } - catch ( uno::Exception& ) + catch ( const uno::Exception& ) { } xSubStorage = uno::Reference< embed::XStorage >(); |