diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-16 14:48:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-16 15:25:13 +0100 |
commit | 4acffc240b4845beedfe66eaa571b814d65e2e57 (patch) | |
tree | c81bfc7b4b4c92ddc5a573d6496cc00097a89692 /desktop | |
parent | 2dea0dab4fafda3c10a5bd03ad15ed39a4658b51 (diff) |
catch by const reference
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/appinit.cxx | 50 |
1 files changed, 30 insertions, 20 deletions
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 13624379bf5d..cabc8ddd6c1f 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -134,8 +134,10 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect) #ifdef GNOME_VFS_ENABLED // register GnomeUCP if necessary ::ucbhelper::ContentBroker* cb = ::ucbhelper::ContentBroker::get(); - if(cb) { - try { + if(cb) + { + try + { Reference< XCurrentContext > xCurrentContext( getCurrentContext()); if (xCurrentContext.is()) @@ -169,12 +171,15 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect) xCP, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")), false); - } catch (...) + } + catch (...) { } } } - } catch (RuntimeException &e) { + } + catch (const RuntimeException &) + { } } #endif // GNOME_VFS_ENABLED @@ -193,7 +198,7 @@ Reference< XMultiServiceFactory > Desktop::CreateApplicationServiceManager() return xMS; } - catch( ::com::sun::star::uno::Exception& ) + catch (const ::com::sun::star::uno::Exception&) { } @@ -213,7 +218,7 @@ void Desktop::DestroyApplicationServiceManager( Reference< XMultiServiceFactory xComp->dispose(); } } - catch ( UnknownPropertyException& ) + catch (const UnknownPropertyException&) { } } @@ -299,28 +304,33 @@ void Desktop::createAcceptor(const OUString& aAcceptString) // check whether the requested acceptor already exists AcceptorMap &rMap = acceptorMap::get(); AcceptorMap::const_iterator pIter = rMap.find(aAcceptString); - if (pIter == rMap.end() ) { - + if (pIter == rMap.end() ) + { Sequence< Any > aSeq( 2 ); aSeq[0] <<= aAcceptString; aSeq[1] <<= bAccept; Reference<XInitialization> rAcceptor( ::comphelper::getProcessServiceFactory()->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Acceptor" ))), UNO_QUERY ); - if ( rAcceptor.is() ) { - try{ + if ( rAcceptor.is() ) + { + try + { rAcceptor->initialize( aSeq ); rMap.insert(AcceptorMap::value_type(aAcceptString, rAcceptor)); - } catch (com::sun::star::uno::Exception&) { - // no error handling needed... - // acceptor just won't come up - OSL_FAIL("Acceptor could not be created."); + } + catch (const com::sun::star::uno::Exception&) + { + // no error handling needed... + // acceptor just won't come up + OSL_FAIL("Acceptor could not be created."); + } + } + else + { + // there is already an acceptor with this description + OSL_FAIL("Acceptor already exists."); } - } else { - // there is already an acceptor with this description - OSL_FAIL("Acceptor already exists."); - } - } } @@ -390,7 +400,7 @@ void Desktop::CreateTemporaryDirectory() SvtPathOptions aOpt; aTempBaseURL = aOpt.GetTempPath(); } - catch ( RuntimeException& e ) + catch (RuntimeException& e) { // Catch runtime exception here: We have to add language dependent info // to the exception message. Fallback solution uses hard coded string. |