diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-21 11:35:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-23 07:52:33 +0200 |
commit | e0c7b254c0b941cf55a2d4a80de981748c3bfe7c (patch) | |
tree | 94299b5be507d265581140afcea1a2572aa023dc /comphelper | |
parent | 3b0a1ed1ac30d02366a93c789fb5eced171dc4c5 (diff) |
simplify ChainableProperySet and MasterPropertySet
bunch of methods that do nothing
Change-Id: If7806018721bb101825d3489ca8e7fe70e175af4
Reviewed-on: https://gerrit.libreoffice.org/36778
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/property/ChainablePropertySet.cxx | 39 | ||||
-rw-r--r-- | comphelper/source/property/MasterPropertySet.cxx | 57 |
2 files changed, 6 insertions, 90 deletions
diff --git a/comphelper/source/property/ChainablePropertySet.cxx b/comphelper/source/property/ChainablePropertySet.cxx index 846fa7acb87b..65a0e29487a5 100644 --- a/comphelper/source/property/ChainablePropertySet.cxx +++ b/comphelper/source/property/ChainablePropertySet.cxx @@ -197,10 +197,6 @@ PropertyState SAL_CALL ChainablePropertySet::getPropertyState( const OUString& P PropertyState aState(PropertyState_AMBIGUOUS_VALUE); - _preGetPropertyState(); - _getPropertyState( *((*aIter).second), aState ); - _postGetPropertyState(); - return aState; } @@ -214,17 +210,13 @@ Sequence< PropertyState > SAL_CALL ChainablePropertySet::getPropertyStates( cons PropertyState * pState = aStates.getArray(); const OUString * pString = rPropertyNames.getConstArray(); PropertyInfoHash::const_iterator aEnd = mxInfo->maMap.end(), aIter; - _preGetPropertyState(); for ( sal_Int32 i = 0; i < nCount; ++i, ++pString, ++pState ) { aIter = mxInfo->maMap.find ( *pString ); if ( aIter == aEnd ) throw UnknownPropertyException( *pString, static_cast< XPropertySet* >( this ) ); - - _getPropertyState ( *((*aIter).second), *pState ); } - _postGetPropertyState(); } return aStates; } @@ -235,7 +227,6 @@ void SAL_CALL ChainablePropertySet::setPropertyToDefault( const OUString& rPrope if( aIter == mxInfo->maMap.end()) throw UnknownPropertyException( rPropertyName, static_cast< XPropertySet* >( this ) ); - _setPropertyToDefault( *((*aIter).second) ); } Any SAL_CALL ChainablePropertySet::getPropertyDefault( const OUString& rPropertyName ) @@ -244,35 +235,7 @@ Any SAL_CALL ChainablePropertySet::getPropertyDefault( const OUString& rProperty if( aIter == mxInfo->maMap.end()) throw UnknownPropertyException( rPropertyName, static_cast< XPropertySet* >( this ) ); - return _getPropertyDefault( *((*aIter).second) ); -} - -void ChainablePropertySet::_preGetPropertyState () -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -void ChainablePropertySet::_getPropertyState( const comphelper::PropertyInfo&, PropertyState& ) -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -void ChainablePropertySet::_postGetPropertyState () -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -void ChainablePropertySet::_setPropertyToDefault( const comphelper::PropertyInfo& ) -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -Any ChainablePropertySet::_getPropertyDefault( const comphelper::PropertyInfo& ) -{ - OSL_FAIL( "you have to implement this yourself!"); - - Any aAny; - return aAny; + return Any(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx index f3f3374851b1..7b74bbac046e 100644 --- a/comphelper/source/property/MasterPropertySet.cxx +++ b/comphelper/source/property/MasterPropertySet.cxx @@ -325,13 +325,8 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( const OUString& Prop PropertyState aState(PropertyState_AMBIGUOUS_VALUE); - if ( (*aIter).second->mnMapId == 0 ) // 0 means it's one of ours ! - { - _preGetPropertyState(); - _getPropertyState( *((*aIter).second->mpInfo), aState ); - _postGetPropertyState(); - } - else + // 0 means it's one of ours ! + if ( (*aIter).second->mnMapId != 0 ) { ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave; @@ -339,14 +334,6 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( const OUString& Prop std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (pSlave->mpMutex) xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) ); - - // FIXME: Each of these three methods does OSL_FAIL( "you have - // to implement this yourself!") and nothing else, so this - // can't make much sense. Is this whole else branch in fact - // dead code? - ChainablePropertySet::_preGetPropertyState(); - ChainablePropertySet::_getPropertyState( *((*aIter).second->mpInfo), aState ); - ChainablePropertySet::_postGetPropertyState(); } return aState; @@ -362,7 +349,6 @@ Sequence< PropertyState > SAL_CALL MasterPropertySet::getPropertyStates( const S PropertyState * pState = aStates.getArray(); const OUString * pString = rPropertyNames.getConstArray(); PropertyDataHash::const_iterator aEnd = mxInfo->maMap.end(), aIter; - _preGetPropertyState(); for ( sal_Int32 i = 0; i < nCount; ++i, ++pString, ++pState ) { @@ -370,25 +356,20 @@ Sequence< PropertyState > SAL_CALL MasterPropertySet::getPropertyStates( const S if ( aIter == aEnd ) throw UnknownPropertyException( *pString, static_cast< XPropertySet* >( this ) ); - if ( (*aIter).second->mnMapId == 0 ) // 0 means it's one of ours ! - _getPropertyState( *((*aIter).second->mpInfo), *pState ); - else + // 0 means it's one of ours ! + if ( (*aIter).second->mnMapId != 0 ) { SlaveData * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]; if (!pSlave->IsInit()) { - comphelper::ChainablePropertySet::_preGetPropertyState(); pSlave->SetInit ( true ); } - comphelper::ChainablePropertySet::_getPropertyState( *((*aIter).second->mpInfo), *pState ); } } - _postGetPropertyState(); for( const auto& rSlave : maSlaveMap ) { if( rSlave.second->IsInit() ) { - comphelper::ChainablePropertySet::_postGetPropertyState(); rSlave.second->SetInit( false ); } } @@ -402,7 +383,6 @@ void SAL_CALL MasterPropertySet::setPropertyToDefault( const OUString& rProperty if( aIter == mxInfo->maMap.end()) throw UnknownPropertyException( rPropertyName, static_cast< XPropertySet* >( this ) ); - _setPropertyToDefault( *((*aIter).second->mpInfo) ); } Any SAL_CALL MasterPropertySet::getPropertyDefault( const OUString& rPropertyName ) @@ -411,34 +391,7 @@ Any SAL_CALL MasterPropertySet::getPropertyDefault( const OUString& rPropertyNam if( aIter == mxInfo->maMap.end()) throw UnknownPropertyException( rPropertyName, static_cast< XPropertySet* >( this ) ); - return _getPropertyDefault( *((*aIter).second->mpInfo) ); -} - -void MasterPropertySet::_preGetPropertyState () -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -void MasterPropertySet::_getPropertyState( const comphelper::PropertyInfo&, PropertyState& ) -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -void MasterPropertySet::_postGetPropertyState () -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -void MasterPropertySet::_setPropertyToDefault( const comphelper::PropertyInfo& ) -{ - OSL_FAIL( "you have to implement this yourself!"); -} - -Any MasterPropertySet::_getPropertyDefault( const comphelper::PropertyInfo& ) -{ - OSL_FAIL( "you have to implement this yourself!"); - Any aAny; - return aAny; + return Any(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |