diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-11-04 07:25:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-04 09:07:32 +0100 |
commit | a373a7c1705b9abc5551388998131dacc4698642 (patch) | |
tree | 420000807fcdd0045f890bd24134aa9afe6fc088 /comphelper | |
parent | 70833f9f9dd6133f0517623ad90dcead5077e6e3 (diff) |
remove pimpl in PropertyBag
Change-Id: Ibf34c0d9a3090c190a63f63ba9bd661263aebae6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105276
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/property/propertybag.cxx | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/comphelper/source/property/propertybag.cxx b/comphelper/source/property/propertybag.cxx index ac8fc17ff1b7..de230f470150 100644 --- a/comphelper/source/property/propertybag.cxx +++ b/comphelper/source/property/propertybag.cxx @@ -48,16 +48,8 @@ namespace comphelper namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute; - typedef std::map< sal_Int32, Any > MapInt2Any; - struct PropertyBag_Impl - { - PropertyBag_Impl() : m_bAllowEmptyPropertyName(false) { } - MapInt2Any aDefaults; - bool m_bAllowEmptyPropertyName; - }; - PropertyBag::PropertyBag() - :m_pImpl( new PropertyBag_Impl ) + : m_bAllowEmptyPropertyName(false) { } @@ -68,7 +60,7 @@ namespace comphelper void PropertyBag::setAllowEmptyPropertyName( bool i_isAllowed ) { - m_pImpl->m_bAllowEmptyPropertyName = i_isAllowed; + m_bAllowEmptyPropertyName = i_isAllowed; } @@ -117,7 +109,7 @@ namespace comphelper ); // check name/handle sanity - lcl_checkForEmptyName( m_pImpl->m_bAllowEmptyPropertyName, _rName ); + lcl_checkForEmptyName( m_bAllowEmptyPropertyName, _rName ); lcl_checkNameAndHandle_ElementExistException( _rName, _nHandle, *this ); // register the property @@ -125,7 +117,7 @@ namespace comphelper registerPropertyNoMember( _rName, _nHandle, _nAttributes | PropertyAttribute::MAYBEVOID, _rType, css::uno::Any() ); // remember the default - m_pImpl->aDefaults.emplace( _nHandle, Any() ); + aDefaults.emplace( _nHandle, Any() ); } @@ -140,7 +132,7 @@ namespace comphelper nullptr ); // check name/handle sanity - lcl_checkForEmptyName( m_pImpl->m_bAllowEmptyPropertyName, _rName ); + lcl_checkForEmptyName( m_bAllowEmptyPropertyName, _rName ); lcl_checkNameAndHandle_PropertyExistException( _rName, _nHandle, *this ); // register the property @@ -148,7 +140,7 @@ namespace comphelper _rInitialValue ); // remember the default - m_pImpl->aDefaults.emplace( _nHandle, _rInitialValue ); + aDefaults.emplace( _nHandle, _rInitialValue ); } @@ -162,7 +154,7 @@ namespace comphelper revokeProperty( nHandle ); - m_pImpl->aDefaults.erase( nHandle ); + aDefaults.erase( nHandle ); } @@ -199,9 +191,9 @@ namespace comphelper if ( !hasPropertyByHandle( _nHandle ) ) throw UnknownPropertyException(OUString::number(_nHandle)); - MapInt2Any::const_iterator pos = m_pImpl->aDefaults.find( _nHandle ); - OSL_ENSURE( pos != m_pImpl->aDefaults.end(), "PropertyBag::getPropertyDefaultByHandle: inconsistency!" ); - if ( pos != m_pImpl->aDefaults.end() ) + auto pos = aDefaults.find( _nHandle ); + OSL_ENSURE( pos != aDefaults.end(), "PropertyBag::getPropertyDefaultByHandle: inconsistency!" ); + if ( pos != aDefaults.end() ) _out_rValue = pos->second; else _out_rValue.clear(); |