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);