From f1d83ac45f08270f7f2dd7128056effd0251dc5e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 27 Jan 2017 16:09:54 +0200 Subject: loplugin:stringconstant check for unnecessary OUString constructor.. ..calls when creating exceptions Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe Reviewed-on: https://gerrit.libreoffice.org/33617 Tested-by: Jenkins Reviewed-by: Noel Grandin --- comphelper/qa/unit/variadictemplates.cxx | 2 +- comphelper/source/misc/instancelocker.cxx | 8 ++++---- comphelper/source/misc/numberedcollection.cxx | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'comphelper') diff --git a/comphelper/qa/unit/variadictemplates.cxx b/comphelper/qa/unit/variadictemplates.cxx index 67e76bb79d33..77114df20fe2 100644 --- a/comphelper/qa/unit/variadictemplates.cxx +++ b/comphelper/qa/unit/variadictemplates.cxx @@ -40,7 +40,7 @@ inline void extract( { if (nArg >= seq.getLength()) { throw ::com::sun::star::lang::IllegalArgumentException( - OUString( "No such argument available!"), + "No such argument available!", xErrorContext, static_cast(nArg) ); } if (! fromAny(seq[nArg], &v)) { diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index 97671aca372c..a67ae554f238 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -130,13 +130,13 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg sal_Int32 nLen = aArguments.getLength(); if ( nLen < 2 || nLen > 3 ) throw lang::IllegalArgumentException( - OUString( "Wrong count of parameters!" ), + "Wrong count of parameters!", uno::Reference< uno::XInterface >(), 0 ); if ( !( aArguments[0] >>= xInstance ) || !xInstance.is() ) throw lang::IllegalArgumentException( - OUString( "Nonempty reference is expected as the first argument!" ), + "Nonempty reference is expected as the first argument!", uno::Reference< uno::XInterface >(), 0 ); @@ -149,14 +149,14 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg ) { throw lang::IllegalArgumentException( - OUString("The correct modes set is expected as the second argument!"), + "The correct modes set is expected as the second argument!", uno::Reference< uno::XInterface >(), 0 ); } if ( nLen == 3 && !( aArguments[2] >>= xApproval ) ) throw lang::IllegalArgumentException( - OUString( "If the third argument is provided, it must be XActionsApproval implementation!" ), + "If the third argument is provided, it must be XActionsApproval implementation!", uno::Reference< uno::XInterface >(), 0 ); diff --git a/comphelper/source/misc/numberedcollection.cxx b/comphelper/source/misc/numberedcollection.cxx index 1faf639b16fb..45afaa32e4ae 100644 --- a/comphelper/source/misc/numberedcollection.cxx +++ b/comphelper/source/misc/numberedcollection.cxx @@ -68,7 +68,7 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix) ::osl::ResettableMutexGuard aLock(m_aMutex); if ( ! xComponent.is ()) - throw css::lang::IllegalArgumentException (OUString(ERRMSG_INVALID_COMPONENT_PARAM), m_xOwner.get(), 1); + throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1); sal_IntPtr pComponent = reinterpret_cast( xComponent.get() ); TNumberedItemHash::const_iterator pIt = m_lComponents.find (pComponent); @@ -140,7 +140,7 @@ void SAL_CALL NumberedCollection::releaseNumberForComponent(const css::uno::Refe ::osl::ResettableMutexGuard aLock(m_aMutex); if ( ! xComponent.is ()) - throw css::lang::IllegalArgumentException (OUString(ERRMSG_INVALID_COMPONENT_PARAM), m_xOwner.get(), 1); + throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1); sal_IntPtr pComponent = reinterpret_cast( xComponent.get() ); TNumberedItemHash::iterator pIt = m_lComponents.find (pComponent); -- cgit v1.2.3