Use SolarMutexGuard directly

Change-Id: I5408403318691f9b83c5b69658a37916fa23ea69
This commit is contained in:
Stephan Bergmann 2014-03-18 14:30:46 +01:00
parent 5e5c6656c9
commit 3b45c88a40
2 changed files with 8 additions and 12 deletions

View File

@ -24,7 +24,6 @@
#include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <threadhelp/threadhelpbase.hxx>
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
@ -37,7 +36,7 @@ namespace framework{
// Hash code function for using in all hash maps of follow implementation. // Hash code function for using in all hash maps of follow implementation.
class FWE_DLLPUBLIC OReadStatusBarDocumentHandler : private ThreadHelpBase, // Struct for right initalization of lock member! Must be first of baseclasses. class FWE_DLLPUBLIC OReadStatusBarDocumentHandler :
public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler > public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XDocumentHandler >
{ {
public: public:
@ -126,7 +125,7 @@ class FWE_DLLPUBLIC OReadStatusBarDocumentHandler : private ThreadHelpBase, // S
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator; ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > m_xLocator;
}; };
class FWE_DLLPUBLIC OWriteStatusBarDocumentHandler : private ThreadHelpBase // Struct for right initalization of lock member! Must be first of baseclasses. class FWE_DLLPUBLIC OWriteStatusBarDocumentHandler
{ {
public: public:
OWriteStatusBarDocumentHandler( OWriteStatusBarDocumentHandler(

View File

@ -20,7 +20,6 @@
#include <stdio.h> #include <stdio.h>
#include <threadhelp/guard.hxx>
#include <xml/statusbardocumenthandler.hxx> #include <xml/statusbardocumenthandler.hxx>
#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
@ -147,7 +146,6 @@ StatusBarEntryProperty StatusBarEntries[OReadStatusBarDocumentHandler::SB_XML_EN
OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler( OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler(
const Reference< XIndexContainer >& rStatusBarItems ) : const Reference< XIndexContainer >& rStatusBarItems ) :
ThreadHelpBase( &Application::GetSolarMutex() ),
m_aStatusBarItems( rStatusBarItems ) m_aStatusBarItems( rStatusBarItems )
{ {
OUString aNamespaceStatusBar( XMLNS_STATUSBAR ); OUString aNamespaceStatusBar( XMLNS_STATUSBAR );
@ -191,7 +189,7 @@ throw ( SAXException, RuntimeException, std::exception )
void SAL_CALL OReadStatusBarDocumentHandler::endDocument(void) void SAL_CALL OReadStatusBarDocumentHandler::endDocument(void)
throw( SAXException, RuntimeException, std::exception ) throw( SAXException, RuntimeException, std::exception )
{ {
Guard aGuard( m_aLock ); SolarMutexGuard g;
if (( m_bStatusBarStartFound && !m_bStatusBarEndFound ) || if (( m_bStatusBarStartFound && !m_bStatusBarEndFound ) ||
( !m_bStatusBarStartFound && m_bStatusBarEndFound ) ) ( !m_bStatusBarStartFound && m_bStatusBarEndFound ) )
@ -206,7 +204,7 @@ void SAL_CALL OReadStatusBarDocumentHandler::startElement(
const OUString& aName, const Reference< XAttributeList > &xAttribs ) const OUString& aName, const Reference< XAttributeList > &xAttribs )
throw( SAXException, RuntimeException, std::exception ) throw( SAXException, RuntimeException, std::exception )
{ {
Guard aGuard( m_aLock ); SolarMutexGuard g;
StatusBarHashMap::const_iterator pStatusBarEntry = m_aStatusBarMap.find( aName ) ; StatusBarHashMap::const_iterator pStatusBarEntry = m_aStatusBarMap.find( aName ) ;
if ( pStatusBarEntry != m_aStatusBarMap.end() ) if ( pStatusBarEntry != m_aStatusBarMap.end() )
@ -405,7 +403,7 @@ throw( SAXException, RuntimeException, std::exception )
void SAL_CALL OReadStatusBarDocumentHandler::endElement(const OUString& aName) void SAL_CALL OReadStatusBarDocumentHandler::endElement(const OUString& aName)
throw( SAXException, RuntimeException, std::exception ) throw( SAXException, RuntimeException, std::exception )
{ {
Guard aGuard( m_aLock ); SolarMutexGuard g;
StatusBarHashMap::const_iterator pStatusBarEntry = m_aStatusBarMap.find( aName ) ; StatusBarHashMap::const_iterator pStatusBarEntry = m_aStatusBarMap.find( aName ) ;
if ( pStatusBarEntry != m_aStatusBarMap.end() ) if ( pStatusBarEntry != m_aStatusBarMap.end() )
@ -464,14 +462,14 @@ void SAL_CALL OReadStatusBarDocumentHandler::setDocumentLocator(
const Reference< XLocator > &xLocator) const Reference< XLocator > &xLocator)
throw( SAXException, RuntimeException, std::exception ) throw( SAXException, RuntimeException, std::exception )
{ {
Guard aGuard( m_aLock ); SolarMutexGuard g;
m_xLocator = xLocator; m_xLocator = xLocator;
} }
OUString OReadStatusBarDocumentHandler::getErrorLineString() OUString OReadStatusBarDocumentHandler::getErrorLineString()
{ {
Guard aGuard( m_aLock ); SolarMutexGuard g;
char buffer[32]; char buffer[32];
@ -492,7 +490,6 @@ OUString OReadStatusBarDocumentHandler::getErrorLineString()
OWriteStatusBarDocumentHandler::OWriteStatusBarDocumentHandler( OWriteStatusBarDocumentHandler::OWriteStatusBarDocumentHandler(
const Reference< XIndexAccess >& aStatusBarItems, const Reference< XIndexAccess >& aStatusBarItems,
const Reference< XDocumentHandler >& rWriteDocumentHandler ) : const Reference< XDocumentHandler >& rWriteDocumentHandler ) :
ThreadHelpBase( &Application::GetSolarMutex() ),
m_aStatusBarItems( aStatusBarItems ), m_aStatusBarItems( aStatusBarItems ),
m_xWriteDocumentHandler( rWriteDocumentHandler ) m_xWriteDocumentHandler( rWriteDocumentHandler )
{ {
@ -510,7 +507,7 @@ OWriteStatusBarDocumentHandler::~OWriteStatusBarDocumentHandler()
void OWriteStatusBarDocumentHandler::WriteStatusBarDocument() throw void OWriteStatusBarDocumentHandler::WriteStatusBarDocument() throw
( SAXException, RuntimeException ) ( SAXException, RuntimeException )
{ {
Guard aGuard( m_aLock ); SolarMutexGuard g;
m_xWriteDocumentHandler->startDocument(); m_xWriteDocumentHandler->startDocument();