summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-27 16:09:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-28 09:22:55 +0000
commitf1d83ac45f08270f7f2dd7128056effd0251dc5e (patch)
tree55d924eaa7f55627039d44458d869ef65130fdf8 /comphelper
parent53d3755972bfd3bd2cd650edf91f1483038028c8 (diff)
loplugin:stringconstant check for unnecessary OUString constructor..
..calls when creating exceptions Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe Reviewed-on: https://gerrit.libreoffice.org/33617 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/qa/unit/variadictemplates.cxx2
-rw-r--r--comphelper/source/misc/instancelocker.cxx8
-rw-r--r--comphelper/source/misc/numberedcollection.cxx4
3 files changed, 7 insertions, 7 deletions
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<sal_Int16>(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<sal_IntPtr>( 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<sal_IntPtr>( xComponent.get() );
TNumberedItemHash::iterator pIt = m_lComponents.find (pComponent);