summaryrefslogtreecommitdiff
path: root/stoc/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-05-28 12:50:02 +0200
committerNoel Grandin <noel@peralex.com>2014-05-29 09:01:40 +0200
commitebc0a15515c2e29259a7e229cfbdfb5d26fc3006 (patch)
tree2ce9446ed312a1a7aed53183b19ecc9fefabea8a /stoc/source
parentf0ae48b684e89acd7088c31a8feff5fc03d51105 (diff)
remove more unnecesary OUString constructor use
when throwing exceptions Change-Id: I6edfb6b6745499f802b0e3c0e096a36fb7c32aac
Diffstat (limited to 'stoc/source')
-rw-r--r--stoc/source/corereflection/crarray.cxx16
-rw-r--r--stoc/source/corereflection/crcomp.cxx10
-rw-r--r--stoc/source/corereflection/crefl.cxx8
-rw-r--r--stoc/source/corereflection/crenum.cxx4
-rw-r--r--stoc/source/corereflection/criface.cxx19
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx11
-rw-r--r--stoc/source/typeconv/convert.cxx38
7 files changed, 52 insertions, 54 deletions
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx
index 5bf6622bbf31..5a522a00c802 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -83,13 +83,13 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 nLen )
if (eTC != TypeClass_SEQUENCE)
{
throw IllegalArgumentException(
- OUString("no sequence given!"),
+ "no sequence given!",
(XWeak *)(OWeakObject *)this, 0 );
}
if (nLen < 0)
{
throw IllegalArgumentException(
- OUString("illegal length given!"),
+ "illegal length given!",
(XWeak *)(OWeakObject *)this, 1 );
}
@@ -108,7 +108,7 @@ sal_Int32 ArrayIdlClassImpl::getLen( const Any & rArray )
if (eTC != TypeClass_SEQUENCE)
{
throw IllegalArgumentException(
- OUString("no sequence given!"),
+ "no sequence given!",
(XWeak *)(OWeakObject *)this, 0 );
}
@@ -122,7 +122,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 nIndex )
if (eTC != TypeClass_SEQUENCE)
{
throw IllegalArgumentException(
- OUString("no sequence given!"),
+ "no sequence given!",
(XWeak *)(OWeakObject *)this, 0 );
}
@@ -130,7 +130,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 nIndex )
if (pSeq->nElements <= nIndex)
{
throw ArrayIndexOutOfBoundsException(
- OUString("illegal index given!"),
+ "illegal index given!",
(XWeak *)(OWeakObject *)this );
}
@@ -153,7 +153,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
if (eTC != TypeClass_SEQUENCE)
{
throw IllegalArgumentException(
- OUString("no sequence given!"),
+ "no sequence given!",
(XWeak *)(OWeakObject *)this, 0 );
}
@@ -161,7 +161,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
if (pSeq->nElements <= nIndex)
{
throw ArrayIndexOutOfBoundsException(
- OUString("illegal index given!"),
+ "illegal index given!",
(XWeak *)(OWeakObject *)this );
}
@@ -181,7 +181,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
{
TYPELIB_DANGER_RELEASE( pElemTypeDescr );
throw IllegalArgumentException(
- OUString("sequence element is not assignable by given value!"),
+ "sequence element is not assignable by given value!",
(XWeak *)(OWeakObject *)this, 2 );
}
TYPELIB_DANGER_RELEASE( pElemTypeDescr );
diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx
index 91442274bde5..f243d789ee01 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -196,7 +196,7 @@ Any IdlCompFieldImpl::get( const Any & rObj )
TYPELIB_DANGER_RELEASE( pObjTD );
}
throw IllegalArgumentException(
- OUString("illegal object given!"),
+ "illegal object given!",
(XWeak *)(OWeakObject *)this, 0 );
}
@@ -225,14 +225,14 @@ void IdlCompFieldImpl::set( const Any & rObj, const Any & rValue )
else
{
throw IllegalArgumentException(
- OUString("illegal value given!"),
+ "illegal value given!",
(XWeak *)(OWeakObject *)this, 1 );
}
}
TYPELIB_DANGER_RELEASE( pObjTD );
}
throw IllegalArgumentException(
- OUString("illegal object given!"),
+ "illegal object given!",
(XWeak *)(OWeakObject *)this, 0 );
}
@@ -262,14 +262,14 @@ void IdlCompFieldImpl::set( Any & rObj, const Any & rValue )
else
{
throw IllegalArgumentException(
- OUString("illegal value given!"),
+ "illegal value given!",
(XWeak *)(OWeakObject *)this, 1 );
}
}
TYPELIB_DANGER_RELEASE( pObjTD );
}
throw IllegalArgumentException(
- OUString("illegal object given!"),
+ "illegal object given!",
(XWeak *)(OWeakObject *)this, 0 );
}
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index 66ad8c703fcf..87c4e8633f23 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -353,7 +353,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forType( typelib_TypeDescriptio
return xRet;
}
throw RuntimeException(
- OUString( "IdlReflectionServiceImpl::forType() failed!" ),
+ "IdlReflectionServiceImpl::forType() failed!",
(XWeak *)(OWeakObject *)this );
}
@@ -373,7 +373,7 @@ const Mapping & IdlReflectionServiceImpl::getCpp2Uno()
if (! _aCpp2Uno.is())
{
throw RuntimeException(
- OUString("cannot get c++ to uno mapping!"),
+ "cannot get c++ to uno mapping!",
(XWeak *)(OWeakObject *)this );
}
}
@@ -396,7 +396,7 @@ const Mapping & IdlReflectionServiceImpl::getUno2Cpp()
if (! _aUno2Cpp.is())
{
throw RuntimeException(
- OUString("cannot get uno to c++ mapping!"),
+ "cannot get uno to c++ mapping!",
(XWeak *)(OWeakObject *)this );
}
}
@@ -413,7 +413,7 @@ uno_Interface * IdlReflectionServiceImpl::mapToUno(
return (uno_Interface *)getCpp2Uno().mapInterface( xObj.get(), pTo );
throw RuntimeException(
- OUString("illegal object given!"),
+ "illegal object given!",
(XWeak *)(OWeakObject *)this );
}
diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx
index d55893cdc3e9..31e8e90c7e82 100644
--- a/stoc/source/corereflection/crenum.cxx
+++ b/stoc/source/corereflection/crenum.cxx
@@ -153,7 +153,7 @@ void IdlEnumFieldImpl::set( const Any &, const Any & )
throw(css::lang::IllegalArgumentException, css::lang::IllegalAccessException, css::uno::RuntimeException, std::exception)
{
throw IllegalAccessException(
- OUString("enum field is constant!"),
+ "enum field is constant!",
(XWeak *)(OWeakObject *)this );
}
@@ -161,7 +161,7 @@ void IdlEnumFieldImpl::set( Any &, const Any & )
throw(css::lang::IllegalArgumentException, css::lang::IllegalAccessException, css::uno::RuntimeException, std::exception)
{
throw IllegalAccessException(
- OUString("enum field is constant!"),
+ "enum field is constant!",
(XWeak *)(OWeakObject *)this );
}
diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx
index b23fc2738fcf..84fe1c0c8879 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -199,7 +199,7 @@ Any IdlAttributeFieldImpl::get( const Any & rObj )
return aRet;
}
throw IllegalArgumentException(
- OUString("illegal object given!"),
+ "illegal object given!",
(XWeak *)(OWeakObject *)this, 0 );
}
@@ -209,7 +209,7 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
if (getAttributeTypeDescr()->bReadOnly)
{
throw IllegalAccessException(
- OUString("cannot set readonly attribute!"),
+ "cannot set readonly attribute!",
(XWeak *)(OWeakObject *)this );
}
@@ -285,11 +285,11 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
(*pUnoI->release)( pUnoI );
throw IllegalArgumentException(
- OUString("illegal value given!"),
+ "illegal value given!",
*(const Reference< XInterface > *)rObj.getValue(), 1 );
}
throw IllegalArgumentException(
- OUString("illegal destination object given!"),
+ "illegal destination object given!",
(XWeak *)(OWeakObject *)this, 0 );
}
@@ -315,9 +315,8 @@ void IdlAttributeFieldImpl::checkException(
cppu::throwException(e);
} else {
throw WrappedTargetRuntimeException(
- OUString(
- "non-RuntimeException occurred when accessing an"
- " interface type attribute"),
+ "non-RuntimeException occurred when accessing an"
+ " interface type attribute",
context, e);
}
}
@@ -607,7 +606,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
{
(*pUnoI->release)( pUnoI );
throw IllegalArgumentException(
- OUString("arguments len differ!"),
+ "arguments len differ!",
*(const Reference< XInterface > *)rObj.getValue(), 1 );
}
@@ -681,7 +680,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
if (! bAssign)
{
IllegalArgumentException aExc(
- OUString("cannot coerce argument type during corereflection call!"),
+ "cannot coerce argument type during corereflection call!",
*(const Reference< XInterface > *)rObj.getValue(), (sal_Int16)nPos );
// cleanup
@@ -758,7 +757,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
return aRet;
}
throw IllegalArgumentException(
- OUString("illegal destination object given!"),
+ "illegal destination object given!",
(XWeak *)(OWeakObject *)this, 0 );
}
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index a3aaee6f7eaf..cd065fd4dcfe 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -625,7 +625,7 @@ void SAL_CALL OServiceManagerWrapper::setPropertyValue(
else
{
throw IllegalArgumentException(
- OUString("no XComponentContext given!"),
+ "no XComponentContext given!",
(OWeakObject *)this, 1 );
}
}
@@ -788,7 +788,7 @@ void OServiceManager::setPropertyValue(
else
{
throw IllegalArgumentException(
- OUString("no XComponentContext given!"),
+ "no XComponentContext given!",
(OWeakObject *)this, 1 );
}
}
@@ -1187,7 +1187,7 @@ void OServiceManager::insert( const Any & Element )
if( Element.getValueTypeClass() != TypeClass_INTERFACE )
{
throw IllegalArgumentException(
- OUString("no interface given!"),
+ "no interface given!",
Reference< XInterface >(), 0 );
}
Reference<XInterface > xEle( Element, UNO_QUERY_THROW );
@@ -1265,8 +1265,7 @@ void OServiceManager::remove( const Any & Element )
else
{
throw IllegalArgumentException(
- OUString(
- "neither interface nor string given!"),
+ "neither interface nor string given!",
Reference< XInterface >(), 0 );
}
@@ -1280,7 +1279,7 @@ void OServiceManager::remove( const Any & Element )
if( aIt == m_ImplementationMap.end() )
{
throw NoSuchElementException(
- OUString("element is not in!"),
+ "element is not in!",
static_cast< OWeakObject * >(this) );
}
//First remove all factories which have been loaded by ORegistryServiceManager.
diff --git a/stoc/source/typeconv/convert.cxx b/stoc/source/typeconv/convert.cxx
index b11260fd856d..b2b7e0e2925e 100644
--- a/stoc/source/typeconv/convert.cxx
+++ b/stoc/source/typeconv/convert.cxx
@@ -358,7 +358,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6
return nRet;
}
throw CannotConvertException(
- OUString("UNSIGNED HYPER out of range!"),
+ "UNSIGNED HYPER out of range!",
Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 );
}
@@ -372,7 +372,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6
return nRet;
}
throw CannotConvertException(
- OUString("FLOAT out of range!"),
+ "FLOAT out of range!",
Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 );
}
case TypeClass_DOUBLE:
@@ -384,7 +384,7 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6
return nRet;
}
throw CannotConvertException(
- OUString("DOUBLE out of range!"),
+ "DOUBLE out of range!",
Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 );
}
@@ -395,27 +395,27 @@ sal_Int64 TypeConverter_Impl::toHyper( const Any& rAny, sal_Int64 min, sal_uInt6
if (! getHyperValue( fVal, *(OUString const *)rAny.getValue() ))
{
throw CannotConvertException(
- OUString("invalid STRING value!"),
+ "invalid STRING value!",
Reference<XInterface>(), aDestinationClass, FailReason::IS_NOT_NUMBER, 0 );
}
nRet = (fVal > SAL_INT64_MAX ? (sal_Int64)(sal_uInt64)fVal : (sal_Int64)fVal);
if (fVal >= min && (fVal < 0 || ((sal_uInt64)fVal) <= max))
return nRet;
throw CannotConvertException(
- OUString("STRING value out of range!"),
+ "STRING value out of range!",
Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 );
}
default:
throw CannotConvertException(
- OUString("TYPE is not supported!"),
+ "TYPE is not supported!",
Reference<XInterface>(), aDestinationClass, FailReason::TYPE_NOT_SUPPORTED, 0 );
}
if (nRet >= min && (nRet < 0 || (sal_uInt64)nRet <= max))
return nRet;
throw CannotConvertException(
- OUString("VALUE is out of range!"),
+ "VALUE is out of range!",
Reference<XInterface>(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 );
}
@@ -481,7 +481,7 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max ) c
if (! getNumericValue( fRet, *(OUString *)rAny.getValue() ))
{
throw CannotConvertException(
- OUString("invalid STRING value!"),
+ "invalid STRING value!",
Reference<XInterface>(), aDestinationClass, FailReason::IS_NOT_NUMBER, 0 );
}
break;
@@ -489,14 +489,14 @@ double TypeConverter_Impl::toDouble( const Any& rAny, double min, double max ) c
default:
throw CannotConvertException(
- OUString("TYPE is not supported!"),
+ "TYPE is not supported!",
Reference< XInterface >(), aDestinationClass, FailReason::TYPE_NOT_SUPPORTED, 0 );
}
if (fRet >= min && fRet <= max)
return fRet;
throw CannotConvertException(
- OUString("VALUE is out of range!"),
+ "VALUE is out of range!",
Reference< XInterface >(), aDestinationClass, FailReason::OUT_OF_RANGE, 0 );
}
@@ -537,7 +537,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy
else
{
throw CannotConvertException(
- OUString("value is not of same or derived type!"),
+ "value is not of same or derived type!",
Reference< XInterface >(), aDestinationClass,
FailReason::SOURCE_IS_NO_DERIVED_TYPE, 0 );
}
@@ -558,14 +558,14 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy
!*(XInterface * const *)rVal.getValue())
{
throw CannotConvertException(
- OUString("value is no interface!"),
+ "value is no interface!",
Reference< XInterface >(), aDestinationClass, FailReason::NO_SUCH_INTERFACE, 0 );
}
if (! (aRet = (*(XInterface * const *)rVal.getValue())->queryInterface(
aDestType )).hasValue())
{
throw CannotConvertException(
- OUString("value has no such interface!"),
+ "value has no such interface!",
Reference< XInterface >(), aDestinationClass, FailReason::NO_SUCH_INTERFACE, 0 );
}
break;
@@ -668,7 +668,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy
else
{
throw CannotConvertException(
- OUString("value cannot be converted to demanded ENUM!"),
+ "value cannot be converted to demanded ENUM!",
Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_ENUM, 0 );
}
break;
@@ -690,7 +690,7 @@ Any SAL_CALL TypeConverter_Impl::convertTo( const Any& rVal, const Type& aDestTy
return aRet;
throw CannotConvertException(
- OUString("conversion not possible!"),
+ "conversion not possible!",
Reference< XInterface >(), aDestinationClass, FailReason::INVALID, 0 );
}
@@ -719,7 +719,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
default:
throw IllegalArgumentException(
- OUString("destination type is not simple!"),
+ "destination type is not simple!",
Reference< XInterface >(), (sal_Int16) 1 );
}
@@ -769,7 +769,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
else
{
throw CannotConvertException(
- OUString("STRING has no boolean value!"),
+ "STRING has no boolean value!",
Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_BOOL, 0 );
}
}
@@ -852,7 +852,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
else
{
throw CannotConvertException(
- OUString("value is not ENUM!"),
+ "value is not ENUM!",
Reference< XInterface >(), aDestinationClass, FailReason::IS_NOT_ENUM, 0 );
}
break;
@@ -904,7 +904,7 @@ Any TypeConverter_Impl::convertToSimpleType( const Any& rVal, TypeClass aDestina
return aRet;
throw CannotConvertException(
- OUString("conversion not possible!"),
+ "conversion not possible!",
Reference< XInterface >(), aDestinationClass, FailReason::INVALID, 0 );
}
}