From e3560f4770487c8d38463fb4a9a63325abc385f9 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Fri, 9 Nov 2018 15:52:14 +0300 Subject: Replace deprecated boost::optional::reset(val) with operator = Change-Id: I7340a561e0df0c781fd834388deb4b9f83800f9b Reviewed-on: https://gerrit.libreoffice.org/63221 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/dbaccess/genericcontroller.hxx | 41 +++++----------------------------- 1 file changed, 5 insertions(+), 36 deletions(-) (limited to 'include/dbaccess') diff --git a/include/dbaccess/genericcontroller.hxx b/include/dbaccess/genericcontroller.hxx index 4f97727acc9b..139d6fdd6838 100644 --- a/include/dbaccess/genericcontroller.hxx +++ b/include/dbaccess/genericcontroller.hxx @@ -97,45 +97,14 @@ namespace dbaui { class ODataView; - - // = optional - - /** convenience wrapper around boost::optional, allowing typed assignments - */ - template < typename T > - class optional : public ::boost::optional< T > - { - typedef ::boost::optional< T > base_type; - - public: - optional ( ) : base_type( ) { } - explicit optional ( T const& val ) : base_type( val ) { } - optional ( optional const& rhs ) : base_type( static_cast(rhs) ) { } - - public: - optional& operator= ( T const& rhs ) - { - base_type::reset( rhs ); - return *this; - } - optional& operator= ( optional< T > const& rhs ) - { - if ( rhs.is_initialized() ) - base_type::reset( rhs.get() ); - else - base_type::reset(); - return *this; - } - }; - template< typename T > - inline bool SAL_CALL operator >>= ( const css::uno::Any & _any, optional< T >& _value ) + inline bool SAL_CALL operator >>= (const css::uno::Any& _any, boost::optional< T >& _value) { _value.reset(); // de-init the optional value T directValue = T(); if ( _any >>= directValue ) - _value.reset( directValue ); + _value = directValue; return !!_value; } @@ -153,10 +122,10 @@ namespace dbaui { bool bEnabled; - optional< bool > bChecked; - optional< bool > bInvisible; + boost::optional bChecked; + boost::optional bInvisible; css::uno::Any aValue; - optional< OUString > sTitle; + boost::optional sTitle; FeatureState() : bEnabled(false) { } }; -- cgit