From 493b8ab997d543cb133d3896559f4a733186d659 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 8 Jul 2024 10:36:04 +0500 Subject: Simplify comphelper::query_aggregation Change-Id: Id673c27e21c6706367f2effc92bbea61c83a5482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170133 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- dbaccess/source/core/api/RowSet.cxx | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'dbaccess') diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 609ebc36ce95..46c4984f7439 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -461,11 +461,7 @@ void SAL_CALL ORowSet::disposing() // remove myself as dispose listener Reference< XComponent > xComponent(m_xActiveConnection, UNO_QUERY); if (xComponent.is()) - { - Reference xEvt; - query_aggregation(this,xEvt); - xComponent->removeEventListener(xEvt); - } + xComponent->removeEventListener(query_aggregation(this)); m_aActiveConnection = Any(); // the any contains a reference too if(m_bOwnConnection) @@ -546,11 +542,7 @@ void ORowSet::setActiveConnection( Reference< XConnection > const & _rxNewConn, // remove the event listener for the old connection Reference< XComponent > xComponent(m_xActiveConnection, UNO_QUERY); if (xComponent.is()) - { - Reference xListener; - query_aggregation(this, xListener); - xComponent->removeEventListener(xListener); - } + xComponent->removeEventListener(query_aggregation(this)); // if we owned the connection, remember it for later disposing if(m_bOwnConnection) @@ -575,11 +567,7 @@ void ORowSet::setActiveConnection( Reference< XConnection > const & _rxNewConn, // register as event listener for the new connection xComponent.set(m_xActiveConnection,UNO_QUERY); if (xComponent.is()) - { - Reference xListener; - query_aggregation(this, xListener); - xComponent->addEventListener(xListener); - } + xComponent->addEventListener(query_aggregation(this)); } // css::XEventListener -- cgit v1.2.3