Kaydet (Commit) 4acffc24 authored tarafından Caolán McNamara's avatar Caolán McNamara

catch by const reference

üst 2dea0dab
...@@ -134,8 +134,10 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect) ...@@ -134,8 +134,10 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
#ifdef GNOME_VFS_ENABLED #ifdef GNOME_VFS_ENABLED
// register GnomeUCP if necessary // register GnomeUCP if necessary
::ucbhelper::ContentBroker* cb = ::ucbhelper::ContentBroker::get(); ::ucbhelper::ContentBroker* cb = ::ucbhelper::ContentBroker::get();
if(cb) { if(cb)
try { {
try
{
Reference< XCurrentContext > xCurrentContext( Reference< XCurrentContext > xCurrentContext(
getCurrentContext()); getCurrentContext());
if (xCurrentContext.is()) if (xCurrentContext.is())
...@@ -169,12 +171,15 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect) ...@@ -169,12 +171,15 @@ static bool configureUcb(bool bServer, rtl::OUString const & rPortalConnect)
xCP, xCP,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".*")),
false); false);
} catch (...) }
catch (...)
{ {
} }
} }
} }
} catch (RuntimeException &e) { }
catch (const RuntimeException &)
{
} }
} }
#endif // GNOME_VFS_ENABLED #endif // GNOME_VFS_ENABLED
...@@ -193,7 +198,7 @@ Reference< XMultiServiceFactory > Desktop::CreateApplicationServiceManager() ...@@ -193,7 +198,7 @@ Reference< XMultiServiceFactory > Desktop::CreateApplicationServiceManager()
return xMS; return xMS;
} }
catch( ::com::sun::star::uno::Exception& ) catch (const ::com::sun::star::uno::Exception&)
{ {
} }
...@@ -213,7 +218,7 @@ void Desktop::DestroyApplicationServiceManager( Reference< XMultiServiceFactory ...@@ -213,7 +218,7 @@ void Desktop::DestroyApplicationServiceManager( Reference< XMultiServiceFactory
xComp->dispose(); xComp->dispose();
} }
} }
catch ( UnknownPropertyException& ) catch (const UnknownPropertyException&)
{ {
} }
} }
...@@ -299,28 +304,33 @@ void Desktop::createAcceptor(const OUString& aAcceptString) ...@@ -299,28 +304,33 @@ void Desktop::createAcceptor(const OUString& aAcceptString)
// check whether the requested acceptor already exists // check whether the requested acceptor already exists
AcceptorMap &rMap = acceptorMap::get(); AcceptorMap &rMap = acceptorMap::get();
AcceptorMap::const_iterator pIter = rMap.find(aAcceptString); AcceptorMap::const_iterator pIter = rMap.find(aAcceptString);
if (pIter == rMap.end() ) { if (pIter == rMap.end() )
{
Sequence< Any > aSeq( 2 ); Sequence< Any > aSeq( 2 );
aSeq[0] <<= aAcceptString; aSeq[0] <<= aAcceptString;
aSeq[1] <<= bAccept; aSeq[1] <<= bAccept;
Reference<XInitialization> rAcceptor( Reference<XInitialization> rAcceptor(
::comphelper::getProcessServiceFactory()->createInstance( ::comphelper::getProcessServiceFactory()->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Acceptor" ))), UNO_QUERY ); OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.office.Acceptor" ))), UNO_QUERY );
if ( rAcceptor.is() ) { if ( rAcceptor.is() )
try{ {
try
{
rAcceptor->initialize( aSeq ); rAcceptor->initialize( aSeq );
rMap.insert(AcceptorMap::value_type(aAcceptString, rAcceptor)); rMap.insert(AcceptorMap::value_type(aAcceptString, rAcceptor));
} catch (com::sun::star::uno::Exception&) { }
catch (const com::sun::star::uno::Exception&)
{
// no error handling needed... // no error handling needed...
// acceptor just won't come up // acceptor just won't come up
OSL_FAIL("Acceptor could not be created."); OSL_FAIL("Acceptor could not be created.");
} }
} else { }
else
{
// there is already an acceptor with this description // there is already an acceptor with this description
OSL_FAIL("Acceptor already exists."); OSL_FAIL("Acceptor already exists.");
} }
} }
} }
...@@ -390,7 +400,7 @@ void Desktop::CreateTemporaryDirectory() ...@@ -390,7 +400,7 @@ void Desktop::CreateTemporaryDirectory()
SvtPathOptions aOpt; SvtPathOptions aOpt;
aTempBaseURL = aOpt.GetTempPath(); aTempBaseURL = aOpt.GetTempPath();
} }
catch ( RuntimeException& e ) catch (RuntimeException& e)
{ {
// Catch runtime exception here: We have to add language dependent info // Catch runtime exception here: We have to add language dependent info
// to the exception message. Fallback solution uses hard coded string. // to the exception message. Fallback solution uses hard coded string.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment