Kaydet (Commit) 8a2e5420 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use SolarMutexGuard directly

Change-Id: I0ff561aecfd16f59be90f054d076d771179c77cd
üst 98861476
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#ifndef INCLUDED_FRAMEWORK_INC_RECORDING_DISPATCHRECORDERSUPPLIER_HXX #ifndef INCLUDED_FRAMEWORK_INC_RECORDING_DISPATCHRECORDERSUPPLIER_HXX
#define INCLUDED_FRAMEWORK_INC_RECORDING_DISPATCHRECORDERSUPPLIER_HXX #define INCLUDED_FRAMEWORK_INC_RECORDING_DISPATCHRECORDERSUPPLIER_HXX
#include <threadhelp/threadhelpbase.hxx>
#include <macros/xinterface.hxx> #include <macros/xinterface.hxx>
#include <macros/xtypeprovider.hxx> #include <macros/xtypeprovider.hxx>
#include <macros/xserviceinfo.hxx> #include <macros/xserviceinfo.hxx>
...@@ -45,11 +44,7 @@ namespace framework{ ...@@ -45,11 +44,7 @@ namespace framework{
@threadsafe yes @threadsafe yes
*/ */
class DispatchRecorderSupplier : // baseclasses class DispatchRecorderSupplier : public ::cppu::WeakImplHelper2<
// Order is necessary for right initialization!
private ThreadHelpBase ,
// interfaces
public ::cppu::WeakImplHelper2<
css::lang::XServiceInfo , css::lang::XServiceInfo ,
css::frame::XDispatchRecorderSupplier > css::frame::XDispatchRecorderSupplier >
{ {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include <recording/dispatchrecordersupplier.hxx> #include <recording/dispatchrecordersupplier.hxx>
#include <threadhelp/guard.hxx>
#include <services.h> #include <services.h>
#include <com/sun/star/frame/XRecordableDispatch.hpp> #include <com/sun/star/frame/XRecordableDispatch.hpp>
...@@ -55,11 +54,7 @@ DEFINE_INIT_SERVICE( ...@@ -55,11 +54,7 @@ DEFINE_INIT_SERVICE(
it's not necessary to do anything here. it's not necessary to do anything here.
*/ */
DispatchRecorderSupplier::DispatchRecorderSupplier( const css::uno::Reference< css::lang::XMultiServiceFactory >& ) DispatchRecorderSupplier::DispatchRecorderSupplier( const css::uno::Reference< css::lang::XMultiServiceFactory >& )
// init baseclasses first! : m_xDispatchRecorder( NULL )
// Attention: Don't change order of initialization!
: ThreadHelpBase ( &Application::GetSolarMutex() )
// init member
, m_xDispatchRecorder( NULL )
{ {
} }
...@@ -95,10 +90,8 @@ DispatchRecorderSupplier::~DispatchRecorderSupplier() ...@@ -95,10 +90,8 @@ DispatchRecorderSupplier::~DispatchRecorderSupplier()
*/ */
void SAL_CALL DispatchRecorderSupplier::setDispatchRecorder( const css::uno::Reference< css::frame::XDispatchRecorder >& xRecorder ) throw (css::uno::RuntimeException, std::exception) void SAL_CALL DispatchRecorderSupplier::setDispatchRecorder( const css::uno::Reference< css::frame::XDispatchRecorder >& xRecorder ) throw (css::uno::RuntimeException, std::exception)
{ {
// SAFE => SolarMutexGuard g;
Guard aWriteLock(m_aLock);
m_xDispatchRecorder=xRecorder; m_xDispatchRecorder=xRecorder;
// => SAFE
} }
/** /**
...@@ -117,10 +110,8 @@ void SAL_CALL DispatchRecorderSupplier::setDispatchRecorder( const css::uno::Ref ...@@ -117,10 +110,8 @@ void SAL_CALL DispatchRecorderSupplier::setDispatchRecorder( const css::uno::Ref
*/ */
css::uno::Reference< css::frame::XDispatchRecorder > SAL_CALL DispatchRecorderSupplier::getDispatchRecorder() throw (css::uno::RuntimeException, std::exception) css::uno::Reference< css::frame::XDispatchRecorder > SAL_CALL DispatchRecorderSupplier::getDispatchRecorder() throw (css::uno::RuntimeException, std::exception)
{ {
// SAFE => SolarMutexGuard g;
Guard aReadLock(m_aLock);
return m_xDispatchRecorder; return m_xDispatchRecorder;
// => SAFE
} }
...@@ -141,11 +132,9 @@ void SAL_CALL DispatchRecorderSupplier::dispatchAndRecord( const css::util::URL& ...@@ -141,11 +132,9 @@ void SAL_CALL DispatchRecorderSupplier::dispatchAndRecord( const css::util::URL&
const css::uno::Sequence< css::beans::PropertyValue >& lArguments , const css::uno::Sequence< css::beans::PropertyValue >& lArguments ,
const css::uno::Reference< css::frame::XDispatch >& xDispatcher ) throw (css::uno::RuntimeException, std::exception) const css::uno::Reference< css::frame::XDispatch >& xDispatcher ) throw (css::uno::RuntimeException, std::exception)
{ {
// SAFE => SolarMutexClearableGuard aReadLock;
Guard aReadLock(m_aLock);
css::uno::Reference< css::frame::XDispatchRecorder > xRecorder = m_xDispatchRecorder; css::uno::Reference< css::frame::XDispatchRecorder > xRecorder = m_xDispatchRecorder;
aReadLock.unlock(); aReadLock.clear();
// => SAFE
// clear unspecific situations // clear unspecific situations
if (!xDispatcher.is()) if (!xDispatcher.is())
......
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