summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-10-21 22:16:42 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-10-22 07:19:17 +0200
commit0c3e90d95c2c952265625bcff590599627114ec1 (patch)
treed1a06156b98af9f4cb42237176c87269dce86486
parent41147e20029c80c4941ca81bc5dca3782bef5d94 (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>
-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 2754b71d369f..e34b471f8b2a 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -324,7 +324,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();
}