diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-07 00:36:17 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-03-07 00:36:17 -0600 |
commit | 50de43d6b40096747655c291ed4266e07680e679 (patch) | |
tree | 763a28e33d4995add44f1588477ab110c123a155 /ucb | |
parent | de-macroize ucb sortdynres (diff) | |
download | core-50de43d6b40096747655c291ed4266e07680e679.tar.gz core-50de43d6b40096747655c291ed4266e07680e679.zip |
de-macroize ucb sortresult
Change-Id: Ib522fde5e453560b23c0189a29b50f5dfddb4482
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/sorter/sortdynres.cxx | 2 | ||||
-rw-r--r-- | ucb/source/sorter/sortdynres.hxx | 1 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.cxx | 114 | ||||
-rw-r--r-- | ucb/source/sorter/sortresult.hxx | 53 |
4 files changed, 51 insertions, 119 deletions
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx index 07cbfd1c5695..07f7dc6c41c6 100644 --- a/ucb/source/sorter/sortdynres.cxx +++ b/ucb/source/sorter/sortdynres.cxx @@ -20,11 +20,13 @@ #include <vector> #include <sortdynres.hxx> #include <cppuhelper/interfacecontainer.hxx> +#include <cppuhelper/supportsservice.hxx> #include <com/sun/star/ucb/ContentResultSetCapability.hpp> #include <com/sun/star/ucb/ListActionType.hpp> #include <com/sun/star/ucb/WelcomeDynamicResultSetStruct.hpp> #include <com/sun/star/ucb/CachedDynamicResultSetStubFactory.hpp> #include <com/sun/star/ucb/XSourceInitialization.hpp> +#include <ucbhelper/getcomponentcontext.hxx> using namespace com::sun::star::beans; using namespace com::sun::star::lang; diff --git a/ucb/source/sorter/sortdynres.hxx b/ucb/source/sorter/sortdynres.hxx index 0f7002649055..eb5bbb6eefad 100644 --- a/ucb/source/sorter/sortdynres.hxx +++ b/ucb/source/sorter/sortdynres.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/ucb/XDynamicResultSetListener.hpp> #include <com/sun/star/ucb/ListenerAlreadySetException.hpp> #include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp> +#include <cppuhelper/factory.hxx> #include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase2.hxx> #include "sortresult.hxx" diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx index 22577ca22d3d..035f7ec7d936 100644 --- a/ucb/source/sorter/sortresult.cxx +++ b/ucb/source/sorter/sortresult.cxx @@ -20,16 +20,17 @@ #include <vector> #include <sortresult.hxx> -#include <cppuhelper/interfacecontainer.hxx> #include <com/sun/star/sdbc/DataType.hpp> #include <com/sun/star/sdbc/XResultSetMetaData.hpp> #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp> #include <com/sun/star/ucb/ListActionType.hpp> #include <com/sun/star/ucb/XAnyCompare.hpp> #include <com/sun/star/ucb/XAnyCompareFactory.hpp> +#include <cppuhelper/implbase1.hxx> +#include <cppuhelper/interfacecontainer.hxx> +#include <cppuhelper/supportsservice.hxx> #include <osl/diagnose.h> - using namespace com::sun::star::beans; using namespace com::sun::star::container; using namespace com::sun::star::io; @@ -90,10 +91,8 @@ struct SortListData -class SRSPropertySetInfo : - public OWeakObject, - public XTypeProvider, - public XPropertySetInfo +class SRSPropertySetInfo : public cppu::WeakImplHelper1 < + XPropertySetInfo > { Property maProps[2]; @@ -103,17 +102,6 @@ public: SRSPropertySetInfo(); virtual ~SRSPropertySetInfo(); - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) - throw( css::uno::RuntimeException, std::exception ); - virtual void SAL_CALL acquire() - throw(); - virtual void SAL_CALL release() - throw(); - - // XTypeProvider - XTYPEPROVIDER_DECL() - // XPropertySetInfo virtual Sequence< Property > SAL_CALL getProperties() throw( RuntimeException, std::exception ); @@ -208,58 +196,37 @@ SortedResultSet::~SortedResultSet() } -// XInterface methods. +// XServiceInfo methods. -void SAL_CALL SortedResultSet::acquire() - throw() +OUString SAL_CALL SortedResultSet::getImplementationName() + throw( css::uno::RuntimeException, std::exception ) { - OWeakObject::acquire(); + return getImplementationName_Static(); } -void SAL_CALL SortedResultSet::release() - throw() +OUString SortedResultSet::getImplementationName_Static() { - OWeakObject::release(); + return OUString( "com.sun.star.comp.ucb.SortedResultSet" ); } -css::uno::Any SAL_CALL SortedResultSet::queryInterface( const css::uno::Type & rType ) +sal_Bool SAL_CALL SortedResultSet::supportsService( const OUString& ServiceName ) throw( css::uno::RuntimeException, std::exception ) { - css::uno::Any aRet = cppu::queryInterface( rType, - (static_cast< XTypeProvider* >(this)), - (static_cast< XServiceInfo* >(this)), - (static_cast< XComponent* >(this)), - (static_cast< XContentAccess* >(this)), - (static_cast< XResultSet* >(this)), - (static_cast< XRow* >(this)), - (static_cast< XCloseable* >(this)), - (static_cast< XResultSetMetaDataSupplier* >(this)), - (static_cast< XPropertySet* >(this)) - ); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); + return cppu::supportsService( this, ServiceName ); } -// XTypeProvider methods. - - -XTYPEPROVIDER_IMPL_9( SortedResultSet, - XTypeProvider, - XServiceInfo, - XComponent, - XContentAccess, - XResultSet, - XRow, - XCloseable, - XResultSetMetaDataSupplier, - XPropertySet ); - - -// XServiceInfo methods. - +css::uno::Sequence< OUString > SAL_CALL SortedResultSet::getSupportedServiceNames() + throw( css::uno::RuntimeException, std::exception ) +{ + return getSupportedServiceNames_Static(); +} -XSERVICEINFO_NOFACTORY_IMPL_1( SortedResultSet, - OUString( "com.sun.star.comp.ucb.SortedResultSet" ), - OUString( RESULTSET_SERVICE_NAME ) ); +css::uno::Sequence< OUString >SortedResultSet::getSupportedServiceNames_Static() +{ + css::uno::Sequence< OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] = OUString( RESULTSET_SERVICE_NAME ); + return aSNS; +} // XComponent methods. @@ -2034,39 +2001,6 @@ SRSPropertySetInfo::SRSPropertySetInfo() SRSPropertySetInfo::~SRSPropertySetInfo() {} - -// XInterface methods. - -void SAL_CALL SRSPropertySetInfo::acquire() - throw() -{ - OWeakObject::acquire(); -} - -void SAL_CALL SRSPropertySetInfo::release() - throw() -{ - OWeakObject::release(); -} - -css::uno::Any SAL_CALL SRSPropertySetInfo::queryInterface( const css::uno::Type & rType ) - throw( css::uno::RuntimeException, std::exception ) -{ - css::uno::Any aRet = cppu::queryInterface( rType, - (static_cast< XTypeProvider* >(this)), - (static_cast< XPropertySetInfo* >(this)) - ); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); -} - -// XTypeProvider methods. - - -XTYPEPROVIDER_IMPL_2( SRSPropertySetInfo, - XTypeProvider, - XPropertySetInfo ); - - // XPropertySetInfo methods. Sequence< Property > SAL_CALL diff --git a/ucb/source/sorter/sortresult.hxx b/ucb/source/sorter/sortresult.hxx index 24bb1c8b8bd3..46c5e2fe84ae 100644 --- a/ucb/source/sorter/sortresult.hxx +++ b/ucb/source/sorter/sortresult.hxx @@ -21,10 +21,10 @@ #define _SORTRESULT_HXX #include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/sdbc/XCloseable.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XResultSetMetaData.hpp> @@ -34,11 +34,8 @@ #include <com/sun/star/ucb/NumberedSortingInfo.hpp> #include <com/sun/star/ucb/XAnyCompareFactory.hpp> #include <com/sun/star/ucb/ListAction.hpp> -#include <cppuhelper/weak.hxx> -#include <osl/mutex.hxx> - +#include <cppuhelper/implbase8.hxx> #include <deque> -#include <ucbhelper/macros.hxx> namespace cppu { class OInterfaceContainerHelper; @@ -116,17 +113,15 @@ public: -class SortedResultSet: - public cppu::OWeakObject, - public css::lang::XTypeProvider, - public css::lang::XServiceInfo, - public css::lang::XComponent, - public css::ucb::XContentAccess, - public css::sdbc::XResultSet, - public css::sdbc::XRow, - public css::sdbc::XCloseable, - public css::sdbc::XResultSetMetaDataSupplier, - public css::beans::XPropertySet +class SortedResultSet: public cppu::WeakImplHelper8 < + css::lang::XServiceInfo, + css::lang::XComponent, + css::ucb::XContentAccess, + css::sdbc::XResultSet, + css::sdbc::XRow, + css::sdbc::XCloseable, + css::sdbc::XResultSetMetaDataSupplier, + css::beans::XPropertySet > { cppu::OInterfaceContainerHelper *mpDisposeEventListeners; PropertyChangeListeners_Impl *mpPropChangeListeners; @@ -191,19 +186,19 @@ public: void ResortModified( EventList* pList ); void ResortNew( EventList* pList ); - // XInterface - virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) - throw( css::uno::RuntimeException, std::exception ); - virtual void SAL_CALL acquire() - throw(); - virtual void SAL_CALL release() - throw(); - - // XTypeProvider - XTYPEPROVIDER_DECL() - // XServiceInfo - XSERVICEINFO_NOFACTORY_DECL() + virtual OUString SAL_CALL getImplementationName() + throw( css::uno::RuntimeException, + std::exception ); + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) + throw( css::uno::RuntimeException, + std::exception ); + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() + throw( css::uno::RuntimeException, + std::exception ); + + static OUString getImplementationName_Static(); + static css::uno::Sequence< OUString > getSupportedServiceNames_Static(); // XComponent virtual void SAL_CALL |