From e7bc3cab019fbf040f9fb8b53ae2cf3f977d200b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 23 May 2014 12:03:21 +0200 Subject: remove boilerplate in UNO Exception constructor calls Now that we have default values for Exception constructor params, remove lots of boilerplate code. Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74 --- sfx2/source/appl/openuriexternally.cxx | 6 ++---- sfx2/source/doc/sfxbasemodel.cxx | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'sfx2') diff --git a/sfx2/source/appl/openuriexternally.cxx b/sfx2/source/appl/openuriexternally.cxx index e153bda13623..04da015a3c7d 100644 --- a/sfx2/source/appl/openuriexternally.cxx +++ b/sfx2/source/appl/openuriexternally.cxx @@ -41,10 +41,8 @@ bool sfx2::openUriExternally( } catch (css::lang::IllegalArgumentException & e) { if (e.ArgumentPosition != 0) { throw css::uno::RuntimeException( - (OUString( - "unexpected IllegalArgumentException: ") - + e.Message), - css::uno::Reference< css::uno::XInterface >()); + OUString("unexpected IllegalArgumentException: ") + + e.Message); } SolarMutexGuard g; ErrorBox eb( diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 40ab2128492f..d079799284c1 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -465,17 +465,14 @@ SfxSaveGuard::SfxSaveGuard(const Reference< frame::XModel >& xModel , m_pFramesLock(0 ) { if ( m_pData->m_bClosed ) - throw lang::DisposedException( - OUString("Object already disposed."), - Reference< XInterface >()); + throw lang::DisposedException("Object already disposed."); if ( bRejectConcurrentSaveRequest && m_pData->m_bSaving ) throw io::IOException( - OUString("Concurrent save requests on the same document are not possible."), - Reference< XInterface >()); + "Concurrent save requests on the same document are not possible."); m_pData->m_bSaving = true; m_pFramesLock = new SfxOwnFramesLocker(m_pData->m_pObjectShell); @@ -2427,7 +2424,7 @@ void SAL_CALL SfxBaseModel::removeDocumentEventListener( const Reference< docume void SAL_CALL SfxBaseModel::notifyDocumentEvent( const OUString&, const Reference< frame::XController2 >&, const Any& ) throw ( lang::IllegalArgumentException, lang::NoSupportException, RuntimeException, std::exception ) { - throw lang::NoSupportException("SfxBaseModel controls all the sent notifications itself!", Reference< XInterface >() ); + throw lang::NoSupportException("SfxBaseModel controls all the sent notifications itself!" ); } Sequence< document::CmisProperty > SAL_CALL SfxBaseModel::getCmisProperties() @@ -3013,8 +3010,7 @@ void SfxBaseModel::impl_store( const OUString& sURL m_pData->m_pObjectShell->StoreLog(); throw frame::IllegalArgumentIOException( - OUString( "CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!"), - Reference< XInterface >() ); + "CopyStreamIfPossible parameter is not acceptable for storeAsURL() call!" ); } sal_uInt32 nModifyPasswordHash = 0; -- cgit