From a361231b1363d072d737e9b1d411b71aa9550d84 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 10 May 2019 10:13:12 +0200 Subject: fix wrong SET/QUERY flags passed to uno::Reference By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/com/sun/star/uno/Reference.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/com/sun') diff --git a/include/com/sun/star/uno/Reference.h b/include/com/sun/star/uno/Reference.h index 6b4977e88518..d0e415e808d5 100644 --- a/include/com/sun/star/uno/Reference.h +++ b/include/com/sun/star/uno/Reference.h @@ -370,6 +370,12 @@ public: to other constructors */ inline Reference( const BaseReference & rRef, UnoReference_QueryThrow dummy ); +#ifdef LIBO_INTERNAL_ONLY + /** + Prevent code from calling the QUERY_THROW constructor, when they meant to use the SET_THROW constructor. + */ + Reference( const Reference< interface_type > & rRef, UnoReference_QueryThrow dummy ) = delete; +#endif /** Constructor: Queries given interface for reference interface type (interface_type). Throws a RuntimeException if the demanded interface cannot be queried. @@ -520,6 +526,12 @@ public: to set methods */ inline void SAL_CALL set( const BaseReference & rRef, UnoReference_QueryThrow dummy ); +#ifdef LIBO_INTERNAL_ONLY + /** + Prevent code from calling the QUERY_THROW version, when they meant to use the SET_THROW version. + */ + void set( const Reference< interface_type > & rRef, UnoReference_QueryThrow dummy ) = delete; +#endif /** Queries given any for reference interface type (interface_type) and sets it. An interface already set will be released. -- cgit