diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-09 15:52:14 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-10 09:16:53 +0100 |
commit | e3560f4770487c8d38463fb4a9a63325abc385f9 (patch) | |
tree | cc2ea6d5d18de966e4677ebfd846c1bf5ec5c216 /include | |
parent | 77e3cb338f576757fd875bc60952ac22530f6a7a (diff) |
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 <mike.kaganski@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/dbaccess/genericcontroller.hxx | 41 |
1 files changed, 5 insertions, 36 deletions
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<base_type const&>(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<bool> bChecked; + boost::optional<bool> bInvisible; css::uno::Any aValue; - optional< OUString > sTitle; + boost::optional<OUString> sTitle; FeatureState() : bEnabled(false) { } }; |