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>
This commit is contained in:
Mike Kaganski 2023-04-23 20:13:01 +03:00
parent 7e3ddf1e5a
commit c19c775c0b
2 changed files with 13 additions and 13 deletions

View file

@ -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());
}
}

View file

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