summaryrefslogtreecommitdiff
path: root/stoc/source/corereflection
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-04-23 20:14:54 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-06-18 11:10:20 +0200
commit0c2b2c9babfd781e0d9d68bb2a14a045b0c6ec4c (patch)
treefef431f10266f60a7941b71315b66932a29e568f /stoc/source/corereflection
parent627984834cffbe6d1afce8b2be91277c221525b8 (diff)
Use getXWeak in stoc
Change-Id: Icd694eeae002ab28cbd06ba3097e9039e299de3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150871 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'stoc/source/corereflection')
-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.cxx8
5 files changed, 23 insertions, 23 deletions
diff --git a/stoc/source/corereflection/crarray.cxx b/stoc/source/corereflection/crarray.cxx
index ca8d159ef721..67be31e1ac93 100644
--- a/stoc/source/corereflection/crarray.cxx
+++ b/stoc/source/corereflection/crarray.cxx
@@ -40,13 +40,13 @@ void ArrayIdlClassImpl::realloc( Any & rArray, sal_Int32 nLen )
{
throw IllegalArgumentException(
"expected sequence, but found " + rArray.getValueType().getTypeName(),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
if (nLen < 0)
{
throw IllegalArgumentException(
"negative length given!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 1 );
+ getXWeak(), 1 );
}
uno_Sequence ** ppSeq = const_cast<uno_Sequence **>(static_cast<uno_Sequence * const *>(rArray.getValue()));
@@ -64,7 +64,7 @@ sal_Int32 ArrayIdlClassImpl::getLen( const Any & rArray )
{
throw IllegalArgumentException(
"expected sequence, but found " + rArray.getValueType().getTypeName(),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
return (*static_cast<uno_Sequence * const *>(rArray.getValue()))->nElements;
@@ -77,7 +77,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 nIndex )
{
throw IllegalArgumentException(
"expected sequence, but found " + rArray.getValueType().getTypeName(),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
uno_Sequence * pSeq = *static_cast<uno_Sequence * const *>(rArray.getValue());
@@ -85,7 +85,7 @@ Any ArrayIdlClassImpl::get( const Any & rArray, sal_Int32 nIndex )
{
throw ArrayIndexOutOfBoundsException(
"illegal index given, index " + OUString::number(nIndex) + " is < " + OUString::number(pSeq->nElements),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
Any aRet;
@@ -107,7 +107,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
{
throw IllegalArgumentException(
"expected sequence, but found " + rArray.getValueType().getTypeName(),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
uno_Sequence * pSeq = *static_cast<uno_Sequence * const *>(rArray.getValue());
@@ -115,7 +115,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
{
throw ArrayIndexOutOfBoundsException(
"illegal index given, index " + OUString::number(nIndex) + " is < " + OUString::number(pSeq->nElements),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
uno_Sequence ** ppSeq = const_cast<uno_Sequence **>(static_cast<uno_Sequence * const *>(rArray.getValue()));
@@ -135,7 +135,7 @@ void ArrayIdlClassImpl::set( Any & rArray, sal_Int32 nIndex, const Any & rNewVal
TYPELIB_DANGER_RELEASE( pElemTypeDescr );
throw IllegalArgumentException(
"sequence element is not assignable by given value!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 2 );
+ getXWeak(), 2 );
}
TYPELIB_DANGER_RELEASE( pElemTypeDescr );
}
diff --git a/stoc/source/corereflection/crcomp.cxx b/stoc/source/corereflection/crcomp.cxx
index 990e5a63aa1a..b1143e158b09 100644
--- a/stoc/source/corereflection/crcomp.cxx
+++ b/stoc/source/corereflection/crcomp.cxx
@@ -137,7 +137,7 @@ Any IdlCompFieldImpl::get( const Any & rObj )
}
throw IllegalArgumentException(
"expected struct or exception, got " + rObj.getValueType().getTypeName(),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
void IdlCompFieldImpl::set( const Any & rObj, const Any & rValue )
@@ -161,7 +161,7 @@ void IdlCompFieldImpl::set( const Any & rObj, const Any & rValue )
{
throw IllegalArgumentException(
"cannot assign value to destination",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 1 );
+ getXWeak(), 1 );
}
return;
}
@@ -169,7 +169,7 @@ void IdlCompFieldImpl::set( const Any & rObj, const Any & rValue )
}
throw IllegalArgumentException(
"expected struct or exception, got " + rObj.getValueType().getTypeName(),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
@@ -194,7 +194,7 @@ void IdlCompFieldImpl::set( Any & rObj, const Any & rValue )
{
throw IllegalArgumentException(
"cannot assign to destination",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 1 );
+ getXWeak(), 1 );
}
return;
}
@@ -202,7 +202,7 @@ void IdlCompFieldImpl::set( Any & rObj, const Any & rValue )
}
throw IllegalArgumentException(
"expected struct or exception, got " + rObj.getValueType().getTypeName(),
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
diff --git a/stoc/source/corereflection/crefl.cxx b/stoc/source/corereflection/crefl.cxx
index 4f396065b478..5fb675a03a4b 100644
--- a/stoc/source/corereflection/crefl.cxx
+++ b/stoc/source/corereflection/crefl.cxx
@@ -264,7 +264,7 @@ Reference< XIdlClass > IdlReflectionServiceImpl::forType( typelib_TypeDescriptio
}
throw RuntimeException(
"IdlReflectionServiceImpl::forType() failed!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
@@ -281,7 +281,7 @@ const Mapping & IdlReflectionServiceImpl::getCpp2Uno()
{
throw RuntimeException(
"cannot get c++ to uno mapping!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
}
}
@@ -301,7 +301,7 @@ const Mapping & IdlReflectionServiceImpl::getUno2Cpp()
{
throw RuntimeException(
"cannot get uno to c++ mapping!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
}
}
@@ -317,7 +317,7 @@ uno_Interface * IdlReflectionServiceImpl::mapToUno(
throw RuntimeException(
"illegal object given!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
}
diff --git a/stoc/source/corereflection/crenum.cxx b/stoc/source/corereflection/crenum.cxx
index f61ab565609a..2cb07c9b5ec8 100644
--- a/stoc/source/corereflection/crenum.cxx
+++ b/stoc/source/corereflection/crenum.cxx
@@ -92,14 +92,14 @@ void IdlEnumFieldImpl::set( const Any &, const Any & )
{
throw IllegalAccessException(
"cannot set enum field, it is constant",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
void IdlEnumFieldImpl::set( Any &, const Any & )
{
throw IllegalAccessException(
"cannot set enum field, it is constant",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx
index 612b87106f3b..458c7c3693a7 100644
--- a/stoc/source/corereflection/criface.cxx
+++ b/stoc/source/corereflection/criface.cxx
@@ -151,7 +151,7 @@ Any IdlAttributeFieldImpl::get( const Any & rObj )
}
throw IllegalArgumentException(
"illegal object given!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
@@ -160,7 +160,7 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
{
throw IllegalAccessException(
"cannot set readonly attribute!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)) );
+ getXWeak() );
}
uno_Interface * pUnoI = getReflection()->mapToUno(
@@ -237,7 +237,7 @@ void IdlAttributeFieldImpl::set( Any & rObj, const Any & rValue )
}
throw IllegalArgumentException(
"illegal destination object given!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}
void IdlAttributeFieldImpl::set( const Any & rObj, const Any & rValue )
@@ -644,7 +644,7 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > &
}
throw IllegalArgumentException(
"illegal destination object given!",
- static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 );
+ getXWeak(), 0 );
}