summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-06-01 01:23:34 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-02 06:33:14 +0000
commite0f60043cc6013eabd22dc73f7371a4f19f54625 (patch)
tree9c51714c2cd6b1bb6b391a24222865bd17f30971
parent84d15d6e5418bd5024bb21b6c8fdc2700667ac04 (diff)
tdf#89329: use unique_ptr for pImpl in componentmodule
Change-Id: Ida8e271b1dd755289371e457a7c83657b8a84f99 Reviewed-on: https://gerrit.libreoffice.org/25746 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--comphelper/source/misc/componentmodule.cxx14
-rw-r--r--include/comphelper/componentmodule.hxx3
2 files changed, 2 insertions, 15 deletions
diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx
index fede3e282f7e..074515e83c40 100644
--- a/comphelper/source/misc/componentmodule.cxx
+++ b/comphelper/source/misc/componentmodule.cxx
@@ -24,11 +24,9 @@
#include <vector>
-
namespace comphelper
{
-
using namespace ::cppu;
using ::com::sun::star::uno::Sequence;
using ::com::sun::star::uno::RuntimeException;
@@ -48,12 +46,10 @@ namespace comphelper
~OModuleImpl();
};
-
OModuleImpl::OModuleImpl()
{
}
-
OModuleImpl::~OModuleImpl()
{
}
@@ -66,16 +62,13 @@ namespace comphelper
OModule::~OModule()
{
- delete m_pImpl;
}
-
void OModule::registerClient( OModule::ClientAccess )
{
osl_atomic_increment( &m_nClients );
}
-
void OModule::revokeClient( OModule::ClientAccess )
{
if ( 0 == osl_atomic_decrement( &m_nClients ) )
@@ -85,12 +78,10 @@ namespace comphelper
}
}
-
void OModule::onLastClient()
{
}
-
void OModule::registerImplementation( const ComponentDescription& _rComp )
{
::osl::MutexGuard aGuard( m_aMutex );
@@ -100,7 +91,6 @@ namespace comphelper
m_pImpl->m_aRegisteredComponents.push_back( _rComp );
}
-
void OModule::registerImplementation( const OUString& _rImplementationName, const css::uno::Sequence< OUString >& _rServiceNames,
::cppu::ComponentFactoryFunc _pCreateFunction )
{
@@ -108,7 +98,6 @@ namespace comphelper
registerImplementation( aComponent );
}
-
void* OModule::getComponentFactory( const sal_Char* _pImplementationName )
{
Reference< XInterface > xFactory( getComponentFactory(
@@ -116,7 +105,6 @@ namespace comphelper
return xFactory.get();
}
-
Reference< XInterface > OModule::getComponentFactory( const OUString& _rImplementationName )
{
Reference< XInterface > xReturn;
@@ -145,8 +133,6 @@ namespace comphelper
return nullptr;
}
-
} // namespace comphelper
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/componentmodule.hxx b/include/comphelper/componentmodule.hxx
index 235705564c08..05626ebaecee 100644
--- a/include/comphelper/componentmodule.hxx
+++ b/include/comphelper/componentmodule.hxx
@@ -30,6 +30,7 @@
#include <rtl/string.hxx>
#include <rtl/instance.hxx>
+#include <memory>
namespace comphelper
@@ -82,7 +83,7 @@ namespace comphelper
{
private:
oslInterlockedCount m_nClients; /// number of registered clients
- OModuleImpl* m_pImpl; /// impl class. lives as long as at least one client for the module is registered
+ std::unique_ptr<OModuleImpl> m_pImpl; /// impl class. lives as long as at least one client for the module is registered
protected:
mutable ::osl::Mutex m_aMutex; /// access safety