From e28207718cf83fa93bb1010a047fcb526d504e95 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 18 Mar 2014 14:34:20 +0100 Subject: [PATCH] Use SolarMutexGuard directly Change-Id: I0438d85b0c51010eff9e8d53ed8acada98563a20 --- framework/inc/xml/toolboxdocumenthandler.hxx | 5 ++--- .../source/fwe/xml/toolboxdocumenthandler.cxx | 15 ++++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/framework/inc/xml/toolboxdocumenthandler.hxx b/framework/inc/xml/toolboxdocumenthandler.hxx index f57ce625a9fe..c1c3b165c444 100644 --- a/framework/inc/xml/toolboxdocumenthandler.hxx +++ b/framework/inc/xml/toolboxdocumenthandler.hxx @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -36,7 +35,7 @@ namespace framework{ // Hash code function for using in all hash maps of follow implementation. -class FWE_DLLPUBLIC OReadToolBoxDocumentHandler : private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses. +class FWE_DLLPUBLIC OReadToolBoxDocumentHandler : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler > { public: @@ -152,7 +151,7 @@ class FWE_DLLPUBLIC OReadToolBoxDocumentHandler : private ThreadHelpBase, // S }; -class FWE_DLLPUBLIC OWriteToolBoxDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses. +class FWE_DLLPUBLIC OWriteToolBoxDocumentHandler { public: OWriteToolBoxDocumentHandler( diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index fcef4080f13b..854cb4b4fa03 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -20,7 +20,6 @@ #include -#include #include #include @@ -139,7 +138,6 @@ ToolBarEntryProperty ToolBoxEntries[OReadToolBoxDocumentHandler::TB_XML_ENTRY_CO }; OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XIndexContainer >& rItemContainer ) : - ThreadHelpBase( &Application::GetSolarMutex() ), m_rItemContainer( rItemContainer ), m_aType( ITEM_DESCRIPTOR_TYPE ), m_aLabel( ITEM_DESCRIPTOR_LABEL ), @@ -204,7 +202,7 @@ throw ( SAXException, RuntimeException, std::exception ) void SAL_CALL OReadToolBoxDocumentHandler::endDocument(void) throw( SAXException, RuntimeException, std::exception ) { - Guard aGuard( m_aLock ); + SolarMutexGuard g; if (( m_bToolBarStartFound && !m_bToolBarEndFound ) || ( !m_bToolBarStartFound && m_bToolBarEndFound ) ) @@ -219,7 +217,7 @@ void SAL_CALL OReadToolBoxDocumentHandler::startElement( const OUString& aName, const Reference< XAttributeList > &xAttribs ) throw( SAXException, RuntimeException, std::exception ) { - Guard aGuard( m_aLock ); + SolarMutexGuard g; ToolBoxHashMap::const_iterator pToolBoxEntry = m_aToolBoxMap.find( aName ) ; if ( pToolBoxEntry != m_aToolBoxMap.end() ) @@ -537,7 +535,7 @@ throw( SAXException, RuntimeException, std::exception ) void SAL_CALL OReadToolBoxDocumentHandler::endElement(const OUString& aName) throw( SAXException, RuntimeException, std::exception ) { - Guard aGuard( m_aLock ); + SolarMutexGuard g; ToolBoxHashMap::const_iterator pToolBoxEntry = m_aToolBoxMap.find( aName ) ; if ( pToolBoxEntry != m_aToolBoxMap.end() ) @@ -635,14 +633,14 @@ void SAL_CALL OReadToolBoxDocumentHandler::setDocumentLocator( const Reference< XLocator > &xLocator) throw( SAXException, RuntimeException, std::exception ) { - Guard aGuard( m_aLock ); + SolarMutexGuard g; m_xLocator = xLocator; } OUString OReadToolBoxDocumentHandler::getErrorLineString() { - Guard aGuard( m_aLock ); + SolarMutexGuard g; char buffer[32]; @@ -663,7 +661,6 @@ OUString OReadToolBoxDocumentHandler::getErrorLineString() OWriteToolBoxDocumentHandler::OWriteToolBoxDocumentHandler( const Reference< XIndexAccess >& rItemAccess, Reference< XDocumentHandler >& rWriteDocumentHandler ) : - ThreadHelpBase( &Application::GetSolarMutex() ), m_xWriteDocumentHandler( rWriteDocumentHandler ), m_rItemAccess( rItemAccess ) { @@ -681,7 +678,7 @@ OWriteToolBoxDocumentHandler::~OWriteToolBoxDocumentHandler() void OWriteToolBoxDocumentHandler::WriteToolBoxDocument() throw ( SAXException, RuntimeException ) { - Guard aGuard( m_aLock ); + SolarMutexGuard g; m_xWriteDocumentHandler->startDocument();