summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-21 22:16:42 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-04-20 23:40:52 +0200
commit690d078f2b91d769f31e048b8a1d523af18e6d11 (patch)
tree2202e2894c0d3ff19bc103cd3117a13049786237
parent92e82b76e713dc0f5421890f9010678af5b54ec2 (diff)
Comparison between css::uno::WeakReference and css::uno::Reference
...causes overload resolution ambiguity in C++20, as observed with recent Clang 10 trunk with -std=c++2a: > sd/source/ui/framework/factories/BasicPaneFactory.cxx:327:39: error: use of overloaded operator '==' is ambiguous (with operand types 'css::uno::WeakReference<css::drawing::framework::XConfigurationController>' and 'const ::css::uno::Reference< ::css::uno::XInterface>') > if (mxConfigurationControllerWeak == rEventObject.Source) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~ > include/com/sun/star/uno/Reference.hxx:425:28: note: candidate function (with reversed parameter order) > inline bool BaseReference::operator == ( const BaseReference & rRef ) const > ^ > include/cppuhelper/weakref.hxx:106:19: note: candidate function > bool SAL_CALL operator == ( const WeakReferenceHelper & rObj ) const An alternative would be to add overloads for combinations of css::uno::WeakReference adn css::uno::Reference, but this was the only case of such an ambiguity across the whole code base, such just resolve it with an explicit .get(). Change-Id: I4689d5ffd4f8993cc1f9401d3c21b24f53f21ccd Reviewed-on: https://gerrit.libreoffice.org/81282 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 0c3e90d95c2c952265625bcff590599627114ec1)
-rw-r--r--sd/source/ui/framework/factories/BasicPaneFactory.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index 432b459087b4..00974ce725a0 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -330,7 +330,7 @@ void SAL_CALL BasicPaneFactory::notifyConfigurationChange (
void SAL_CALL BasicPaneFactory::disposing (
const lang::EventObject& rEventObject)
{
- if (mxConfigurationControllerWeak == rEventObject.Source)
+ if (mxConfigurationControllerWeak.get() == rEventObject.Source)
{
mxConfigurationControllerWeak.clear();
}