Kaydet (Commit) 7ef43f1e authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

use WeakImplHelper on udbstore's classes

Change-Id: I1b38d9708e9298ad3f164d6d8838c88e08d0efeb
üst 71ed01e2
......@@ -37,6 +37,7 @@
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/implbase1.hxx>
#include "ucbstore.hxx"
using namespace com::sun::star::beans;
......@@ -120,8 +121,7 @@ PropertySetMap_Impl;
class PropertySetInfo_Impl :
public OWeakObject, public XTypeProvider, public XPropertySetInfo
class PropertySetInfo_Impl : public cppu::WeakImplHelper1 < XPropertySetInfo >
{
Reference< XComponentContext > m_xContext;
Sequence< Property >* m_pProps;
......@@ -132,17 +132,6 @@ public:
PersistentPropertySet* pOwner );
virtual ~PropertySetInfo_Impl();
// 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 );
......@@ -192,48 +181,6 @@ UcbStore::~UcbStore()
}
// XInterface methods.
void SAL_CALL UcbStore::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL UcbStore::release()
throw()
{
OWeakObject::release();
}
css::uno::Any SAL_CALL UcbStore::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< XServiceInfo* >(this)),
(static_cast< XPropertySetRegistryFactory* >(this)),
(static_cast< XInitialization* >(this))
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
// XTypeProvider methods.
XTYPEPROVIDER_IMPL_4( UcbStore,
XTypeProvider,
XServiceInfo,
XPropertySetRegistryFactory,
XInitialization );
// XServiceInfo methods.
XSERVICEINFO_IMPL_1_CTX( UcbStore,
OUString( "com.sun.star.comp.ucb.UcbStore" ),
OUString( STORE_SERVICE_NAME ) );
......@@ -342,44 +289,6 @@ PropertySetRegistry::~PropertySetRegistry()
// XInterface methods.
void SAL_CALL PropertySetRegistry::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL PropertySetRegistry::release()
throw()
{
OWeakObject::release();
}
css::uno::Any SAL_CALL PropertySetRegistry::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< XServiceInfo* >(this)),
(static_cast< XPropertySetRegistry* >(this)),
(static_cast< XElementAccess* >(this)),
(static_cast< XNameAccess* >(this))
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
// XTypeProvider methods.
XTYPEPROVIDER_IMPL_4( PropertySetRegistry,
XTypeProvider,
XServiceInfo,
XPropertySetRegistry,
XNameAccess );
// XServiceInfo methods.
......@@ -1292,54 +1201,6 @@ PersistentPropertySet::~PersistentPropertySet()
delete m_pImpl;
}
// XInterface methods.
void SAL_CALL PersistentPropertySet::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL PersistentPropertySet::release()
throw()
{
OWeakObject::release();
}
css::uno::Any SAL_CALL PersistentPropertySet::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< XServiceInfo* >(this)),
(static_cast< XComponent* >(this)),
(static_cast< XPropertySet* >(this)),
(static_cast< XNamed* >(this)),
(static_cast< XPersistentPropertySet* >(this)),
(static_cast< XPropertyContainer* >(this)),
(static_cast< XPropertySetInfoChangeNotifier* >(this)),
(static_cast< XPropertyAccess* >(this))
);
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
// XTypeProvider methods.
XTYPEPROVIDER_IMPL_8( PersistentPropertySet,
XTypeProvider,
XServiceInfo,
XComponent,
XPersistentPropertySet,
XNamed,
XPropertyContainer,
XPropertySetInfoChangeNotifier,
XPropertyAccess );
// XServiceInfo methods.
......@@ -1414,8 +1275,7 @@ void SAL_CALL PersistentPropertySet::removeEventListener(
// virtual
Reference< XPropertySetInfo > SAL_CALL
PersistentPropertySet::getPropertySetInfo()
Reference< XPropertySetInfo > SAL_CALL PersistentPropertySet::getPropertySetInfo()
throw( RuntimeException, std::exception )
{
osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex );
......@@ -1431,13 +1291,14 @@ Reference< XPropertySetInfo > SAL_CALL
// virtual
void SAL_CALL PersistentPropertySet::setPropertyValue(
const OUString& aPropertyName, const Any& aValue )
void SAL_CALL PersistentPropertySet::setPropertyValue( const OUString& aPropertyName,
const Any& aValue )
throw( UnknownPropertyException,
PropertyVetoException,
IllegalArgumentException,
WrappedTargetException,
RuntimeException, std::exception )
RuntimeException,
std::exception )
{
if ( aPropertyName.isEmpty() )
throw UnknownPropertyException();
......@@ -2400,42 +2261,6 @@ PropertySetInfo_Impl::~PropertySetInfo_Impl()
// !!! Do not delete m_pOwner !!!
}
// XInterface methods.
void SAL_CALL PropertySetInfo_Impl::acquire()
throw()
{
OWeakObject::acquire();
}
void SAL_CALL PropertySetInfo_Impl::release()
throw()
{
OWeakObject::release();
}
css::uno::Any SAL_CALL PropertySetInfo_Impl::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( PropertySetInfo_Impl,
XTypeProvider,
XPropertySetInfo );
// XPropertySetInfo methods.
......
......@@ -35,7 +35,8 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <cppuhelper/weak.hxx>
#include <ucbhelper/macros.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/implbase7.hxx>
#define STORE_SERVICE_NAME "com.sun.star.ucb.Store"
......@@ -46,12 +47,10 @@
struct UcbStore_Impl;
class UcbStore :
public cppu::OWeakObject,
public com::sun::star::lang::XTypeProvider,
public com::sun::star::lang::XServiceInfo,
public com::sun::star::ucb::XPropertySetRegistryFactory,
public com::sun::star::lang::XInitialization
class UcbStore : public cppu::WeakImplHelper3 <
css::lang::XServiceInfo,
css::ucb::XPropertySetRegistryFactory,
css::lang::XInitialization >
{
com::sun::star::uno::Reference<
com::sun::star::uno::XComponentContext > m_xContext;
......@@ -63,17 +62,6 @@ public:
com::sun::star::uno::XComponentContext >& xContext );
virtual ~UcbStore();
// 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_DECL()
......@@ -99,12 +87,10 @@ public:
struct PropertySetRegistry_Impl;
class PersistentPropertySet;
class PropertySetRegistry :
public cppu::OWeakObject,
public com::sun::star::lang::XTypeProvider,
public com::sun::star::lang::XServiceInfo,
public com::sun::star::ucb::XPropertySetRegistry,
public com::sun::star::container::XNameAccess
class PropertySetRegistry : public cppu::WeakImplHelper3 <
css::lang::XServiceInfo,
css::ucb::XPropertySetRegistry,
css::container::XNameAccess >
{
friend class PersistentPropertySet;
......@@ -130,16 +116,6 @@ public:
::com::sun::star::uno::Any >& rInitArgs);
virtual ~PropertySetRegistry();
// 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()
......@@ -185,19 +161,16 @@ public:
struct PersistentPropertySet_Impl;
class PersistentPropertySet :
public cppu::OWeakObject,
public com::sun::star::lang::XTypeProvider,
public com::sun::star::lang::XServiceInfo,
public com::sun::star::lang::XComponent,
public com::sun::star::ucb::XPersistentPropertySet,
public com::sun::star::container::XNamed,
public com::sun::star::beans::XPropertyContainer,
public com::sun::star::beans::XPropertySetInfoChangeNotifier,
public com::sun::star::beans::XPropertyAccess
class PersistentPropertySet : public cppu::WeakImplHelper7 <
css::lang::XServiceInfo,
css::lang::XComponent,
css::ucb::XPersistentPropertySet,
css::container::XNamed,
css::beans::XPropertyContainer,
css::beans::XPropertySetInfoChangeNotifier,
css::beans::XPropertyAccess >
{
com::sun::star::uno::Reference<
com::sun::star::uno::XComponentContext > m_xContext;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
PersistentPropertySet_Impl* m_pImpl;
private:
......@@ -214,17 +187,6 @@ public:
const OUString& rKey );
virtual ~PersistentPropertySet();
// 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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment