diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-04-23 20:13:01 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-05-28 09:06:11 +0200 |
commit | c19c775c0b54e797b4b7a30f9acf6a34efeaacca (patch) | |
tree | da1f4d83acf4734ff539fb8421f0af32d9e45615 /binaryurp | |
parent | 7e3ddf1e5aae5e4e956495e3d86a8cbf6e251b5e (diff) |
Use getXWeak in binaryurp
Change-Id: If1891fc180126aa5d5ac92772cbca9b485619f46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150836
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'binaryurp')
-rw-r--r-- | binaryurp/source/bridge.cxx | 16 | ||||
-rw-r--r-- | binaryurp/source/bridgefactory.cxx | 10 |
2 files changed, 13 insertions, 13 deletions
diff --git a/binaryurp/source/bridge.cxx b/binaryurp/source/bridge.cxx index 7d73d6dd7b00..523bbbf14ac5 100644 --- a/binaryurp/source/bridge.cxx +++ b/binaryurp/source/bridge.cxx @@ -332,7 +332,7 @@ void Bridge::terminate(bool final) { try { listener->disposing( css::lang::EventObject( - static_cast< cppu::OWeakObject * >(this))); + getXWeak())); } catch (const css::uno::RuntimeException & e) { SAL_WARN("binaryurp", "caught " << e); } @@ -612,7 +612,7 @@ bool Bridge::makeCall( { throw css::lang::DisposedException( "Binary URP bridge disposed during call", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } *returnValue = resp->returnValue; if (!resp->exception) { @@ -675,7 +675,7 @@ void Bridge::handleRequestChangeReply( if (n != exp) { throw css::uno::RuntimeException( "URP: requestChange reply with unexpected return value received", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } decrementCalls(); switch (exp) { @@ -758,7 +758,7 @@ void Bridge::handleRequestChangeRequest( default: throw css::uno::RuntimeException( "URP: unexpected requestChange request received", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } } @@ -809,7 +809,7 @@ void Bridge::handleCommitChangeRequest( default: throw css::uno::RuntimeException( "URP: unexpected commitChange request received", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } } @@ -854,7 +854,7 @@ css::uno::Reference< css::uno::XInterface > Bridge::getInstance( if (sInstanceName.isEmpty()) { throw css::uno::RuntimeException( "XBridge::getInstance sInstanceName must be non-empty", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } for (sal_Int32 i = 0; i != sInstanceName.getLength(); ++i) { if (sInstanceName[i] > 0x7F) { @@ -935,7 +935,7 @@ void Bridge::addEventListener( } } xListener->disposing( - css::lang::EventObject(static_cast< cppu::OWeakObject * >(this))); + css::lang::EventObject(getXWeak())); } void Bridge::removeEventListener( @@ -1045,7 +1045,7 @@ void Bridge::checkDisposed() { if (state_ != STATE_STARTED) { throw css::lang::DisposedException( "Binary URP bridge already disposed", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } } diff --git a/binaryurp/source/bridgefactory.cxx b/binaryurp/source/bridgefactory.cxx index a2dd1fa97fba..835c264a9d92 100644 --- a/binaryurp/source/bridgefactory.cxx +++ b/binaryurp/source/bridgefactory.cxx @@ -93,17 +93,17 @@ css::uno::Reference< css::bridge::XBridge > BridgeFactory::createBridge( if (rBHelper.bDisposed) { throw css::lang::DisposedException( "BridgeFactory disposed", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } if (named_.find(sName) != named_.end()) { throw css::bridge::BridgeExistsException( - sName, static_cast< cppu::OWeakObject * >(this)); + sName, getXWeak()); } if (sProtocol != "urp" || !aConnection.is()) { throw css::lang::IllegalArgumentException( ("BridgeFactory::createBridge: sProtocol != urp ||" " aConnection == null"), - static_cast< cppu::OWeakObject * >(this), -1); + getXWeak(), -1); } b.set(new Bridge(this, sName, aConnection, anInstanceProvider)); if (sName.isEmpty()) { @@ -131,13 +131,13 @@ BridgeFactory::getExistingBridges() { if (unnamed_.size() > SAL_MAX_INT32) { throw css::uno::RuntimeException( "BridgeFactory::getExistingBridges: too many", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } sal_Int32 n = static_cast< sal_Int32 >(unnamed_.size()); if (named_.size() > o3tl::make_unsigned(SAL_MAX_INT32 - n)) { throw css::uno::RuntimeException( "BridgeFactory::getExistingBridges: too many", - static_cast< cppu::OWeakObject * >(this)); + getXWeak()); } n = static_cast< sal_Int32 >(n + named_.size()); css::uno::Sequence< css::uno::Reference< css::bridge::XBridge > > s(n); |