summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/comphelper/uno3.hxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/comphelper/uno3.hxx b/include/comphelper/uno3.hxx
index 517398fd757e..757823d68465 100644
--- a/include/comphelper/uno3.hxx
+++ b/include/comphelper/uno3.hxx
@@ -161,6 +161,19 @@ namespace comphelper
}
return _rxOut.is();
}
+
+ /** ask for an iface of an aggregated object
+ usage:<br/>
+ if (auto xFoo = query_aggregation<XFoo>(xAggregatedObject))<br/>
+ ...
+ */
+ template <class iface>
+ css::uno::Reference<iface> query_aggregation(const css::uno::Reference< css::uno::XAggregation >& _rxAggregate)
+ {
+ css::uno::Reference<iface> _rxOut;
+ query_aggregation(_rxAggregate, _rxOut);
+ return _rxOut;
+ }
} // namespace comphelper