summaryrefslogtreecommitdiff
path: root/include/comphelper/servicehelper.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-16 23:02:08 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-19 12:57:29 +0000
commit4d6c23216559eb48f9943bb49d6e475a6d64ba15 (patch)
tree99a907237afacf57a9016b185cda8cdb25e071c1 /include/comphelper/servicehelper.hxx
parent1e4709f47dec87d5d2b66f3de222588c3babaf18 (diff)
loplugin:unocast (oox::ForumlaImExportBase)
(See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) Change-Id: I11bc363447c44319bc47f7eebb7084f64ea85511 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144400 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/comphelper/servicehelper.hxx')
-rw-r--r--include/comphelper/servicehelper.hxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/comphelper/servicehelper.hxx b/include/comphelper/servicehelper.hxx
index 1d157cbf1482..286108bd2568 100644
--- a/include/comphelper/servicehelper.hxx
+++ b/include/comphelper/servicehelper.hxx
@@ -137,6 +137,26 @@ namespace comphelper {
return FallbackToGetSomethingOf<Base>::get(rId, pThis);
}
+#if defined _MSC_VER && _MSC_VER < 1930 && !defined __clang__
+ // Without this additional overload, at least VS 2019 16.11.21 has sometimes issues deducing the
+ // Base template argument in calls to the "full" getSomethingImpl overload with zero arguments
+ // substituted for the variadic Mixins parameter:
+ template <class T, class Mixin, class Base>
+ sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis,
+ MixinToGetSomethingOf<Mixin>,
+ FallbackToGetSomethingOf<Base>)
+ {
+ sal_Int64 res;
+ if (MixinToGetSomethingOf<T>::get(rId, pThis, &res)
+ || MixinToGetSomethingOf<Mixin>::get(rId, pThis, &res))
+ {
+ return res;
+ }
+
+ return FallbackToGetSomethingOf<Base>::get(rId, pThis);
+ }
+#endif
+
template <class T, class Mixin, class... Mixins, class Base>
sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis,
MixinToGetSomethingOf<Mixin>, MixinToGetSomethingOf<Mixins>...,