summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/commontools/paramwrapper.cxx19
-rw-r--r--include/connectivity/paramwrapper.hxx7
2 files changed, 10 insertions, 16 deletions
diff --git a/connectivity/source/commontools/paramwrapper.cxx b/connectivity/source/commontools/paramwrapper.cxx
index 36265d2324f0..9ab5293c2057 100644
--- a/connectivity/source/commontools/paramwrapper.cxx
+++ b/connectivity/source/commontools/paramwrapper.cxx
@@ -258,13 +258,11 @@ namespace dbtools::param
}
ParameterWrapperContainer::ParameterWrapperContainer()
- :ParameterWrapperContainer_Base( m_aMutex )
{
}
ParameterWrapperContainer::ParameterWrapperContainer( const Reference< XSingleSelectQueryAnalyzer >& _rxComposer )
- :ParameterWrapperContainer_Base( m_aMutex )
{
Reference< XParametersSupplier > xSuppParams( _rxComposer, UNO_QUERY_THROW );
Reference< XIndexAccess > xParameters( xSuppParams->getParameters(), css::uno::UNO_SET_THROW );
@@ -284,7 +282,7 @@ namespace dbtools::param
Type SAL_CALL ParameterWrapperContainer::getElementType()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
impl_checkDisposed_throw();
return cppu::UnoType<XPropertySet>::get();
}
@@ -292,7 +290,7 @@ namespace dbtools::param
sal_Bool SAL_CALL ParameterWrapperContainer::hasElements()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
impl_checkDisposed_throw();
return !m_aParameters.empty();
}
@@ -300,7 +298,7 @@ namespace dbtools::param
sal_Int32 SAL_CALL ParameterWrapperContainer::getCount()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
impl_checkDisposed_throw();
return m_aParameters.size();
}
@@ -308,7 +306,7 @@ namespace dbtools::param
Any SAL_CALL ParameterWrapperContainer::getByIndex( sal_Int32 _nIndex )
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
impl_checkDisposed_throw();
if ( ( _nIndex < 0 ) || ( o3tl::make_unsigned(_nIndex) >= m_aParameters.size() ) )
@@ -320,7 +318,7 @@ namespace dbtools::param
Reference< XEnumeration > ParameterWrapperContainer::createEnumeration()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
impl_checkDisposed_throw();
return new ::comphelper::OEnumerationByIndex( static_cast< XIndexAccess* >( this ) );
@@ -329,16 +327,13 @@ namespace dbtools::param
void ParameterWrapperContainer::impl_checkDisposed_throw()
{
- if ( rBHelper.bDisposed )
+ if ( m_bDisposed )
throw DisposedException( OUString(), *this );
}
- void SAL_CALL ParameterWrapperContainer::disposing()
+ void ParameterWrapperContainer::disposing(std::unique_lock<std::mutex>& /*rGuard*/)
{
- ::osl::MutexGuard aGuard( m_aMutex );
- impl_checkDisposed_throw();
-
for (const auto& rxParam : m_aParameters)
{
rxParam->dispose();
diff --git a/include/connectivity/paramwrapper.hxx b/include/connectivity/paramwrapper.hxx
index b862a619af85..5ad0fa1c1972 100644
--- a/include/connectivity/paramwrapper.hxx
+++ b/include/connectivity/paramwrapper.hxx
@@ -31,7 +31,7 @@
#include <comphelper/broadcasthelper.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/propshlp.hxx>
-#include <cppuhelper/compbase.hxx>
+#include <comphelper/compbase.hxx>
#include <memory>
#include <vector>
@@ -123,7 +123,7 @@ namespace dbtools::param
//= ParameterWrapperContainer
- typedef ::cppu::WeakComponentImplHelper < css::container::XIndexAccess
+ typedef ::comphelper::WeakComponentImplHelper < css::container::XIndexAccess
, css::container::XEnumerationAccess
> ParameterWrapperContainer_Base;
@@ -132,7 +132,6 @@ namespace dbtools::param
public ParameterWrapperContainer_Base
{
private:
- ::osl::Mutex m_aMutex;
Parameters m_aParameters;
virtual ~ParameterWrapperContainer() override;
@@ -177,7 +176,7 @@ namespace dbtools::param
private:
// XComponent
- virtual void SAL_CALL disposing() override;
+ virtual void disposing(std::unique_lock<std::mutex>& rGuard) override;
void impl_checkDisposed_throw();
};