use more cppu::BaseMutex

Change-Id: Iddd7438161ead93b27cf8e8058ca5b1eae3d8001
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127075
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2021-12-17 22:42:53 +02:00
committed by Noel Grandin
parent 729834abac
commit 3152f5a33e
45 changed files with 138 additions and 195 deletions

View File

@@ -27,6 +27,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <osl/mutex.hxx>
#include <cppuhelper/component.hxx>
#include <cppuhelper/basemutex.hxx>
#include <rtl/ref.hxx>
namespace com::sun::star::uno { class XComponentContext; }
@@ -39,19 +40,13 @@ namespace unocontrols { class OMRCListenerMultiplexerHelper; }
namespace unocontrols {
struct IMPL_MutexContainer
{
// Is necessary to initialize "BaseControl" and make this class thread-safe.
::osl::Mutex m_aMutex;
};
class BaseControl : public css::lang::XServiceInfo
, public css::awt::XPaintListener
, public css::awt::XWindowListener
, public css::awt::XView
, public css::awt::XWindow
, public css::awt::XControl
, public IMPL_MutexContainer
, public cppu::BaseMutex
, public ::cppu::OComponentHelper
{
public:

View File

@@ -49,8 +49,7 @@ namespace unocontrols {
// construct/destruct
BaseControl::BaseControl( const Reference< XComponentContext >& rxContext )
: IMPL_MutexContainer ( )
, OComponentHelper ( m_aMutex )
: OComponentHelper ( m_aMutex )
, m_xComponentContext ( rxContext )
, m_nX ( DEFAULT_X )
, m_nY ( DEFAULT_Y )

View File

@@ -21,6 +21,7 @@
#include <osl/mutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
@@ -37,12 +38,7 @@ typedef cppu::WeakImplHelper<
css::util::XOfficeInstallationDirectories,
css::lang::XServiceInfo > UnoImplBase;
struct mutex_holder
{
osl::Mutex m_aMutex;
};
class OfficeInstallationDirectories : public mutex_holder, public UnoImplBase
class OfficeInstallationDirectories : public cppu::BaseMutex, public UnoImplBase
{
public:
explicit OfficeInstallationDirectories(

View File

@@ -39,6 +39,7 @@
#include <osl/mutex.hxx>
#include <sal/macros.h>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -54,7 +55,6 @@ namespace pq_sdbc_driver
SAL_STRINGIFY(PQ_SDBC_MINOR) "." \
SAL_STRINGIFY(PQ_SDBC_MICRO)
struct MutexHolder { osl::Mutex m_mutex; };
// use this to switch off sdbc support !
// typedef cppu::WeakComponentImplHelper<
// css::sdbc::XDriver,
@@ -64,14 +64,14 @@ typedef cppu::WeakComponentImplHelper<
css::sdbc::XDriver,
css::lang::XServiceInfo,
css::sdbcx::XDataDefinitionSupplier > DriverBase ;
class Driver : public MutexHolder, public DriverBase
class Driver : public cppu::BaseMutex, public DriverBase
{
css::uno::Reference< css::uno::XComponentContext > m_ctx;
css::uno::Reference< css::lang::XMultiComponentFactory > m_smgr;
public:
explicit Driver ( const css::uno::Reference < css::uno::XComponentContext > & ctx )
: DriverBase( m_mutex ),
: DriverBase( m_aMutex ),
m_ctx( ctx ),
m_smgr( ctx->getServiceManager() )
{}

View File

@@ -45,7 +45,7 @@ namespace accessibility {
AccessibleContextBase::AccessibleContextBase (
const uno::Reference<XAccessible>& rxParent,
const sal_Int16 aRole)
: WeakComponentImplHelper(MutexOwner::maMutex),
: WeakComponentImplHelper(m_aMutex),
mxParent(rxParent),
meDescriptionOrigin(NotSet),
meNameOrigin(NotSet),
@@ -75,7 +75,7 @@ AccessibleContextBase::~AccessibleContextBase()
bool AccessibleContextBase::SetState (sal_Int16 aState)
{
::osl::ClearableMutexGuard aGuard (maMutex);
::osl::ClearableMutexGuard aGuard (m_aMutex);
::utl::AccessibleStateSetHelper* pStateSet =
static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
if ((pStateSet != nullptr) && !pStateSet->contains(aState))
@@ -104,7 +104,7 @@ bool AccessibleContextBase::SetState (sal_Int16 aState)
bool AccessibleContextBase::ResetState (sal_Int16 aState)
{
::osl::ClearableMutexGuard aGuard (maMutex);
::osl::ClearableMutexGuard aGuard (m_aMutex);
::utl::AccessibleStateSetHelper* pStateSet =
static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
if ((pStateSet != nullptr) && pStateSet->contains(aState))
@@ -128,7 +128,7 @@ bool AccessibleContextBase::ResetState (sal_Int16 aState)
bool AccessibleContextBase::GetState (sal_Int16 aState)
{
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
::utl::AccessibleStateSetHelper* pStateSet =
static_cast< ::utl::AccessibleStateSetHelper*>(mxStateSet.get());
if (pStateSet != nullptr)
@@ -415,7 +415,7 @@ void SAL_CALL AccessibleContextBase::disposing()
{
SetState (AccessibleStateType::DEFUNC);
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
// Send a disposing to all listeners.
if ( mnClientId )

View File

@@ -35,8 +35,7 @@
namespace extensions::config::ldap {
LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContext>& xContext)
: LdapProfileMutexHolder(),
BackendBase(mMutex)
: BackendBase(m_aMutex)
{
LdapDefinition aDefinition;
OUString loggedOnUser;

View File

@@ -23,6 +23,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include "ldapaccess.hxx"
@@ -41,13 +42,12 @@ struct LdapDefinition;
typedef cppu::WeakComponentImplHelper<css::beans::XPropertySet,
lang::XServiceInfo> BackendBase ;
struct LdapProfileMutexHolder { osl::Mutex mMutex; };
/**
Implements the PlatformBackend service, a specialization of the
XPropertySet service for retrieving LDAP user profile
configuration settings from an LDAP repository.
*/
class LdapUserProfileBe : private LdapProfileMutexHolder, public BackendBase
class LdapUserProfileBe : private cppu::BaseMutex, public BackendBase
{
public:

View File

@@ -33,9 +33,8 @@
namespace filter::config{
BaseContainer::BaseContainer()
: BaseLock ( )
, m_eType()
, m_lListener (m_aLock)
: m_eType()
, m_lListener (m_aMutex)
{
GetTheFilterCache().load(FilterCache::E_CONTAINS_STANDARD);
}
@@ -52,7 +51,7 @@ void BaseContainer::init(const css::uno::Reference< css::uno::XComponentContext
FilterCache::EItemType eType )
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
m_sImplementationName = sImplementationName;
m_lServiceNames = lServiceNames ;
@@ -66,7 +65,7 @@ void BaseContainer::impl_loadOnDemand()
{
#ifdef LOAD_IMPLICIT
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// A generic container needs all items of a set of our cache!
// Of course it can block for a while, till the cache is really filled.
@@ -101,7 +100,7 @@ void BaseContainer::impl_loadOnDemand()
void BaseContainer::impl_initFlushMode()
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
if (!m_pFlushCache)
m_pFlushCache = GetTheFilterCache().clone();
if (!m_pFlushCache)
@@ -114,7 +113,7 @@ void BaseContainer::impl_initFlushMode()
FilterCache* BaseContainer::impl_getWorkingCache() const
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
if (m_pFlushCache)
return m_pFlushCache.get();
else
@@ -161,7 +160,7 @@ void SAL_CALL BaseContainer::insertByName(const OUString& sItem ,
impl_loadOnDemand();
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// create write copy of used cache on demand ...
impl_initFlushMode();
@@ -179,7 +178,7 @@ void SAL_CALL BaseContainer::removeByName(const OUString& sItem)
impl_loadOnDemand();
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// create write copy of used cache on demand ...
impl_initFlushMode();
@@ -211,7 +210,7 @@ void SAL_CALL BaseContainer::replaceByName(const OUString& sItem ,
impl_loadOnDemand();
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// create write copy of used cache on demand ...
impl_initFlushMode();
@@ -235,7 +234,7 @@ css::uno::Any SAL_CALL BaseContainer::getByName(const OUString& sItem)
impl_loadOnDemand();
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
CacheItem aItem;
try
@@ -268,7 +267,7 @@ css::uno::Sequence< OUString > SAL_CALL BaseContainer::getElementNames()
impl_loadOnDemand();
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
try
{
@@ -295,7 +294,7 @@ sal_Bool SAL_CALL BaseContainer::hasByName(const OUString& sItem)
impl_loadOnDemand();
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
try
{
@@ -329,7 +328,7 @@ sal_Bool SAL_CALL BaseContainer::hasElements()
impl_loadOnDemand();
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
try
{
@@ -363,7 +362,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::crea
impl_loadOnDemand();
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
try
{
@@ -403,7 +402,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL BaseContainer::crea
void SAL_CALL BaseContainer::flush()
{
// SAFE ->
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
if (!m_pFlushCache)
throw css::lang::WrappedTargetRuntimeException(

View File

@@ -49,7 +49,7 @@ namespace filter::config {
present by this base class!) was full initialized inside our own
ctor as first!
*/
class BaseContainer : public BaseLock
class BaseContainer : public cppu::BaseMutex
, public ::cppu::WeakImplHelper< css::lang::XServiceInfo ,
css::container::XNameContainer , // => XNameReplace => XNameAccess => XElementAccess
css::container::XContainerQuery ,

View File

@@ -30,19 +30,6 @@
namespace filter::config {
/** @short Must be used as first derived base class
to get a full initialized mutex member,
which can be used during the ctor runs too!
*/
struct BaseLock
{
public:
// must be mutable to be usable in const environments too!
mutable ::osl::Mutex m_aLock;
};
/** @short represent an item of a FilterCache
instance.

View File

@@ -33,8 +33,7 @@ namespace filter::config{
CacheUpdateListener::CacheUpdateListener(FilterCache &rFilterCache,
const css::uno::Reference< css::uno::XInterface >& xConfigAccess,
FilterCache::EItemType eConfigType)
: BaseLock()
, m_rCache(rFilterCache)
: m_rCache(rFilterCache)
, m_xConfig(xConfigAccess)
, m_eConfigType(eConfigType)
{
@@ -47,7 +46,7 @@ CacheUpdateListener::~CacheUpdateListener()
void CacheUpdateListener::startListening()
{
// SAFE ->
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
css::uno::Reference< css::util::XChangesNotifier > xNotifier(m_xConfig, css::uno::UNO_QUERY);
aLock.clear();
// <- SAFE
@@ -63,7 +62,7 @@ void CacheUpdateListener::startListening()
void CacheUpdateListener::stopListening()
{
// SAFE ->
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
css::uno::Reference< css::util::XChangesNotifier > xNotifier(m_xConfig, css::uno::UNO_QUERY);
aLock.clear();
// <- SAFE
@@ -79,7 +78,7 @@ void CacheUpdateListener::stopListening()
void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEvent& aEvent)
{
// SAFE ->
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
// disposed ?
if ( ! m_xConfig.is())
@@ -173,7 +172,7 @@ void SAL_CALL CacheUpdateListener::changesOccurred(const css::util::ChangesEven
void SAL_CALL CacheUpdateListener::disposing(const css::lang::EventObject& aEvent)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
if (aEvent.Source == m_xConfig)
m_xConfig.clear();
// <- SAFE

View File

@@ -30,7 +30,7 @@ namespace filter::config {
global filter cache, if the underlying configuration
wa changed by other processes.
*/
class CacheUpdateListener : public BaseLock // must be the first one to guarantee right initialized mutex member!
class CacheUpdateListener : public cppu::BaseMutex // must be the first one to guarantee right initialized mutex member!
, public ::cppu::WeakImplHelper< css::util::XChangesListener >
{

View File

@@ -26,8 +26,7 @@
namespace filter::config{
ConfigFlush::ConfigFlush()
: BaseLock ( )
, m_lListener(m_aLock)
: m_lListener(m_aMutex)
{
}

View File

@@ -23,6 +23,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <comphelper/multicontainer2.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/basemutex.hxx>
namespace filter::config {
@@ -34,7 +35,7 @@ namespace filter::config {
@descr Such refresh listener will be called in case the
type/filter configuration will be changed at runtime.
*/
class ConfigFlush final : public BaseLock
class ConfigFlush final : public cppu::BaseMutex
, public ::cppu::WeakImplHelper<
css::util::XRefreshable,
css::lang::XServiceInfo

View File

@@ -53,7 +53,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL ContentHandlerFactory::crea
css::uno::Reference< css::uno::XInterface > xHandler;
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
auto & cache = GetTheFilterCache();

View File

@@ -56,8 +56,7 @@
namespace filter::config{
FilterCache::FilterCache()
: BaseLock ( )
, m_eFillState(E_CONTAINS_NOTHING )
: m_eFillState(E_CONTAINS_NOTHING )
{
int i = 0;
OUString sStandardProps[10];
@@ -119,7 +118,7 @@ FilterCache::~FilterCache()
std::unique_ptr<FilterCache> FilterCache::clone() const
{
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
auto pClone = std::make_unique<FilterCache>();
@@ -151,7 +150,7 @@ std::unique_ptr<FilterCache> FilterCache::clone() const
void FilterCache::takeOver(const FilterCache& rClone)
{
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// a)
// Don't copy the configuration access points here!
@@ -199,7 +198,7 @@ void FilterCache::takeOver(const FilterCache& rClone)
void FilterCache::load(EFillState eRequired)
{
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// check if required fill state is already reached ...
// There is nothing to do then.
@@ -238,7 +237,7 @@ void FilterCache::load(EFillState eRequired)
bool FilterCache::isFillState(FilterCache::EFillState eState) const
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
return ((m_eFillState & eState) == eState);
// <- SAFE
}
@@ -249,7 +248,7 @@ std::vector<OUString> FilterCache::getMatchingItemsByProps( EItemType eTyp
const CacheItem& lEProps) const
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// search for right list
// An exception is thrown - "eType" is unknown.
@@ -279,7 +278,7 @@ std::vector<OUString> FilterCache::getMatchingItemsByProps( EItemType eTyp
bool FilterCache::hasItems(EItemType eType) const
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// search for right list
// An exception is thrown - "eType" is unknown.
@@ -294,7 +293,7 @@ bool FilterCache::hasItems(EItemType eType) const
std::vector<OUString> FilterCache::getItemNames(EItemType eType) const
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// search for right list
// An exception is thrown - "eType" is unknown.
@@ -315,7 +314,7 @@ bool FilterCache::hasItem( EItemType eType,
const OUString& sItem)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// search for right list
// An exception is thrown - "eType" is unknown.
@@ -347,7 +346,7 @@ CacheItem FilterCache::getItem( EItemType eType,
const OUString& sItem)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// search for right list
// An exception is thrown if "eType" is unknown.
@@ -397,7 +396,7 @@ void FilterCache::removeItem( EItemType eType,
const OUString& sItem)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// search for right list
// An exception is thrown - "eType" is unknown.
@@ -418,7 +417,7 @@ void FilterCache::setItem( EItemType eType ,
const CacheItem& aValue)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// search for right list
// An exception is thrown - "eType" is unknown.
@@ -445,7 +444,7 @@ void FilterCache::refreshItem( EItemType eType,
const OUString& sItem)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
impl_loadItemOnDemand(eType, sItem);
}
@@ -455,7 +454,7 @@ void FilterCache::addStatePropsToItem( EItemType eType,
CacheItem& rItem)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// Note: Opening of the configuration layer throws some exceptions
// if it failed. So we mustn't check any reference here...
@@ -559,7 +558,7 @@ void FilterCache::removeStatePropsFromItem(CacheItem& rItem)
void FilterCache::flush()
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// renew all dependencies and optimizations
impl_validateAndOptimize();
@@ -661,7 +660,7 @@ void FilterCache::detectFlatForURL(const css::util::URL& aURL ,
sExtension = sExtension.toAsciiLowerCase();
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// i) Step over all well known URL pattern
@@ -710,7 +709,7 @@ void FilterCache::detectFlatForURL(const css::util::URL& aURL ,
const CacheItemList& FilterCache::impl_getItemList(EItemType eType) const
{
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
switch(eType)
{
@@ -729,7 +728,7 @@ const CacheItemList& FilterCache::impl_getItemList(EItemType eType) const
CacheItemList& FilterCache::impl_getItemList(EItemType eType)
{
// SAFE -> ----------------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
switch(eType)
{
@@ -747,7 +746,7 @@ CacheItemList& FilterCache::impl_getItemList(EItemType eType)
css::uno::Reference< css::uno::XInterface > FilterCache::impl_openConfig(EConfigProvider eProvider)
{
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
OUString sPath ;
css::uno::Reference< css::uno::XInterface >* pConfig = nullptr;
@@ -873,7 +872,7 @@ css::uno::Reference< css::uno::XInterface > FilterCache::impl_createConfigAccess
bool bLocalesMode)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
css::uno::Reference< css::uno::XInterface > xCfg;
@@ -933,7 +932,7 @@ css::uno::Reference< css::uno::XInterface > FilterCache::impl_createConfigAccess
void FilterCache::impl_validateAndOptimize()
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// First check if any filter or type could be read
// from the underlying configuration!
@@ -1260,7 +1259,7 @@ FilterCache::EItemFlushState FilterCache::impl_specifyFlushOperation(const css::
void FilterCache::impl_load(EFillState eRequiredState)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// Attention: Detect services are part of the standard set!
// So there is no need to handle it separately.
@@ -1473,7 +1472,7 @@ void FilterCache::impl_readPatchUINames(const css::uno::Reference< css::containe
{
// SAFE -> ----------------------------------
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
OUString sActLocale = m_sActLocale ;
aLock.clear();
// <- SAFE ----------------------------------
@@ -2204,7 +2203,7 @@ bool FilterCache::impl_isModuleInstalled(const OUString& sModule)
// SAFE ->
{
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
if (!m_xModuleCfg.is())
{
m_xModuleCfg = officecfg::Setup::Office::Factories::get();

View File

@@ -29,6 +29,7 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Any.h>
#include <comphelper/documentconstants.hxx>
#include <cppuhelper/basemutex.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
@@ -54,7 +55,7 @@ class CacheUpdateListener;
Further we make it public. So any user of this class
can lock us from outside too.
*/
class FilterCache : public BaseLock
class FilterCache : public cppu::BaseMutex
{
// public types

View File

@@ -77,7 +77,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FilterFactory::createInstan
const css::uno::Sequence< css::uno::Any >& lArguments)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
auto & cache = GetTheFilterCache();
@@ -167,7 +167,7 @@ css::uno::Reference< css::container::XEnumeration > SAL_CALL FilterFactory::crea
{
// SAFE -> ----------------------
{
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// May be not all filters was loaded ...
// But we need it now!
impl_loadOnDemand();
@@ -253,7 +253,7 @@ std::vector<OUString> FilterFactory::impl_queryMatchByDocumentService(const Quer
nEFlags = pIt->second.toInt32();
// SAFE -> ----------------------
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
// search suitable filters
FilterCache* pCache = impl_getWorkingCache();
@@ -409,7 +409,7 @@ std::vector<OUString> FilterFactory::impl_getSortedFilterList(const QueryTokeniz
std::vector<OUString> FilterFactory::impl_getListOfInstalledModules() const
{
// SAFE -> ----------------------
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aLock.clear();
// <- SAFE ----------------------
@@ -431,7 +431,7 @@ std::vector<OUString> FilterFactory::impl_getSortedFilterListForModule(const OUS
lIProps[PROPNAME_DOCUMENTSERVICE] <<= sModule;
// SAFE -> ----------------------
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
FilterCache* pCache = impl_getWorkingCache();
std::vector<OUString> lOtherFilters = pCache->getMatchingItemsByProps(FilterCache::E_FILTER, lIProps);
aLock.clear();
@@ -472,7 +472,7 @@ std::vector<OUString> FilterFactory::impl_getSortedFilterListForModule(const OUS
std::vector<OUString> FilterFactory::impl_readSortedFilterListFromConfig(const OUString& sModule) const
{
// SAFE -> ----------------------
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext;
aLock.clear();
// <- SAFE ----------------------

View File

@@ -51,7 +51,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL FrameLoaderFactory::createI
const css::uno::Sequence< css::uno::Any >& lArguments)
{
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
auto & cache = GetTheFilterCache();

View File

@@ -72,7 +72,7 @@ OUString SAL_CALL TypeDetection::queryTypeByURL(const OUString& sURL)
OUString sType;
// SAFE ->
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
css::util::URL aURL;
aURL.Complete = sURL;
@@ -377,7 +377,7 @@ OUString SAL_CALL TypeDetection::queryTypeByDescriptor(css::uno::Sequence< css::
try
{
// SAFE -> ----------------------------------
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
// parse given URL to split it into e.g. main and jump marks ...
sURL = stlDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_URL, OUString());
@@ -487,7 +487,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes
OUString sRealType = sType;
// SAFE ->
::osl::ResettableMutexGuard aLock(m_aLock);
::osl::ResettableMutexGuard aLock(m_aMutex);
// Attention: For executing next lines of code, We must be sure that
// all filters already loaded :-(
@@ -545,7 +545,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes
try
{
// SAFE ->
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
CacheItem aType = cache.getItem(FilterCache::E_TYPE, sType);
aType[PROPNAME_PREFERREDFILTER] >>= sFilter;
@@ -568,7 +568,7 @@ void TypeDetection::impl_checkResultsAndAddBestFilter(utl::MediaDescriptor& rDes
try
{
// SAFE ->
::osl::ResettableMutexGuard aLock(m_aLock);
::osl::ResettableMutexGuard aLock(m_aMutex);
// Attention: For executing next lines of code, We must be sure that
// all filters already loaded :-(
@@ -640,7 +640,7 @@ bool TypeDetection::impl_getPreselectionForType(
try
{
// SAFE -> --------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
aType = GetTheFilterCache().getItem(FilterCache::E_TYPE, sType);
// <- SAFE --------------------------
}
@@ -726,7 +726,7 @@ void TypeDetection::impl_getPreselectionForDocumentService(
try
{
// SAFE -> --------------------------
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
// Attention: For executing next lines of code, We must be sure that
// all filters already loaded :-(
@@ -764,7 +764,7 @@ OUString TypeDetection::impl_getTypeFromFilter(const OUString& rFilterName)
CacheItem aFilter;
try
{
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
aFilter = GetTheFilterCache().getItem(FilterCache::E_FILTER, rFilterName);
}
catch (const container::NoSuchElementException&)
@@ -786,7 +786,7 @@ void TypeDetection::impl_getAllFormatTypes(
std::vector<OUString> aFilterNames;
try
{
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
auto & cache = GetTheFilterCache();
cache.load(FilterCache::E_CONTAINS_FILTERS);
aFilterNames = cache.getItemNames(FilterCache::E_FILTER);
@@ -896,7 +896,7 @@ OUString TypeDetection::impl_detectTypeFlatAndDeep( utl::MediaDescriptor& r
try
{
// SAFE -> ----------------------------------
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
CacheItem aType = GetTheFilterCache().getItem(FilterCache::E_TYPE, sFlatType);
aLock.clear();
@@ -974,7 +974,7 @@ OUString TypeDetection::impl_askDetectService(const OUString& sDet
// SAFE ->
{
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
xContext = m_xContext;
}
// <- SAFE
@@ -1147,7 +1147,7 @@ bool TypeDetection::impl_validateAndSetTypeOnDescriptor( utl::MediaDescript
{
// SAFE ->
{
osl::MutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aMutex);
if (GetTheFilterCache().hasItem(FilterCache::E_TYPE, sType))
{
rDescriptor[utl::MediaDescriptor::PROP_TYPENAME] <<= sType;
@@ -1168,7 +1168,7 @@ bool TypeDetection::impl_validateAndSetFilterOnDescriptor( utl::MediaDescri
try
{
// SAFE ->
osl::ClearableMutexGuard aLock(m_aLock);
osl::ClearableMutexGuard aLock(m_aMutex);
auto & cache = GetTheFilterCache();
CacheItem aFilter = cache.getItem(FilterCache::E_FILTER, sFilter);

View File

@@ -27,6 +27,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <osl/mutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <editeng/editengdllapi.h>
namespace com::sun::star::accessibility { class XAccessibleStateSet; }
@@ -35,8 +36,6 @@ namespace com::sun::star::accessibility { struct AccessibleEventObject; }
namespace accessibility {
struct MutexOwner {mutable ::osl::Mutex maMutex;};
/** @descr
This base class provides an implementation of the
AccessibleContext service. Apart from the
@@ -44,7 +43,7 @@ struct MutexOwner {mutable ::osl::Mutex maMutex;};
interfaces it supports the XServiceInfo interface.
*/
class EDITENG_DLLPUBLIC AccessibleContextBase
: public MutexOwner,
: public cppu::BaseMutex,
public cppu::WeakComponentImplHelper<
css::accessibility::XAccessible,
css::accessibility::XAccessibleContext,

View File

@@ -38,12 +38,6 @@ namespace svt
{
struct TMutexInit
{
::osl::Mutex m_aLock;
};
/**
@descr implements a helper, which can be used to
convert vcl key codes into awt key codes ...
@@ -67,10 +61,11 @@ struct TMutexInit
Of course this queue will be stopped if the environment
will be destructed...
*/
class SVT_DLLPUBLIC AcceleratorExecute final : private TMutexInit
class SVT_DLLPUBLIC AcceleratorExecute final
{
// member
private:
::osl::Mutex m_aLock;
/** TODO document me */
css::uno::Reference< css::uno::XComponentContext > m_xContext;

View File

@@ -62,14 +62,6 @@ namespace vcl::unohelper {
);
};
struct MutexHelper
{
private:
::osl::Mutex maMutex;
public:
::osl::Mutex& GetMutex() { return maMutex; }
};
} // namespace vcl::unohelper
#endif // INCLUDED_VCL_UNOHELP2_HXX

View File

@@ -26,20 +26,17 @@
#include <com/sun/star/lang/XSingleComponentFactory.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/component_context.hxx>
#include <cppuhelper/basemutex.hxx>
#include <jvmaccess/virtualmachine.hxx>
#include <jvmaccess/unovirtualmachine.hxx>
#include <osl/mutex.hxx>
namespace {
struct MutexHolder
{
::osl::Mutex m_mutex;
};
typedef ::cppu::WeakComponentImplHelper<
css::lang::XSingleComponentFactory > t_impl;
class SingletonFactory : public MutexHolder, public t_impl
class SingletonFactory : public cppu::BaseMutex, public t_impl
{
::rtl::Reference< ::jvmaccess::UnoVirtualMachine > m_vm_access;
@@ -48,7 +45,7 @@ protected:
public:
explicit SingletonFactory( ::rtl::Reference< ::jvmaccess::UnoVirtualMachine > const & vm_access )
: t_impl( m_mutex ),
: t_impl( m_aMutex ),
m_vm_access( vm_access )
{}

View File

@@ -240,7 +240,7 @@ Reference<XAccessible> SAL_CALL
{
ThrowIfDisposed ();
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
if (mxAccessibleOLEObject.is())
if (nIndex == 0)
return mxAccessibleOLEObject;
@@ -260,7 +260,7 @@ uno::Reference<XAccessible > SAL_CALL
{
ThrowIfDisposed ();
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
uno::Reference<XAccessible> xChildAtPosition;
sal_Int32 nChildCount = getAccessibleChildCount ();
@@ -604,7 +604,7 @@ void AccessibleDocumentViewBase::SetAccessibleOLEObject (
// Assume that the accessible OLE Object disposes itself correctly.
{
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
mxAccessibleOLEObject = xOLEObject;
}
@@ -622,7 +622,7 @@ void AccessibleDocumentViewBase::SetAccessibleOLEObject (
::osl::Mutex&
AccessibleDocumentViewBase::implGetMutex()
{
return maMutex;
return m_aMutex;
}
// return ourself as context in default case
@@ -647,7 +647,7 @@ void
uno::Any SAL_CALL AccessibleDocumentViewBase::getExtendedAttributes()
{
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
uno::Any anyAttribute;
OUStringBuffer sValue;
@@ -766,7 +766,7 @@ sal_Int32 SAL_CALL AccessibleDocumentViewBase::getForeground( )
sal_Int32 SAL_CALL AccessibleDocumentViewBase::getBackground( )
{
ThrowIfDisposed ();
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
return sal_Int32(mpViewShell->GetView()->getColorConfig().GetColorValue( ::svtools::DOCCOLOR ).nColor);
}
} // end of namespace accessibility

View File

@@ -202,7 +202,7 @@ uno::Reference<XAccessible> SAL_CALL
{
ThrowIfDisposed ();
::osl::ClearableMutexGuard aGuard (maMutex);
::osl::ClearableMutexGuard aGuard (m_aMutex);
// Take care of children of the base class.
sal_Int32 nCount = AccessibleDocumentViewBase::getAccessibleChildCount();

View File

@@ -151,15 +151,10 @@ public:
On the other side there exists some interactions, which allow a retry.
So this helper allow to set a list of interactions combined with a retry value.
*/
struct ThreadHelpBase2
{
public:
mutable ::osl::Mutex m_aLock;
};
class PreventDuplicateInteraction final : private ThreadHelpBase2
, public ::cppu::WeakImplHelper<css::lang::XInitialization, css::task::XInteractionHandler2>
class PreventDuplicateInteraction final :
public ::cppu::WeakImplHelper<css::lang::XInitialization, css::task::XInteractionHandler2>
{
mutable ::osl::Mutex m_aLock;
// structs, types etc.
public:

View File

@@ -28,8 +28,7 @@
namespace sfx2 {
PreventDuplicateInteraction::PreventDuplicateInteraction(const css::uno::Reference< css::uno::XComponentContext >& rxContext)
: ThreadHelpBase2()
, m_xContext(rxContext)
: m_xContext(rxContext)
{
}

View File

@@ -85,7 +85,6 @@ class AsyncAccelExec : public cppu::WeakImplHelper<css::lang::XEventListener>
}
AcceleratorExecute::AcceleratorExecute()
: TMutexInit()
{
}

View File

@@ -142,7 +142,7 @@ typedef ::cppu::WeakImplHelper<
css::accessibility::XAccessibleTableSelection >
AccessibleTableHeaderShape_BASE;
class AccessibleTableHeaderShape final : public MutexOwner,
class AccessibleTableHeaderShape final : public cppu::BaseMutex,
public AccessibleTableHeaderShape_BASE
{
public:

View File

@@ -357,7 +357,7 @@ IMPLEMENT_GET_IMPLEMENTATION_ID( AccessibleControlShape )
void SAL_CALL AccessibleControlShape::propertyChange( const PropertyChangeEvent& _rEvent )
{
::osl::MutexGuard aGuard( maMutex );
::osl::MutexGuard aGuard( m_aMutex );
// check if it is the name or the description
if ( _rEvent.PropertyName == lcl_getNamePropertyName()
@@ -427,7 +427,7 @@ void SAL_CALL AccessibleControlShape::notifyEvent( const AccessibleEventObject&
AccessibleEventObject aTranslatedEvent( _rEvent );
{
::osl::MutexGuard aGuard( maMutex );
::osl::MutexGuard aGuard( m_aMutex );
// let the child manager translate the event
aTranslatedEvent.Source = *this;

View File

@@ -359,7 +359,7 @@ uno::Reference<XAccessible> SAL_CALL
uno::Reference<XAccessibleRelationSet> SAL_CALL
AccessibleShape::getAccessibleRelationSet()
{
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
if (mpParent == nullptr)
return uno::Reference<XAccessibleRelationSet>();
@@ -384,7 +384,7 @@ uno::Reference<XAccessibleRelationSet> SAL_CALL
uno::Reference<XAccessibleStateSet> SAL_CALL
AccessibleShape::getAccessibleStateSet()
{
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
if (IsDisposed())
{
@@ -456,7 +456,7 @@ uno::Reference<XAccessible > SAL_CALL
AccessibleShape::getAccessibleAtPoint (
const awt::Point& aPoint)
{
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
sal_Int32 nChildCount = getAccessibleChildCount ();
for (sal_Int32 i=0; i<nChildCount; ++i)
@@ -487,7 +487,7 @@ uno::Reference<XAccessible > SAL_CALL
awt::Rectangle SAL_CALL AccessibleShape::getBounds()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
ThrowIfDisposed ();
awt::Rectangle aBoundingBox;
@@ -896,7 +896,7 @@ uno::Sequence<uno::Type> SAL_CALL
void AccessibleShape::disposing (const lang::EventObject& aEvent)
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
try
{
@@ -1011,7 +1011,7 @@ OUString AccessibleShape::GetFullAccessibleName (AccessibleShape *shape)
void AccessibleShape::disposing()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
// Make sure to send an event that this object loses the focus in the
// case that it has the focus.

View File

@@ -71,7 +71,7 @@ ChildrenManagerImpl::ChildrenManagerImpl (
AccessibleContextBase& rContext)
: ::cppu::WeakComponentImplHelper<
css::document::XEventListener,
css::view::XSelectionChangeListener>(maMutex),
css::view::XSelectionChangeListener>(m_aMutex),
mxShapeList (rxShapeList),
mxParent (rxParent),
maShapeTreeInfo (rShapeTreeInfo),

View File

@@ -72,7 +72,7 @@ typedef ::std::vector<ChildDescriptor> ChildDescriptorListType;
@see ChildrenManager
*/
class ChildrenManagerImpl final
: public MutexOwner,
: public cppu::BaseMutex,
public cppu::WeakComponentImplHelper<
css::document::XEventListener,
css::view::XSelectionChangeListener>,

View File

@@ -181,7 +181,7 @@ Reference<XAccessible> SAL_CALL AccessibleCell::getAccessibleChild (sal_Int32 nI
Reference<XAccessibleStateSet> SAL_CALL AccessibleCell::getAccessibleStateSet()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
Reference<XAccessibleStateSet> xStateSet;
if (rBHelper.bDisposed || mpText == nullptr)
@@ -261,7 +261,7 @@ sal_Bool SAL_CALL AccessibleCell::containsPoint( const css::awt::Point& aPoint)
Reference<XAccessible > SAL_CALL AccessibleCell::getAccessibleAtPoint ( const css::awt::Point& aPoint)
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
sal_Int32 nChildCount = getAccessibleChildCount ();
for (sal_Int32 i=0; i<nChildCount; ++i)
@@ -291,7 +291,7 @@ Reference<XAccessible > SAL_CALL AccessibleCell::getAccessibleAtPoint ( const c
css::awt::Rectangle SAL_CALL AccessibleCell::getBounds()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
ThrowIfDisposed ();
css::awt::Rectangle aBoundingBox;
@@ -426,7 +426,7 @@ OUString SAL_CALL AccessibleCell::getToolTipText()
void SAL_CALL AccessibleCell::addAccessibleEventListener( const Reference<XAccessibleEventListener >& rxListener)
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
Reference<XInterface> xSource( static_cast<XComponent *>(this) );
@@ -489,7 +489,7 @@ void AccessibleCell::ViewForwarderChanged()
void AccessibleCell::disposing()
{
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard (maMutex);
::osl::MutexGuard aGuard (m_aMutex);
// Make sure to send an event that this object loses the focus in the
// case that it has the focus.

View File

@@ -22,6 +22,7 @@
#include <osl/mutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/factory.hxx>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <ucbhelper/content.hxx>
@@ -41,16 +42,11 @@ using namespace ::com::sun::star;
namespace
{
struct MutexHolder
{
mutable ::osl::Mutex m_mutex;
};
typedef ::cppu::WeakComponentImplHelper<
lang::XServiceInfo, ucb::XContentProvider > t_impl_helper;
class ExpandContentProviderImpl : protected MutexHolder, public t_impl_helper
class ExpandContentProviderImpl : protected cppu::BaseMutex, public t_impl_helper
{
uno::Reference< uno::XComponentContext > m_xComponentContext;
uno::Reference< util::XMacroExpander > m_xMacroExpander;
@@ -64,7 +60,7 @@ protected:
public:
explicit ExpandContentProviderImpl(
uno::Reference< uno::XComponentContext > const & xComponentContext )
: t_impl_helper( m_mutex ),
: t_impl_helper( m_aMutex ),
m_xComponentContext( xComponentContext ),
m_xMacroExpander( util::theMacroExpander::get(xComponentContext) )
{}

View File

@@ -26,10 +26,9 @@
#include <com/sun/star/datatransfer/dnd/XDropTargetDragContext.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTargetDropContext.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include <vcl/unohelp2.hxx>
class DNDListenerContainer final : public vcl::unohelper::MutexHelper,
class DNDListenerContainer final : public cppu::BaseMutex,
public ::cppu::WeakComponentImplHelper<
css::datatransfer::dnd::XDragGestureRecognizer,
css::datatransfer::dnd::XDropTargetDragContext,

View File

@@ -25,7 +25,7 @@ using namespace ::com::sun::star::datatransfer;
using namespace ::com::sun::star::datatransfer::dnd;
DNDListenerContainer::DNDListenerContainer( sal_Int8 nDefaultActions )
: WeakComponentImplHelper< XDragGestureRecognizer, XDropTargetDragContext, XDropTargetDropContext, XDropTarget >(GetMutex())
: WeakComponentImplHelper< XDragGestureRecognizer, XDropTargetDragContext, XDropTargetDropContext, XDropTarget >(m_aMutex)
{
m_bActive = true;
m_nDefaultActions = nDefaultActions;

View File

@@ -65,11 +65,6 @@ DWORD dndActionsToDropEffects(sal_Int8 actions);
// or Alt).
DWORD dndActionsToSingleDropEffect(sal_Int8 actions);
struct MutexDummy
{
osl::Mutex m_mutex;
};
extern css::uno::Reference<css::datatransfer::XTransferable> g_XTransferable;
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -51,7 +51,7 @@ using namespace com::sun::star::lang;
static unsigned __stdcall DndOleSTAFunc(LPVOID pParams);
DragSource::DragSource( const Reference<XComponentContext>& rxContext):
WeakComponentImplHelper< XDragSource, XInitialization, XServiceInfo >(m_mutex),
WeakComponentImplHelper< XDragSource, XInitialization, XServiceInfo >(m_aMutex),
m_xContext( rxContext ),
// m_pcurrentContext_impl(0),
m_hAppWindow(nullptr),

View File

@@ -23,6 +23,7 @@
#include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <osl/mutex.hxx>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include "globals.hxx"
@@ -43,7 +44,7 @@ class SourceContext;
// RIGHT MOUSE BUTTON drag and drop not supported currently.
// ALT modifier is considered to effect a user selection of effects
class DragSource:
public MutexDummy,
public cppu::BaseMutex,
public WeakComponentImplHelper<XDragSource, XInitialization, XServiceInfo>,
public IDropSource

View File

@@ -26,7 +26,7 @@ using namespace com::sun::star::datatransfer::dnd::DNDConstants;
SourceContext::SourceContext( DragSource* pSource,
const Reference<XDragSourceListener>& listener):
WeakComponentImplHelper<XDragSourceContext>(m_mutex),
WeakComponentImplHelper<XDragSourceContext>(m_aMutex),
m_pDragSource( pSource),
m_dragSource( static_cast<XDragSource*>( m_pDragSource) )
{

View File

@@ -20,6 +20,7 @@
#include <com/sun/star/datatransfer/dnd/XDragSourceContext.hpp>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/basemutex.hxx>
#include "source.hxx"
@@ -35,7 +36,7 @@ using namespace ::com::sun::star::lang;
// currently.
// An instance of SourceContext only lives as long as the drag and drop
// operation lasts.
class SourceContext : public MutexDummy, public WeakComponentImplHelper<XDragSourceContext>
class SourceContext : public cppu::BaseMutex, public WeakComponentImplHelper<XDragSourceContext>
{
DragSource* m_pDragSource;
Reference<XDragSource> m_dragSource;

View File

@@ -47,7 +47,7 @@ using namespace com::sun::star::datatransfer::dnd::DNDConstants;
DWORD WINAPI DndTargetOleSTAFunc(LPVOID pParams);
DropTarget::DropTarget( const Reference<XComponentContext>& rxContext):
WeakComponentImplHelper<XInitialization,XDropTarget, XServiceInfo>(m_mutex),
WeakComponentImplHelper<XInitialization,XDropTarget, XServiceInfo>(m_aMutex),
m_hWnd( nullptr),
m_threadIdWindow(0),
m_threadIdTarget(0),
@@ -291,7 +291,7 @@ sal_Bool SAL_CALL DropTarget::isActive( )
void SAL_CALL DropTarget::setActive( sal_Bool _b )
{
MutexGuard g(m_mutex);
MutexGuard g(m_aMutex);
m_bActive= _b;
}

View File

@@ -23,6 +23,7 @@
#include <com/sun/star/datatransfer/dnd/DropTargetDragEnterEvent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
#include <cppuhelper/interfacecontainer.hxx>
#include <osl/mutex.hxx>
@@ -49,7 +50,7 @@ using namespace ::com::sun::star::datatransfer::dnd;
// If the service calls OleInitialize then it also calls OleUnitialize when
// it is destroyed. Therefore no second instance may exist which was
// created in the same thread and still needs OLE.
class DropTarget : public MutexDummy,
class DropTarget : public cppu::BaseMutex,
public WeakComponentImplHelper<XInitialization, XDropTarget, XServiceInfo>
{