summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-07-08 10:36:04 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-07-09 05:46:19 +0200
commit493b8ab997d543cb133d3896559f4a733186d659 (patch)
tree6373eb49ef38667ffc17ea9a6889a97fcae87b5e /dbaccess
parent6a54d08e6e52623f9769d17d7ea7390052cb275b (diff)
Simplify comphelper::query_aggregation
Change-Id: Id673c27e21c6706367f2effc92bbea61c83a5482 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170133 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/api/RowSet.cxx18
1 files changed, 3 insertions, 15 deletions
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<XEventListener> xEvt;
- query_aggregation(this,xEvt);
- xComponent->removeEventListener(xEvt);
- }
+ xComponent->removeEventListener(query_aggregation<XEventListener>(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<XEventListener> xListener;
- query_aggregation(this, xListener);
- xComponent->removeEventListener(xListener);
- }
+ xComponent->removeEventListener(query_aggregation<XEventListener>(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<XEventListener> xListener;
- query_aggregation(this, xListener);
- xComponent->addEventListener(xListener);
- }
+ xComponent->addEventListener(query_aggregation<XEventListener>(this));
}
// css::XEventListener