summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/package
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 /ucb/source/ucp/package
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 'ucb/source/ucp/package')
-rw-r--r--ucb/source/ucp/package/pkgcontent.cxx73
1 files changed, 28 insertions, 45 deletions
diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx
index 5a4153124bd6..7d7285b61d94 100644
--- a/ucb/source/ucp/package/pkgcontent.cxx
+++ b/ucb/source/ucp/package/pkgcontent.cxx
@@ -438,7 +438,7 @@ uno::Any SAL_CALL Content::execute(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
- OUString( "Wrong argument type!" ),
+ "Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
Environment );
@@ -458,7 +458,7 @@ uno::Any SAL_CALL Content::execute(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
- OUString( "Wrong argument type!" ),
+ "Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
Environment );
@@ -469,7 +469,7 @@ uno::Any SAL_CALL Content::execute(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
- OUString( "No properties!" ),
+ "No properties!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
Environment );
@@ -507,7 +507,7 @@ uno::Any SAL_CALL Content::execute(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
- OUString( "Wrong argument type!" ),
+ "Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
Environment );
@@ -527,7 +527,7 @@ uno::Any SAL_CALL Content::execute(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
- OUString( "Wrong argument type!" ),
+ "Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
Environment );
@@ -584,7 +584,7 @@ uno::Any SAL_CALL Content::execute(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
- OUString( "Wrong argument type!" ),
+ "Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
Environment );
@@ -606,7 +606,7 @@ uno::Any SAL_CALL Content::execute(
OSL_FAIL( "Wrong argument type!" );
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
- OUString( "Wrong argument type!" ),
+ "Wrong argument type!",
static_cast< cppu::OWeakObject * >( this ),
-1 ) ),
Environment );
@@ -1038,32 +1038,28 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
- OUString(
- "Property is read-only!" ),
+ "Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else if ( rValue.Name == "IsDocument" )
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
- OUString(
- "Property is read-only!" ),
+ "Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else if ( rValue.Name == "IsFolder" )
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
- OUString(
- "Property is read-only!" ),
+ "Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else if ( rValue.Name == "CreatableContentsInfo" )
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
- OUString(
- "Property is read-only!" ),
+ "Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else if ( rValue.Name == "Title" )
@@ -1072,8 +1068,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
- OUString(
- "Property is read-only!" ),
+ "Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else
@@ -1102,8 +1097,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{
aRet[ n ] <<=
lang::IllegalArgumentException(
- OUString(
- "Empty title not allowed!" ),
+ "Empty title not allowed!",
static_cast< cppu::OWeakObject * >( this ),
-1 );
}
@@ -1112,8 +1106,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{
aRet[ n ] <<=
beans::IllegalTypeException(
- OUString(
- "Property value has wrong type!" ),
+ "Property value has wrong type!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -1138,8 +1131,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
else
{
aRet[ n ] <<= beans::IllegalTypeException(
- OUString(
- "Property value has wrong type!" ),
+ "Property value has wrong type!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -1147,8 +1139,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
- OUString(
- "Property is read-only!" ),
+ "Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else if ( rValue.Name == "Compressed" )
@@ -1174,16 +1165,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
else
{
aRet[ n ] <<= beans::IllegalTypeException(
- OUString(
- "Property value has wrong type!" ),
+ "Property value has wrong type!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
else
{
aRet[ n ] <<= beans::UnknownPropertyException(
- OUString(
- "Compressed only supported by streams!" ),
+ "Compressed only supported by streams!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -1210,16 +1199,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
else
{
aRet[ n ] <<= beans::IllegalTypeException(
- OUString(
- "Property value has wrong type!" ),
+ "Property value has wrong type!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
else
{
aRet[ n ] <<= beans::UnknownPropertyException(
- OUString(
- "Encrypted only supported by streams!" ),
+ "Encrypted only supported by streams!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -1227,8 +1214,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
{
// Read-only property!
aRet[ n ] <<= lang::IllegalAccessException(
- OUString(
- "Property is read-only!" ),
+ "Property is read-only!",
static_cast< cppu::OWeakObject * >( this ) );
}
else if ( rValue.Name == "EncryptionKey" )
@@ -1259,16 +1245,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
else
{
aRet[ n ] <<= beans::IllegalTypeException(
- OUString(
- "Property value has wrong type!" ),
+ "Property value has wrong type!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
else
{
aRet[ n ] <<= beans::UnknownPropertyException(
- OUString(
- "EncryptionKey not supported by non-root folder!" ),
+ "EncryptionKey not supported by non-root folder!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -1321,8 +1305,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
else
{
aRet[ n ] <<= uno::Exception(
- OUString(
- "No property set for storing the value!" ),
+ "No property set for storing the value!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -1356,7 +1339,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues(
// Set error .
aRet[ nTitlePos ] <<= uno::Exception(
- OUString("Exchange failed!"),
+ "Exchange failed!",
static_cast< cppu::OWeakObject * >( this ) );
}
}
@@ -1639,7 +1622,7 @@ void Content::insert(
ucbhelper::cancelCommandExecution(
uno::makeAny(
ucb::UnsupportedNameClashException(
- OUString( "Unable to resolve name clash!" ),
+ "Unable to resolve name clash!",
static_cast< cppu::OWeakObject * >( this ),
nNameClashResolve ) ),
xEnv );
@@ -1729,7 +1712,7 @@ void Content::destroy(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( ucb::UnsupportedCommandException(
- OUString( "Not persistent!" ),
+ "Not persistent!",
static_cast< cppu::OWeakObject * >( this ) ) ),
xEnv );
// Unreachable
@@ -1770,7 +1753,7 @@ void Content::transfer(
{
ucbhelper::cancelCommandExecution(
uno::makeAny( ucb::UnsupportedCommandException(
- OUString( "Not persistent!" ),
+ "Not persistent!",
static_cast< cppu::OWeakObject * >( this ) ) ),
xEnv );
// Unreachable