[Libreoffice-commits] core.git: comphelper/source include/comphelper

Noel Grandin noel.grandin at collabora.co.uk
Sun Apr 23 05:52:59 UTC 2017


 comphelper/source/property/ChainablePropertySet.cxx |   39 -------------
 comphelper/source/property/MasterPropertySet.cxx    |   57 +-------------------
 include/comphelper/ChainablePropertySet.hxx         |   19 ------
 include/comphelper/MasterPropertySet.hxx            |   19 ------
 4 files changed, 6 insertions(+), 128 deletions(-)

New commits:
commit e0c7b254c0b941cf55a2d4a80de981748c3bfe7c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Apr 21 11:35:25 2017 +0200

    simplify ChainableProperySet and MasterPropertySet
    
    bunch of methods that do nothing
    
    Change-Id: If7806018721bb101825d3489ca8e7fe70e175af4
    Reviewed-on: https://gerrit.libreoffice.org/36778
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

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: */
diff --git a/include/comphelper/ChainablePropertySet.hxx b/include/comphelper/ChainablePropertySet.hxx
index 85a7f0b41828..bef7efaf5ae2 100644
--- a/include/comphelper/ChainablePropertySet.hxx
+++ b/include/comphelper/ChainablePropertySet.hxx
@@ -98,25 +98,6 @@ namespace comphelper
         /// @throws css::lang::WrappedTargetException
         virtual void _postGetValues () = 0;
 
-        /// @throws css::beans::UnknownPropertyException
-        /// @throws css::beans::PropertyVetoException
-        /// @throws css::lang::IllegalArgumentException
-        /// @throws css::lang::WrappedTargetException
-        static void _preGetPropertyState ();
-        /// @throws css::beans::UnknownPropertyException
-        static void _getPropertyState( const comphelper::PropertyInfo& rInfo, css::beans::PropertyState& rState );
-        /// @throws css::beans::UnknownPropertyException
-        /// @throws css::beans::PropertyVetoException
-        /// @throws css::lang::IllegalArgumentException
-        /// @throws css::lang::WrappedTargetException
-        static void _postGetPropertyState ();
-
-        /// @throws css::beans::UnknownPropertyException
-        static void _setPropertyToDefault( const comphelper::PropertyInfo& rEntry );
-        /// @throws css::beans::UnknownPropertyException
-        /// @throws css::lang::WrappedTargetException
-        static css::uno::Any _getPropertyDefault( const comphelper::PropertyInfo& rEntry );
-
     public:
         ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, SolarMutex* pMutex = nullptr )
             throw();
diff --git a/include/comphelper/MasterPropertySet.hxx b/include/comphelper/MasterPropertySet.hxx
index d18ad49786bf..937832488b78 100644
--- a/include/comphelper/MasterPropertySet.hxx
+++ b/include/comphelper/MasterPropertySet.hxx
@@ -98,25 +98,6 @@ namespace comphelper
         /// @throws css::lang::WrappedTargetException
         virtual void _postGetValues () = 0;
 
-        /// @throws css::beans::UnknownPropertyException
-        /// @throws css::beans::PropertyVetoException
-        /// @throws css::lang::IllegalArgumentException
-        /// @throws css::lang::WrappedTargetException
-        static void _preGetPropertyState ();
-        /// @throws css::beans::UnknownPropertyException
-        static void _getPropertyState( const comphelper::PropertyInfo& rInfo, css::beans::PropertyState& rState );
-        /// @throws css::beans::UnknownPropertyException
-        /// @throws css::beans::PropertyVetoException
-        /// @throws css::lang::IllegalArgumentException
-        /// @throws css::lang::WrappedTargetException
-        static void _postGetPropertyState ();
-
-        /// @throws css::beans::UnknownPropertyException
-        static void _setPropertyToDefault( const comphelper::PropertyInfo& rEntry );
-        /// @throws css::beans::UnknownPropertyException
-        /// @throws css::lang::WrappedTargetException
-        static css::uno::Any _getPropertyDefault( const comphelper::PropertyInfo& rEntry );
-
     public:
         MasterPropertySet( comphelper::MasterPropertySetInfo* pInfo, SolarMutex* pMutex = nullptr )
             throw();


More information about the Libreoffice-commits mailing list