diff options
54 files changed, 600 insertions, 912 deletions
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx index 6f5bef666b70..c1b84654c6b8 100644 --- a/framework/inc/services/layoutmanager.hxx +++ b/framework/inc/services/layoutmanager.hxx @@ -22,8 +22,6 @@ #include <threadhelp/threadhelpbase.hxx> #include <threadhelp/resetableguard.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> #include <macros/xinterface.hxx> #include <macros/xtypeprovider.hxx> #include <properties.h> diff --git a/framework/inc/threadhelp/guard.hxx b/framework/inc/threadhelp/guard.hxx new file mode 100644 index 000000000000..9ba1f4a16df8 --- /dev/null +++ b/framework/inc/threadhelp/guard.hxx @@ -0,0 +1,71 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_FRAMEWORK_INC_THREADHELP_GUARD_HXX +#define INCLUDED_FRAMEWORK_INC_THREADHELP_GUARD_HXX + +#include <sal/config.h> + +#include <boost/noncopyable.hpp> + +#include <threadhelp/lockhelper.hxx> + +namespace framework{ + +class Guard : private boost::noncopyable +{ +public: + Guard( LockHelper& rLock ) + : m_pLock ( &rLock ) + , m_locked(false) + { + lock(); + } + + ~Guard() + { + unlock(); + } + + void lock() + { + if (!m_locked) { + m_pLock->acquire(); + m_locked = true; + } + } + + void unlock() + { + if (m_locked) { + m_pLock->release(); + m_locked = false; + } + } + +private: + LockHelper* m_pLock; + bool m_locked; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/threadhelp/readguard.hxx b/framework/inc/threadhelp/readguard.hxx deleted file mode 100644 index 4f9f07ec0bdd..000000000000 --- a/framework/inc/threadhelp/readguard.hxx +++ /dev/null @@ -1,169 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_FRAMEWORK_INC_THREADHELP_READGUARD_HXX -#define INCLUDED_FRAMEWORK_INC_THREADHELP_READGUARD_HXX - -#include <boost/noncopyable.hpp> -#include <threadhelp/lockhelper.hxx> - -#include <sal/types.h> - - -namespace framework{ - -/*-************************************************************************************************************ - @short implement a guard to set read locks - @descr This guard should be used to set a lock for reading object internal member. - Nobody can control it but don't use member after successfully locking for writing! - We never need a own mutex to safe our internal member access - because - a guard is used as function-local member only. There exist no multithreaded access to it really ... - - @attention To prevent us against wrong using, the default ctor, copy ctor and the =operator are maked private! - - @implements - - - @devstatus ready to use -*//*-*************************************************************************************************************/ -class ReadGuard : private boost::noncopyable -{ - - // public methods - - public: - - /*-**************************************************************************************************** - @short ctor - @descr These ctors initialize the guard with a reference to used lock member of object to protect. - Null isn't allowed as value! - - @seealso - - - @param "pLock" ,reference to used lock member of object to protect - @param "rLock" ,reference to used lock member of object to protect - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline ReadGuard( LockHelper* pLock ) - : m_pLock ( pLock ) - , m_bLocked ( sal_False ) - { - lock(); - } - - - inline ReadGuard( LockHelper& rLock ) - : m_pLock ( &rLock ) - , m_bLocked ( sal_False ) - { - lock(); - } - - /*-**************************************************************************************************** - @short dtor - @descr We unlock the used lock member automaticly if user forget it. - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline ~ReadGuard() - { - unlock(); - } - - /*-**************************************************************************************************** - @short set read lock - @descr Call this method to set the read lock. The call will block till all current threads are synchronized! - - @seealso method unlock() - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline void lock() - { - if( m_bLocked == sal_False ) - { - m_pLock->acquire(); - m_bLocked = sal_True; - } - } - - /*-**************************************************************************************************** - @short unset read lock - @descr Call this method to unlock the rw-lock temp.! - Normaly we do it at dtor automaticly for you ... - - @seealso method lock() - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline void unlock() - { - if( m_bLocked == sal_True ) - { - m_pLock->release(); - m_bLocked = sal_False; - } - } - - - // private methods - - private: - - /*-**************************************************************************************************** - @short disable using of these functions! - @descr It's not allowed to use this methods. Different problem can occur otherwise. - Thats why we disable it by make it private. - - @seealso other ctor - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - ReadGuard(); - - - // private member - - private: - - LockHelper* m_pLock ; /// reference to lock-member of protected object - sal_Bool m_bLocked ; /// protection against multiple lock calls without unlock! - -}; // class ReadGuard - -} // namespace framework - -#endif // INCLUDED_FRAMEWORK_INC_THREADHELP_READGUARD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/inc/threadhelp/writeguard.hxx b/framework/inc/threadhelp/writeguard.hxx deleted file mode 100644 index 516ea926d9f3..000000000000 --- a/framework/inc/threadhelp/writeguard.hxx +++ /dev/null @@ -1,165 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_FRAMEWORK_INC_THREADHELP_WRITEGUARD_HXX -#define INCLUDED_FRAMEWORK_INC_THREADHELP_WRITEGUARD_HXX - -#include <boost/noncopyable.hpp> -#include <threadhelp/lockhelper.hxx> - - -namespace framework{ - -/*-************************************************************************************************************ - @short implement a guard to set write locks - @descr This guard should be used to set a lock for reading AND writing object internal member. - We never need a own mutex to safe our internal member access - because - a guard is used as function-local member only. There exist no multithreaded access to it really ... - - @attention To prevent us against wrong using, the default ctor, copy ctor and the =operator are maked private! - - @implements - - - @devstatus ready to use -*//*-*************************************************************************************************************/ -class WriteGuard : private boost::noncopyable -{ - - // public methods - - public: - - /*-**************************************************************************************************** - @short ctor - @descr These ctors initialize the guard with a reference to used lock member of object to protect. - Null isn't allowed as value! - - @seealso - - - @param "pLock" ,reference to used lock member of object to protect - @param "rLock" ,reference to used lock member of object to protect - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline WriteGuard( LockHelper* pLock ) - : m_pLock ( pLock ) - , m_locked(false) - { - lock(); - } - - - inline WriteGuard( LockHelper& rLock ) - : m_pLock ( &rLock ) - , m_locked(false) - { - lock(); - } - - /*-**************************************************************************************************** - @short dtor - @descr We unlock the used lock member automaticly if user forget it. - - @seealso - - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline ~WriteGuard() - { - unlock(); - } - - /*-**************************************************************************************************** - @short set write lock - @descr Call this method to set the write lock. The call will block till all current threads are synchronized! - - @seealso method unlock() - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline void lock() - { - if (!m_locked) { - // Acquire write access and set return state. - // Mode is set later if it was successful! - m_pLock->acquire(); - m_locked = true; - } - } - - /*-**************************************************************************************************** - @short unset write lock - @descr Call this method to unlock the rw-lock temp.! - Normaly we do it at dtor automaticly for you ... - - @seealso method lock() - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - inline void unlock() - { - if (m_locked) { - m_pLock->release(); - m_locked = false; - } - } - - // private methods - - private: - - /*-**************************************************************************************************** - @short disable using of these functions! - @descr It's not allowed to use this methods. Different problem can occur otherwise. - Thats why we disable it by make it private. - - @seealso other ctor - - @param - - @return - - - @onerror - - *//*-*****************************************************************************************************/ - WriteGuard(); - - - // private member - - private: - - LockHelper* m_pLock ; /// reference to lock-member of protected object - bool m_locked; - -}; // class WriteGuard - -} // namespace framework - -#endif // INCLUDED_FRAMEWORK_INC_THREADHELP_WRITEGUARD_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/accelerators/acceleratorcache.cxx b/framework/source/accelerators/acceleratorcache.cxx index b5cdfc9627f5..d54cbf9ed1f9 100644 --- a/framework/source/accelerators/acceleratorcache.cxx +++ b/framework/source/accelerators/acceleratorcache.cxx @@ -20,8 +20,7 @@ #include <accelerators/acceleratorcache.hxx> #include <xml/acceleratorconfigurationreader.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <com/sun/star/container/ElementExistException.hpp> @@ -57,7 +56,7 @@ AcceleratorCache::~AcceleratorCache() void AcceleratorCache::takeOver(const AcceleratorCache& rCopy) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_lCommand2Keys = rCopy.m_lCommand2Keys; m_lKey2Commands = rCopy.m_lKey2Commands; @@ -77,7 +76,7 @@ AcceleratorCache& AcceleratorCache::operator=(const AcceleratorCache& rCopy) sal_Bool AcceleratorCache::hasKey(const css::awt::KeyEvent& aKey) const { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return (m_lKey2Commands.find(aKey) != m_lKey2Commands.end()); // <- SAFE ---------------------------------- @@ -87,7 +86,7 @@ sal_Bool AcceleratorCache::hasKey(const css::awt::KeyEvent& aKey) const sal_Bool AcceleratorCache::hasCommand(const OUString& sCommand) const { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return (m_lCommand2Keys.find(sCommand) != m_lCommand2Keys.end()); // <- SAFE ---------------------------------- @@ -99,7 +98,7 @@ AcceleratorCache::TKeyList AcceleratorCache::getAllKeys() const TKeyList lKeys; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); lKeys.reserve(m_lKey2Commands.size()); TKey2Commands::const_iterator pIt; @@ -122,7 +121,7 @@ void AcceleratorCache::setKeyCommandPair(const css::awt::KeyEvent& aKey , const OUString& sCommand) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // register command for the specified key m_lKey2Commands[aKey] = sCommand; @@ -141,7 +140,7 @@ AcceleratorCache::TKeyList AcceleratorCache::getKeysByCommand(const OUString& sC TKeyList lKeys; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); TCommand2Keys::const_iterator pCommand = m_lCommand2Keys.find(sCommand); if (pCommand == m_lCommand2Keys.end()) @@ -161,7 +160,7 @@ OUString AcceleratorCache::getCommandByKey(const css::awt::KeyEvent& aKey) const OUString sCommand; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); TKey2Commands::const_iterator pKey = m_lKey2Commands.find(aKey); if (pKey == m_lKey2Commands.end()) @@ -179,7 +178,7 @@ OUString AcceleratorCache::getCommandByKey(const css::awt::KeyEvent& aKey) const void AcceleratorCache::removeKey(const css::awt::KeyEvent& aKey) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // check if key exists TKey2Commands::const_iterator pKey = m_lKey2Commands.find(aKey); @@ -206,7 +205,7 @@ void AcceleratorCache::removeKey(const css::awt::KeyEvent& aKey) void AcceleratorCache::removeCommand(const OUString& sCommand) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); const TKeyList& lKeys = getKeysByCommand(sCommand); AcceleratorCache::TKeyList::const_iterator pKey ; diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 51078b5773df..56285782a7c5 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -25,8 +25,7 @@ #include <xml/acceleratorconfigurationreader.hxx> #include <xml/acceleratorconfigurationwriter.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <acceleratorconst.h> #include <services.h> @@ -93,7 +92,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XMLBasedAcceleratorConfigurati throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); AcceleratorCache& rCache = impl_getCFG(); AcceleratorCache::TKeyList lKeys = rCache.getAllKeys(); @@ -108,7 +107,7 @@ OUString SAL_CALL XMLBasedAcceleratorConfiguration::getCommandByKeyEvent(const c css::uno::RuntimeException, std::exception ) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); AcceleratorCache& rCache = impl_getCFG(); if (!rCache.hasKey(aKeyEvent)) @@ -144,7 +143,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE 1); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); AcceleratorCache& rCache = impl_getCFG(sal_True); // sal_True => force getting of a writeable cache! rCache.setKeyCommandPair(aKeyEvent, sCommand); @@ -159,7 +158,7 @@ throw(css::container::NoSuchElementException, css::uno::RuntimeException, std::exception ) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); AcceleratorCache& rCache = impl_getCFG(sal_True); // true => force using of a writeable cache if (!rCache.hasKey(aKeyEvent)) @@ -184,7 +183,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XMLBasedAcceleratorConfigurati 1); // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); AcceleratorCache& rCache = impl_getCFG(); if (!rCache.hasCommand(sCommand)) @@ -204,7 +203,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XMLBasedAcceleratorConfiguration::g css::uno::RuntimeException, std::exception ) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sal_Int32 i = 0; sal_Int32 c = lCommandList.getLength(); @@ -250,7 +249,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co 0); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); AcceleratorCache& rCache = impl_getCFG(sal_True); // sal_True => force getting of a writeable cache! if (!rCache.hasCommand(sCommand)) @@ -271,7 +270,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload() css::uno::Reference< css::io::XStream > xStreamNoLang; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::io::XStream > xStream = m_aPresetHandler.openTarget(PresetHandler::TARGET_CURRENT(), sal_True); // sal_True => open or create! try { @@ -291,7 +290,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload() // impl_ts_load() does not clear the cache // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_aReadCache = AcceleratorCache(); aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -314,7 +313,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::store() css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::io::XStream > xStream = m_aPresetHandler.openTarget(PresetHandler::TARGET_CURRENT(), sal_True); // sal_True => open or create! aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -365,7 +364,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::storeToStorage(const css::uno::R throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return (m_pWriteCache != 0); // <- SAFE ---------------------------------- } @@ -375,7 +374,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::storeToStorage(const css::uno::R throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::io::XStream > xStream = m_aPresetHandler.openTarget(PresetHandler::TARGET_CURRENT(), sal_True); // sal_True => open or create! aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -420,7 +419,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reset() throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_aPresetHandler.copyPresetToTarget(PresetHandler::PRESET_DEFAULT(), PresetHandler::TARGET_CURRENT()); aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -453,7 +452,7 @@ void XMLBasedAcceleratorConfiguration::changesOccurred(const OUString& /*sPath*/ void XMLBasedAcceleratorConfiguration::impl_ts_load(const css::uno::Reference< css::io::XInputStream >& xStream) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; if (m_pWriteCache) @@ -502,7 +501,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_load(const css::uno::Reference< c void XMLBasedAcceleratorConfiguration::impl_ts_save(const css::uno::Reference< css::io::XOutputStream >& xStream) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); AcceleratorCache aCache; sal_Bool bChanged = (m_pWriteCache != 0); @@ -534,7 +533,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_save(const css::uno::Reference< c // take over all changes into the original container // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // take over all changes into the readonly cache ... // and forget the copy-on-write copied cache @@ -555,7 +554,7 @@ void XMLBasedAcceleratorConfiguration::impl_ts_save(const css::uno::Reference< c AcceleratorCache& XMLBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bWriteAccessRequested) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); //create copy of our readonly-cache, if write access is forced ... but //not still possible! @@ -615,7 +614,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); AcceleratorCache::TKeyList lKeys = impl_getCFG(sal_True).getAllKeys(); //get keys from PrimaryKeys set @@ -637,7 +636,7 @@ OUString SAL_CALL XCUBasedAcceleratorConfiguration::getCommandByKeyEvent(const c css::uno::RuntimeException, std::exception ) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); AcceleratorCache& rPrimaryCache = impl_getCFG(sal_True ); AcceleratorCache& rSecondaryCache = impl_getCFG(sal_False); @@ -681,7 +680,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE 1); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); AcceleratorCache& rPrimaryCache = impl_getCFG(sal_True, sal_True ); // sal_True => force getting of a writeable cache! AcceleratorCache& rSecondaryCache = impl_getCFG(sal_False, sal_True); // sal_True => force getting of a writeable cache! @@ -748,7 +747,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeKeyEvent(const css::awt::K css::uno::RuntimeException, std::exception ) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); AcceleratorCache& rPrimaryCache = impl_getCFG(sal_True, sal_True ); AcceleratorCache& rSecondaryCache = impl_getCFG(sal_False, sal_True); @@ -798,7 +797,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati 1); // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); AcceleratorCache& rPrimaryCache = impl_getCFG(sal_True ); AcceleratorCache& rSecondaryCache = impl_getCFG(sal_False); @@ -845,7 +844,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XCUBasedAcceleratorConfiguration::g css::uno::RuntimeException, std::exception ) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sal_Int32 i = 0; sal_Int32 c = lCommandList.getLength(); @@ -895,7 +894,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co 0); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); AcceleratorCache& rPrimaryCache = impl_getCFG(sal_True, sal_True ); AcceleratorCache& rSecondaryCache = impl_getCFG(sal_False, sal_True); @@ -922,7 +921,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::reload() SAL_INFO( "fwk.accelerators", "XCUBasedAcceleratorConfiguration::reload()" ); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); sal_Bool bPreferred; css::uno::Reference< css::container::XNameAccess > xAccess; @@ -963,7 +962,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::store() SAL_INFO( "fwk.accelerators", "XCUBasedAcceleratorConfiguration::store()" ); // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sal_Bool bPreferred; css::uno::Reference< css::container::XNameAccess > xAccess; @@ -1010,7 +1009,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R // the original m_aCache has been split into primay cache and secondary cache... // we should merge them before storing to storage // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); AcceleratorCache aCache; if (m_pPrimaryWriteCache != 0) @@ -1350,7 +1349,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(sal_Bool bPreferred, const c // take over all changes into the original container // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_pPrimaryWriteCache) { @@ -1394,7 +1393,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(sal_Bool bPreferred, const c // take over all changes into the original container // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_pSecondaryWriteCache) { @@ -1559,7 +1558,7 @@ void XCUBasedAcceleratorConfiguration::reloadChanged( const OUString& sPrimarySe AcceleratorCache& XCUBasedAcceleratorConfiguration::impl_getCFG(sal_Bool bPreferred, sal_Bool bWriteAccessRequested) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (bPreferred) { diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx index e3881f8248f2..1824c409b7de 100644 --- a/framework/source/accelerators/documentacceleratorconfiguration.cxx +++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx @@ -25,8 +25,7 @@ #include <xml/acceleratorconfigurationwriter.hxx> #include <xml/saxnamespacefilter.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <acceleratorconst.h> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -116,7 +115,7 @@ DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lArguments) : DocumentAcceleratorConfiguration_BASE(xContext) { - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); css::uno::Reference<css::embed::XStorage> xRoot; if (lArguments.getLength() == 1 && (lArguments[0] >>= xRoot)) @@ -149,7 +148,7 @@ void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Refer // Attention! xStorage must be accepted too, if it's NULL ! // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); sal_Bool bForgetOldStorages = m_xDocumentRoot.is(); m_xDocumentRoot = xStorage; aWriteLock.unlock(); @@ -167,7 +166,7 @@ sal_Bool SAL_CALL DocumentAcceleratorConfiguration::hasStorage() throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_xDocumentRoot.is(); // <- SAFE ---------------------------------- } @@ -176,7 +175,7 @@ sal_Bool SAL_CALL DocumentAcceleratorConfiguration::hasStorage() void DocumentAcceleratorConfiguration::impl_ts_fillCache() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xDocumentRoot = m_xDocumentRoot; aReadLock.unlock(); // <- SAFE ---------------------------------- diff --git a/framework/source/accelerators/globalacceleratorconfiguration.cxx b/framework/source/accelerators/globalacceleratorconfiguration.cxx index 6233d40712ae..2824e97a559d 100644 --- a/framework/source/accelerators/globalacceleratorconfiguration.cxx +++ b/framework/source/accelerators/globalacceleratorconfiguration.cxx @@ -19,8 +19,6 @@ #include <accelerators/acceleratorconfiguration.hxx> #include <accelerators/presethandler.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> #include <helper/mischelper.hxx> #include <acceleratorconst.h> diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx index 5b832e2e4835..7614f49f2b69 100644 --- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx +++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx @@ -19,8 +19,7 @@ #include <accelerators/acceleratorconfiguration.hxx> #include <accelerators/presethandler.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include "helper/mischelper.hxx" #include <acceleratorconst.h> @@ -110,7 +109,7 @@ ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& lArguments) : ModuleAcceleratorConfiguration_BASE(xContext) { - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); OUString sModule; if (lArguments.getLength() == 1 && (lArguments[0] >>= sModule)) @@ -138,7 +137,7 @@ ModuleAcceleratorConfiguration::~ModuleAcceleratorConfiguration() void ModuleAcceleratorConfiguration::fillCache() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); m_sModuleCFG = m_sModule; aReadLock.unlock(); // <- SAFE ---------------------------------- diff --git a/framework/source/accelerators/presethandler.cxx b/framework/source/accelerators/presethandler.cxx index bc12a8e1bda7..8071fae3d71d 100644 --- a/framework/source/accelerators/presethandler.cxx +++ b/framework/source/accelerators/presethandler.cxx @@ -22,8 +22,7 @@ #include <classes/fwkresid.hxx> #include "classes/resource.hrc" -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <com/sun/star/beans/XPropertySet.hpp> @@ -147,7 +146,7 @@ PresetHandler::~PresetHandler() void PresetHandler::forgetCachedStorages() { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_eConfigType == E_DOCUMENT) { @@ -210,7 +209,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag return xRoot; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -268,7 +267,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag return xRoot; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -312,7 +311,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getOrCreateRootStorag css::uno::Reference< css::embed::XStorage > PresetHandler::getWorkingStorageShare() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_xWorkingStorageShare; // <- SAFE ---------------------------------- } @@ -321,7 +320,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getWorkingStorageShar css::uno::Reference< css::embed::XStorage > PresetHandler::getWorkingStorageUser() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_xWorkingStorageUser; // <- SAFE ---------------------------------- } @@ -330,7 +329,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getWorkingStorageUser css::uno::Reference< css::embed::XStorage > PresetHandler::getParentStorageShare(const css::uno::Reference< css::embed::XStorage >& /*xChild*/) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xWorking = m_xWorkingStorageShare; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -342,7 +341,7 @@ css::uno::Reference< css::embed::XStorage > PresetHandler::getParentStorageShare css::uno::Reference< css::embed::XStorage > PresetHandler::getParentStorageUser(const css::uno::Reference< css::embed::XStorage >& /*xChild*/) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xWorking = m_xWorkingStorageUser; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -360,7 +359,7 @@ void PresetHandler::connectToResource( PresetHandler::EConfigType // TODO free all current open storages! // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_eConfigType = eConfigType ; m_sResourceType = sResource ; @@ -565,7 +564,7 @@ void PresetHandler::copyPresetToTarget(const OUString& sPreset, // We try to open it and forward all errors to the user! // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xWorkingShare = m_xWorkingStorageShare; css::uno::Reference< css::embed::XStorage > xWorkingNoLang= m_xWorkingStorageNoLang; css::uno::Reference< css::embed::XStorage > xWorkingUser = m_xWorkingStorageUser ; @@ -605,7 +604,7 @@ css::uno::Reference< css::io::XStream > PresetHandler::openPreset(const OUString sal_Bool bUseNoLangGlobal) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xFolder = bUseNoLangGlobal? m_xWorkingStorageNoLang: m_xWorkingStorageShare; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -627,7 +626,7 @@ css::uno::Reference< css::io::XStream > PresetHandler::openTarget(const OUString sal_Bool bCreateIfMissing) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xFolder = m_xWorkingStorageUser; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -667,7 +666,7 @@ css::uno::Reference< css::io::XStream > PresetHandler::openTarget(const OUString void PresetHandler::commitUserChanges() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xWorking = m_xWorkingStorageUser; EConfigType eCfgType = m_eConfigType; aReadLock.unlock(); @@ -704,7 +703,7 @@ void PresetHandler::commitUserChanges() void PresetHandler::addStorageListener(IStorageListener* pListener) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); OUString sRelPath = m_sRelPathUser; // use user path ... because we dont work directly on the share layer! EConfigType eCfgType = m_eConfigType; aReadLock.unlock(); @@ -734,7 +733,7 @@ void PresetHandler::addStorageListener(IStorageListener* pListener) void PresetHandler::removeStorageListener(IStorageListener* pListener) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); OUString sRelPath = m_sRelPathUser; // use user path ... because we dont work directly on the share layer! EConfigType eCfgType = m_eConfigType; aReadLock.unlock(); diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx index e3bdfb1daebd..05227705618d 100644 --- a/framework/source/accelerators/storageholder.cxx +++ b/framework/source/accelerators/storageholder.cxx @@ -19,8 +19,7 @@ #include <accelerators/storageholder.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <com/sun/star/container/NoSuchElementException.hpp> @@ -65,7 +64,7 @@ StorageHolder::~StorageHolder() void StorageHolder::forgetCachedStorages() { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); TPath2StorageInfo::iterator pIt; for ( pIt = m_lStorages.begin(); @@ -86,7 +85,7 @@ void StorageHolder::forgetCachedStorages() void StorageHolder::setRootStorage(const css::uno::Reference< css::embed::XStorage >& xRoot) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xRoot = xRoot; aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -96,7 +95,7 @@ void StorageHolder::setRootStorage(const css::uno::Reference< css::embed::XStora css::uno::Reference< css::embed::XStorage > StorageHolder::getRootStorage() const { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_xRoot; // <- SAFE ---------------------------------- } @@ -109,7 +108,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri OUStringList lFolders = StorageHolder::impl_st_parsePath(sNormedPath); // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::embed::XStorage > xParent = m_xRoot; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -167,7 +166,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri } // SAFE -> ------------------------------ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); pInfo = &(m_lStorages[sCheckPath]); pInfo->Storage = xChild; pInfo->UseCount = 1; @@ -197,7 +196,7 @@ StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sP OUStringList::const_iterator pIt ; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); for ( pIt = lFolders.begin(); pIt != lFolders.end() ; @@ -248,7 +247,7 @@ void StorageHolder::commitPath(const OUString& sPath) } // SAFE -> ------------------------------ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); xCommit = css::uno::Reference< css::embed::XTransactedObject >(m_xRoot, css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE ------------------------------ @@ -282,7 +281,7 @@ void StorageHolder::closePath(const OUString& rPath) } // SAFE -> ------------------------------ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); OUStringList::reverse_iterator pIt2; for ( pIt2 = lFolders.rbegin(); @@ -313,7 +312,7 @@ void StorageHolder::notifyPath(const OUString& sPath) OUString sNormedPath = StorageHolder::impl_st_normPath(sPath); // SAFE -> ------------------------------ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); TPath2StorageInfo::iterator pIt1 = m_lStorages.find(sNormedPath); if (pIt1 == m_lStorages.end()) @@ -341,7 +340,7 @@ void StorageHolder::addStorageListener( IStorageListener* pListener, OUString sNormedPath = StorageHolder::impl_st_normPath(sPath); // SAFE -> ------------------------------ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); TPath2StorageInfo::iterator pIt1 = m_lStorages.find(sNormedPath); if (pIt1 == m_lStorages.end()) @@ -363,7 +362,7 @@ void StorageHolder::removeStorageListener( IStorageListener* pListener, OUString sNormedPath = StorageHolder::impl_st_normPath(sPath); // SAFE -> ------------------------------ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); TPath2StorageInfo::iterator pIt1 = m_lStorages.find(sNormedPath); if (pIt1 == m_lStorages.end()) @@ -382,7 +381,7 @@ void StorageHolder::removeStorageListener( IStorageListener* pListener, OUString StorageHolder::getPathOfStorage(const css::uno::Reference< css::embed::XStorage >& xStorage) { // SAFE -> ------------------------------ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); TPath2StorageInfo::const_iterator pIt; for ( pIt = m_lStorages.begin(); @@ -426,7 +425,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::getParentStorage(cons return css::uno::Reference< css::embed::XStorage >(); // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // b) if (c < 2) @@ -457,7 +456,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::getParentStorage(cons void StorageHolder::operator=(const StorageHolder& rCopy) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xRoot = rCopy.m_xRoot; m_lStorages = rCopy.m_lStorages; diff --git a/framework/source/classes/framecontainer.cxx b/framework/source/classes/framecontainer.cxx index 34f6b5b474d5..63fa123c8982 100644 --- a/framework/source/classes/framecontainer.cxx +++ b/framework/source/classes/framecontainer.cxx @@ -18,8 +18,7 @@ */ #include <classes/framecontainer.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <com/sun/star/frame/FrameSearchFlag.hpp> @@ -72,7 +71,7 @@ void FrameContainer::append( const css::uno::Reference< css::frame::XFrame >& xF if (xFrame.is() && ! exist(xFrame)) { /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aContainer.push_back( xFrame ); aWriteLock.unlock(); /* } SAFE */ @@ -94,7 +93,7 @@ void FrameContainer::remove( const css::uno::Reference< css::frame::XFrame >& xF { /* SAFE { */ // write lock necessary for follwing erase()! - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); TFrameIterator aSearchedItem = ::std::find( m_aContainer.begin(), m_aContainer.end(), xFrame ); if (aSearchedItem!=m_aContainer.end()) @@ -125,7 +124,7 @@ void FrameContainer::remove( const css::uno::Reference< css::frame::XFrame >& xF sal_Bool FrameContainer::exist( const css::uno::Reference< css::frame::XFrame >& xFrame ) const { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return( ::std::find( m_aContainer.begin(), m_aContainer.end(), xFrame ) != m_aContainer.end() ); /* } SAFE */ } @@ -139,7 +138,7 @@ sal_Bool FrameContainer::exist( const css::uno::Reference< css::frame::XFrame >& void FrameContainer::clear() { // SAFE { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); // Clear the container ... m_aContainer.clear(); @@ -166,7 +165,7 @@ void FrameContainer::clear() sal_uInt32 FrameContainer::getCount() const { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return( (sal_uInt32)m_aContainer.size() ); /* } SAFE */ } @@ -194,7 +193,7 @@ css::uno::Reference< css::frame::XFrame > FrameContainer::operator[]( sal_uInt32 // Get element form container WITH automatic test of ranges! // If index not valid, a out_of_range exception is thrown. /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); xFrame = m_aContainer.at( nIndex ); aReadLock.unlock(); /* } SAFE */ @@ -219,7 +218,7 @@ css::uno::Reference< css::frame::XFrame > FrameContainer::operator[]( sal_uInt32 css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > FrameContainer::getAllElements() const { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); sal_Int32 nPosition = 0; css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > lElements ( (sal_uInt32)m_aContainer.size() ); @@ -247,7 +246,7 @@ void FrameContainer::setActive( const css::uno::Reference< css::frame::XFrame >& if ( !xFrame.is() || exist(xFrame) ) { /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xActiveFrame = xFrame; aWriteLock.unlock(); /* } SAFE */ @@ -267,7 +266,7 @@ void FrameContainer::setActive( const css::uno::Reference< css::frame::XFrame >& css::uno::Reference< css::frame::XFrame > FrameContainer::getActive() const { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xActiveFrame; /* } SAFE */ } @@ -286,7 +285,7 @@ css::uno::Reference< css::frame::XFrame > FrameContainer::getActive() const css::uno::Reference< css::frame::XFrame > FrameContainer::searchOnAllChildrens( const OUString& sName ) const { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // Step over all child frames. But if direct child isn't the right one search on his children first - before // you go to next direct child of this container! @@ -324,7 +323,7 @@ css::uno::Reference< css::frame::XFrame > FrameContainer::searchOnAllChildrens( css::uno::Reference< css::frame::XFrame > FrameContainer::searchOnDirectChildrens( const OUString& sName ) const { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::frame::XFrame > xSearchedFrame; for( TConstFrameIterator pIterator=m_aContainer.begin(); pIterator!=m_aContainer.end(); ++pIterator ) diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index 0f508701ea14..b63c9267947b 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -18,7 +18,7 @@ */ #include <classes/taskcreator.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <loadenv/targethelper.hxx> #include <services.h> #include <taskcreatordefs.hxx> @@ -64,7 +64,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUStrin sal_Bool bVisible ) { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); /* } SAFE */ diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index 042250975ecc..f21ec96b9395 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -19,8 +19,7 @@ #include <dispatch/closedispatcher.hxx> #include <pattern/frame.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <framework/framelistanalyzer.hxx> #include <services.h> #include <general.h> @@ -150,7 +149,7 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL& throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // This reference indicates, that we was already called before and // our asynchronous process was not finished yet. @@ -260,7 +259,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback) sal_Bool bControllerSuspended = sal_False; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // Closing of all views, related to the same document, is allowed // only if the dispatched URL was ".uno:CloseDoc"! @@ -411,7 +410,7 @@ IMPL_LINK_NOARG(CloseDispatcher, impl_asyncCallback) implts_notifyResultListener(xListener, nState, css::uno::Any()); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // This method was called asynchronous from our main thread by using a pointer. // We reached this method only, by using a reference to ourself :-) @@ -450,7 +449,7 @@ sal_Bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Referenc if (bCloseAllOtherViewsToo) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -490,7 +489,7 @@ sal_Bool CloseDispatcher::implts_prepareFrameForClosing(const css::uno::Referenc sal_Bool CloseDispatcher::implts_closeFrame() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -506,7 +505,7 @@ sal_Bool CloseDispatcher::implts_closeFrame() return sal_False; // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xCloseFrame = css::uno::WeakReference< css::frame::XFrame >(); aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -518,7 +517,7 @@ sal_Bool CloseDispatcher::implts_closeFrame() sal_Bool CloseDispatcher::implts_establishBackingMode() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; css::uno::Reference< css::frame::XFrame > xFrame (m_xCloseFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); @@ -549,7 +548,7 @@ sal_Bool CloseDispatcher::implts_establishBackingMode() sal_Bool CloseDispatcher::implts_terminateApplication() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx b/framework/source/dispatch/dispatchinformationprovider.cxx index 84eb4316ab87..0c7a7494a6b7 100644 --- a/framework/source/dispatch/dispatchinformationprovider.cxx +++ b/framework/source/dispatch/dispatchinformationprovider.cxx @@ -19,8 +19,7 @@ #include <dispatch/dispatchinformationprovider.hxx> #include <dispatch/closedispatcher.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <stdtypes.h> #include <services.h> @@ -132,7 +131,7 @@ css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL DispatchInformati css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > DispatchInformationProvider::implts_getAllSubProvider() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); diff --git a/framework/source/dispatch/dispatchprovider.cxx b/framework/source/dispatch/dispatchprovider.cxx index 2f855dfd5e10..7fc0208d9ea2 100644 --- a/framework/source/dispatch/dispatchprovider.cxx +++ b/framework/source/dispatch/dispatchprovider.cxx @@ -27,8 +27,7 @@ #include <pattern/window.hxx> #include <threadhelp/transactionguard.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <dispatchcommands.h> #include <protocols.h> #include <services.h> @@ -107,7 +106,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL DispatchProvider::queryDis css::uno::Reference< css::frame::XDispatch > xDispatcher; /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::frame::XFrame > xOwner( m_xFrame.get(), css::uno::UNO_QUERY ); aReadLock.unlock(); /* } SAFE */ @@ -492,7 +491,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_searchProt if (m_aProtocolHandlerCache.search(aURL,&aHandler)) { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // create it css::uno::Reference< css::frame::XDispatchProvider > xHandler; @@ -568,7 +567,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat css::uno::Reference< css::frame::XDispatch > xDispatchHelper; /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); /* } SAFE */ @@ -580,7 +579,7 @@ css::uno::Reference< css::frame::XDispatch > DispatchProvider::implts_getOrCreat // Attention: Such menue dispatcher must be a singleton for this frame - means our owner frame. // Otherwhise he can make some trouble. /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( ! m_xMenuDispatcher.is() ) { MenuDispatcher* pDispatcher = new MenuDispatcher( xContext, xOwner ); diff --git a/framework/source/dispatch/interceptionhelper.cxx b/framework/source/dispatch/interceptionhelper.cxx index 370d07674063..6bed175da04c 100644 --- a/framework/source/dispatch/interceptionhelper.cxx +++ b/framework/source/dispatch/interceptionhelper.cxx @@ -18,8 +18,7 @@ */ #include <dispatch/interceptionhelper.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <com/sun/star/frame/XInterceptorInfo.hpp> @@ -53,7 +52,7 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL InterceptionHelper::queryD throw(css::uno::RuntimeException, std::exception) { // SAFE { - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // a) first search an interceptor, which match to this URL by it's URL pattern registration // Note: if it return NULL - it does not mean an empty interceptor list automaticly! @@ -126,7 +125,7 @@ void SAL_CALL InterceptionHelper::registerDispatchProviderInterceptor(const css: } // SAFE { - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // a) no interceptor at all - set this instance as master for given interceptor // and set our slave as it's slave - and put this interceptor to the list. @@ -191,7 +190,7 @@ void SAL_CALL InterceptionHelper::releaseDispatchProviderInterceptor(const css:: throw css::uno::RuntimeException("NULL references not allowed as in parameter", xThis); // SAFE { - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // search this interceptor ... // If it could be located inside cache - @@ -235,7 +234,7 @@ void SAL_CALL InterceptionHelper::disposing(const css::lang::EventObject& aEvent { #ifdef FORCE_DESTRUCTION_OF_INTERCEPTION_CHAIN // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // check calli ... we accept such disposing call's only from our onwer frame. css::uno::Reference< css::frame::XFrame > xOwner(m_xOwnerWeak.get(), css::uno::UNO_QUERY); diff --git a/framework/source/dispatch/loaddispatcher.cxx b/framework/source/dispatch/loaddispatcher.cxx index b028e5fd9f80..3d90d03b786d 100644 --- a/framework/source/dispatch/loaddispatcher.cxx +++ b/framework/source/dispatch/loaddispatcher.cxx @@ -18,8 +18,7 @@ */ #include <dispatch/loaddispatcher.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <com/sun/star/frame/DispatchResultState.hpp> @@ -87,7 +86,7 @@ css::uno::Any LoadDispatcher::impl_dispatch( const css::util::URL& rURL, css::uno::Reference< css::uno::XInterface > xThis(static_cast< css::frame::XNotifyingDispatch* >(this), css::uno::UNO_QUERY); // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // We are the only client of this load env object ... but // may a dispatch request before is still in progress (?!). diff --git a/framework/source/dispatch/mailtodispatcher.cxx b/framework/source/dispatch/mailtodispatcher.cxx index 72df6a7bd7b1..0be69d9e06c0 100644 --- a/framework/source/dispatch/mailtodispatcher.cxx +++ b/framework/source/dispatch/mailtodispatcher.cxx @@ -18,7 +18,7 @@ */ #include <dispatch/mailtodispatcher.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -202,7 +202,7 @@ sal_Bool MailToDispatcher::implts_dispatch( const css::util::URL& css::uno::Reference< css::uno::XComponentContext > xContext; /* SAFE */{ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); xContext = m_xContext; /* SAFE */} diff --git a/framework/source/dispatch/oxt_handler.cxx b/framework/source/dispatch/oxt_handler.cxx index dfaea211947e..de0fa0bdc3cb 100644 --- a/framework/source/dispatch/oxt_handler.cxx +++ b/framework/source/dispatch/oxt_handler.cxx @@ -19,8 +19,6 @@ #include <dispatch/oxt_handler.hxx> #include <threadhelp/transactionguard.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> #include <services.h> #include <unotools/mediadescriptor.hxx> diff --git a/framework/source/dispatch/popupmenudispatcher.cxx b/framework/source/dispatch/popupmenudispatcher.cxx index bc12aa3c9d1d..1419cfe050aa 100644 --- a/framework/source/dispatch/popupmenudispatcher.cxx +++ b/framework/source/dispatch/popupmenudispatcher.cxx @@ -21,9 +21,8 @@ #include <general.h> #include <framework/menuconfiguration.hxx> #include <framework/addonmenu.hxx> -#include <threadhelp/readguard.hxx> #include <threadhelp/resetableguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <properties.h> @@ -150,7 +149,7 @@ throw( css::uno::Exception, css::uno::RuntimeException, std::exception) css::uno::Reference< css::frame::XFrame > xFrame; /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); for (int a=0; a<lArguments.getLength(); ++a) { diff --git a/framework/source/dispatch/servicehandler.cxx b/framework/source/dispatch/servicehandler.cxx index 766009f421d0..66a7c99d84c6 100644 --- a/framework/source/dispatch/servicehandler.cxx +++ b/framework/source/dispatch/servicehandler.cxx @@ -18,7 +18,7 @@ */ #include <dispatch/servicehandler.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -200,7 +200,7 @@ css::uno::Reference< css::uno::XInterface > ServiceHandler::implts_dispatch( con const css::uno::Sequence< css::beans::PropertyValue >& /*lArguments*/ ) throw( css::uno::RuntimeException ) { /* SAFE */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::lang::XMultiServiceFactory > xFactory = m_xFactory; aReadLock.unlock(); /* SAFE */ diff --git a/framework/source/dispatch/startmoduledispatcher.cxx b/framework/source/dispatch/startmoduledispatcher.cxx index 90c5b6e613c4..ce08b00f8af6 100644 --- a/framework/source/dispatch/startmoduledispatcher.cxx +++ b/framework/source/dispatch/startmoduledispatcher.cxx @@ -21,8 +21,7 @@ #include <dispatch/startmoduledispatcher.hxx> #include <pattern/frame.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <framework/framelistanalyzer.hxx> #include <dispatchcommands.h> #include <targets.h> @@ -133,7 +132,7 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere return sal_False; // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -164,7 +163,7 @@ void SAL_CALL StartModuleDispatcher::removeStatusListener(const css::uno::Refere ::sal_Bool StartModuleDispatcher::implts_establishBackingMode() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- diff --git a/framework/source/dispatch/systemexec.cxx b/framework/source/dispatch/systemexec.cxx index 183304506098..97a30ecd57c6 100644 --- a/framework/source/dispatch/systemexec.cxx +++ b/framework/source/dispatch/systemexec.cxx @@ -18,7 +18,7 @@ */ #include <dispatch/systemexec.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -123,7 +123,7 @@ void SAL_CALL SystemExec::dispatchWithNotification( const css::util::URL& OUString sSystemURLWithVariables = aURL.Complete.copy(PROTOCOL_LENGTH, c); // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE diff --git a/framework/source/dispatch/windowcommanddispatch.cxx b/framework/source/dispatch/windowcommanddispatch.cxx index d19695d0bd69..51b88ff18ea5 100644 --- a/framework/source/dispatch/windowcommanddispatch.cxx +++ b/framework/source/dispatch/windowcommanddispatch.cxx @@ -18,8 +18,7 @@ */ #include <dispatch/windowcommanddispatch.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <targets.h> #include <services.h> @@ -59,7 +58,7 @@ WindowCommandDispatch::~WindowCommandDispatch() void WindowCommandDispatch::impl_startListening() { - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), css::uno::UNO_QUERY ); aReadLock.unlock(); @@ -79,7 +78,7 @@ void WindowCommandDispatch::impl_startListening() void WindowCommandDispatch::impl_stopListening() { - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), css::uno::UNO_QUERY ); aReadLock.unlock(); @@ -153,7 +152,7 @@ void WindowCommandDispatch::impl_dispatchCommand(const OUString& sCommand) try { // SYNCHRONIZED -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XDispatchProvider > xProvider(m_xFrame.get(), css::uno::UNO_QUERY_THROW); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); diff --git a/framework/source/fwe/classes/framelistanalyzer.cxx b/framework/source/fwe/classes/framelistanalyzer.cxx index 2aad958b80c5..a3fdea31db7e 100644 --- a/framework/source/fwe/classes/framelistanalyzer.cxx +++ b/framework/source/fwe/classes/framelistanalyzer.cxx @@ -19,8 +19,6 @@ #include "framework/framelistanalyzer.hxx" -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> #include <targets.h> #include <properties.h> #include <services.h> diff --git a/framework/source/fwi/classes/propertysethelper.cxx b/framework/source/fwi/classes/propertysethelper.cxx index dc11383da943..6e8cb073d699 100644 --- a/framework/source/fwi/classes/propertysethelper.cxx +++ b/framework/source/fwi/classes/propertysethelper.cxx @@ -19,9 +19,7 @@ #include <classes/propertysethelper.hxx> #include <threadhelp/transactionguard.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> - +#include <threadhelp/guard.hxx> namespace framework{ @@ -49,7 +47,7 @@ void PropertySetHelper::impl_setPropertyChangeBroadcaster(const css::uno::Refere TransactionGuard aTransaction(m_rTransactionManager, E_SOFTEXCEPTIONS); // SAFE -> - WriteGuard aWriteLock(m_rLock); + Guard aWriteLock(m_rLock); m_xBroadcaster = xBroadcaster; aWriteLock.unlock(); // <- SAFE @@ -63,7 +61,7 @@ void SAL_CALL PropertySetHelper::impl_addPropertyInfo(const css::beans::Property TransactionGuard aTransaction(m_rTransactionManager, E_SOFTEXCEPTIONS); // SAFE -> - WriteGuard aWriteLock(m_rLock); + Guard aWriteLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(aProperty.Name); if (pIt != m_lProps.end()) @@ -81,7 +79,7 @@ void SAL_CALL PropertySetHelper::impl_removePropertyInfo(const OUString& sProper TransactionGuard aTransaction(m_rTransactionManager, E_SOFTEXCEPTIONS); // SAFE -> - WriteGuard aWriteLock(m_rLock); + Guard aWriteLock(m_rLock); PropertySetHelper::TPropInfoHash::iterator pIt = m_lProps.find(sProperty); if (pIt == m_lProps.end()) @@ -102,7 +100,7 @@ void SAL_CALL PropertySetHelper::impl_disablePropertySet() TransactionGuard aTransaction(m_rTransactionManager, E_SOFTEXCEPTIONS); // SAFE -> - WriteGuard aWriteLock(m_rLock); + Guard aWriteLock(m_rLock); css::uno::Reference< css::uno::XInterface > xThis(static_cast< css::beans::XPropertySet* >(this), css::uno::UNO_QUERY); css::lang::EventObject aEvent(xThis); @@ -195,7 +193,7 @@ void SAL_CALL PropertySetHelper::setPropertyValue(const OUString& sProperty, TransactionGuard aTransaction(m_rTransactionManager, E_HARDEXCEPTIONS); // SAFE -> - WriteGuard aWriteLock(m_rLock); + Guard aWriteLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(sProperty); if (pIt == m_lProps.end()) @@ -256,7 +254,7 @@ css::uno::Any SAL_CALL PropertySetHelper::getPropertyValue(const OUString& sProp TransactionGuard aTransaction(m_rTransactionManager, E_HARDEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(sProperty); if (pIt == m_lProps.end()) @@ -280,7 +278,7 @@ void SAL_CALL PropertySetHelper::addPropertyChangeListener(const OUString& TransactionGuard aTransaction(m_rTransactionManager, E_HARDEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(sProperty); if (pIt == m_lProps.end()) @@ -302,7 +300,7 @@ void SAL_CALL PropertySetHelper::removePropertyChangeListener(const OUString& TransactionGuard aTransaction(m_rTransactionManager, E_SOFTEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(sProperty); if (pIt == m_lProps.end()) @@ -324,7 +322,7 @@ void SAL_CALL PropertySetHelper::addVetoableChangeListener(const OUString& TransactionGuard aTransaction(m_rTransactionManager, E_HARDEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(sProperty); if (pIt == m_lProps.end()) @@ -346,7 +344,7 @@ void SAL_CALL PropertySetHelper::removeVetoableChangeListener(const OUString& TransactionGuard aTransaction(m_rTransactionManager, E_SOFTEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(sProperty); if (pIt == m_lProps.end()) @@ -365,7 +363,7 @@ css::uno::Sequence< css::beans::Property > SAL_CALL PropertySetHelper::getProper TransactionGuard aTransaction(m_rTransactionManager, E_HARDEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); sal_Int32 c = (sal_Int32)m_lProps.size(); css::uno::Sequence< css::beans::Property > lProps(c); @@ -390,7 +388,7 @@ css::beans::Property SAL_CALL PropertySetHelper::getPropertyByName(const OUStrin TransactionGuard aTransaction(m_rTransactionManager, E_HARDEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); PropertySetHelper::TPropInfoHash::const_iterator pIt = m_lProps.find(sName); if (pIt == m_lProps.end()) @@ -407,7 +405,7 @@ sal_Bool SAL_CALL PropertySetHelper::hasPropertyByName(const OUString& sName) TransactionGuard aTransaction(m_rTransactionManager, E_HARDEXCEPTIONS); // SAFE -> - ReadGuard aReadLock(m_rLock); + Guard aReadLock(m_rLock); PropertySetHelper::TPropInfoHash::iterator pIt = m_lProps.find(sName); sal_Bool bExist = (pIt != m_lProps.end()); diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx b/framework/source/fwi/classes/protocolhandlercache.cxx index e558cd64a670..eaad82c2f239 100644 --- a/framework/source/fwi/classes/protocolhandlercache.cxx +++ b/framework/source/fwi/classes/protocolhandlercache.cxx @@ -25,8 +25,7 @@ #include <classes/protocolhandlercache.hxx> #include <classes/converter.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <threadhelp/lockhelper.hxx> #include <tools/wldcrd.hxx> @@ -83,7 +82,7 @@ HandlerCFGAccess* HandlerCache::m_pConfig = NULL; HandlerCache::HandlerCache() { /* SAFE */{ - WriteGuard aGlobalLock( LockHelper::getGlobalLock() ); + Guard aGlobalLock( LockHelper::getGlobalLock() ); if (m_nRefCount==0) { @@ -106,7 +105,7 @@ HandlerCache::HandlerCache() HandlerCache::~HandlerCache() { /* SAFE */{ - WriteGuard aGlobalLock( LockHelper::getGlobalLock() ); + Guard aGlobalLock( LockHelper::getGlobalLock() ); if( m_nRefCount==1) { @@ -135,7 +134,7 @@ sal_Bool HandlerCache::search( const OUString& sURL, ProtocolHandler* pReturn ) { sal_Bool bFound = sal_False; /* SAFE */{ - ReadGuard aReadLock( LockHelper::getGlobalLock() ); + Guard aReadLock( LockHelper::getGlobalLock() ); PatternHash::const_iterator pItem = m_pPattern->findPatternKey(sURL); if (pItem!=m_pPattern->end()) { @@ -160,7 +159,7 @@ sal_Bool HandlerCache::search( const css::util::URL& aURL, ProtocolHandler* pRet void HandlerCache::takeOver(HandlerHash* pHandler, PatternHash* pPattern) { // SAFE -> - WriteGuard aWriteLock( LockHelper::getGlobalLock() ); + Guard aWriteLock( LockHelper::getGlobalLock() ); HandlerHash* pOldHandler = m_pHandler; PatternHash* pOldPattern = m_pPattern; diff --git a/framework/source/fwi/jobs/configaccess.cxx b/framework/source/fwi/jobs/configaccess.cxx index ffb18b091011..d9c63000fcd0 100644 --- a/framework/source/fwi/jobs/configaccess.cxx +++ b/framework/source/fwi/jobs/configaccess.cxx @@ -18,8 +18,7 @@ */ #include <jobs/configaccess.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <threadhelp/resetableguard.hxx> #include <general.h> #include <services.h> @@ -79,7 +78,7 @@ ConfigAccess::~ConfigAccess() ConfigAccess::EOpenMode ConfigAccess::getMode() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_eMode; /* } SAFE */ } @@ -104,7 +103,7 @@ void ConfigAccess::open( /*IN*/ EOpenMode eMode ) /* SAFE { */ // We must lock the whole method to be shure, that nobody // outside uses our internal member m_xAccess! - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // check if configuration is already open in the right mode. // By the way: Don't allow closing by using this method! @@ -164,7 +163,7 @@ void ConfigAccess::close() /* SAFE { */ // Lock the whole method, to be shure that nobody else uses our internal members // during this time. - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // check already closed configuration if (m_xConfig.is()) @@ -189,7 +188,7 @@ void ConfigAccess::close() methods. Acquire it before you call cfg() and release it afterwards immediately. E.g.: ConfigAccess aAccess(...); - ReadGuard aReadLock(aAccess.m_aLock); + Guard aReadLock(aAccess.m_aLock); Reference< XPropertySet > xSet(aAccess.cfg(), UNO_QUERY); Any aProp = xSet->getPropertyValue("..."); aReadLock.unlock(); diff --git a/framework/source/fwi/threadhelp/lockhelper.cxx b/framework/source/fwi/threadhelp/lockhelper.cxx index 839d9c2a69a8..1486f46c1547 100644 --- a/framework/source/fwi/threadhelp/lockhelper.cxx +++ b/framework/source/fwi/threadhelp/lockhelper.cxx @@ -30,8 +30,7 @@ namespace framework{ /*-************************************************************************************************************ @short use ctor to initialize instance - @seealso class ReadGuard - @seealso class WriteGuard + @seealso class Guard @param "rSolarMutex", for some components we must be "vcl-free"! So we can't work with our solar mutex directly. User must set his reference at this instance - so we can work with it! diff --git a/framework/source/helper/persistentwindowstate.cxx b/framework/source/helper/persistentwindowstate.cxx index 7d186140a724..0b3782377880 100644 --- a/framework/source/helper/persistentwindowstate.cxx +++ b/framework/source/helper/persistentwindowstate.cxx @@ -19,8 +19,7 @@ #include <pattern/window.hxx> #include <helper/persistentwindowstate.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <macros/generic.hxx> #include <services.h> @@ -78,7 +77,7 @@ void SAL_CALL PersistentWindowState::initialize(const css::uno::Sequence< css::u 1); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // hold the frame as weak reference(!) so it can die everytimes :-) m_xFrame = xFrame; aWriteLock.unlock(); @@ -93,7 +92,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY); sal_Bool bRestoreWindowState = !m_bWindowStateAlreadySet; @@ -123,7 +122,7 @@ void SAL_CALL PersistentWindowState::frameAction(const css::frame::FrameActionEv OUString sWindowState = PersistentWindowState::implst_getWindowStateFromConfig(xContext, sModuleName); PersistentWindowState::implst_setWindowStateOnWindow(xWindow,sWindowState); // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_bWindowStateAlreadySet = sal_True; aWriteLock.unlock(); // <- SAFE ---------------------------------- diff --git a/framework/source/helper/statusindicator.cxx b/framework/source/helper/statusindicator.cxx index eb11ce6ea0f9..61d25212c9bd 100644 --- a/framework/source/helper/statusindicator.cxx +++ b/framework/source/helper/statusindicator.cxx @@ -21,9 +21,7 @@ #include <helper/statusindicator.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> - +#include <threadhelp/guard.hxx> namespace framework{ @@ -50,7 +48,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText , (void) nRange; #else // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE @@ -68,7 +66,7 @@ void SAL_CALL StatusIndicator::end() { #if HAVE_FEATURE_DESKTOP // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE @@ -86,7 +84,7 @@ void SAL_CALL StatusIndicator::reset() { #if HAVE_FEATURE_DESKTOP // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE @@ -106,7 +104,7 @@ void SAL_CALL StatusIndicator::setText(const OUString& sText) (void) sText; #else // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE @@ -126,7 +124,7 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue) (void) nValue; #else // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 3b55f7c6e7c1..794f7cf224a0 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -21,8 +21,7 @@ #include <helper/statusindicatorfactory.hxx> #include <helper/statusindicator.hxx> #include <helper/vclstatusindicator.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <properties.h> @@ -78,7 +77,7 @@ void SAL_CALL StatusIndicatorFactory::initialize(const css::uno::Sequence< css:: { if (lArguments.getLength() > 0) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); css::uno::Reference< css::frame::XFrame > xTmpFrame; css::uno::Reference< css::awt::XWindow > xTmpWindow; @@ -126,7 +125,7 @@ void SAL_CALL StatusIndicatorFactory::update() throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_bAllowReschedule = sal_True; aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -138,7 +137,7 @@ void StatusIndicatorFactory::start(const css::uno::Reference< css::task::XStatus sal_Int32 nRange) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // create new info structure for this child or move it to the front of our stack IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild); @@ -166,7 +165,7 @@ void StatusIndicatorFactory::start(const css::uno::Reference< css::task::XStatus void StatusIndicatorFactory::reset(const css::uno::Reference< css::task::XStatusIndicator >& xChild) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // reset the internal info structure related to this child IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild); @@ -197,7 +196,7 @@ void StatusIndicatorFactory::reset(const css::uno::Reference< css::task::XStatus void StatusIndicatorFactory::end(const css::uno::Reference< css::task::XStatusIndicator >& xChild) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // remove this child from our stack IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild); @@ -252,7 +251,7 @@ void StatusIndicatorFactory::setText(const css::uno::Reference< css::task::XStat const OUString& sText ) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild); if (pItem != m_aStack.end()) @@ -282,7 +281,7 @@ void StatusIndicatorFactory::setValue( const css::uno::Reference< css::task::XSt sal_Int32 nValue ) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); sal_Int32 nOldValue = 0; IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild); @@ -314,7 +313,7 @@ void StatusIndicatorFactory::setValue( const css::uno::Reference< css::task::XSt void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); if (!m_bAllowParentShow) return; @@ -407,7 +406,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() void StatusIndicatorFactory::impl_createProgress() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame (m_xFrame.get() , css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY); @@ -447,7 +446,7 @@ void StatusIndicatorFactory::impl_createProgress() } // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xProgress = xProgress; aWriteLock.lock(); // <- SAFE ---------------------------------- @@ -457,7 +456,7 @@ void StatusIndicatorFactory::impl_createProgress() void StatusIndicatorFactory::impl_showProgress() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame (m_xFrame.get() , css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY); @@ -491,7 +490,7 @@ void StatusIndicatorFactory::impl_showProgress() } // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xProgress = xProgress; aWriteLock.lock(); // <- SAFE ---------------------------------- @@ -502,7 +501,7 @@ void StatusIndicatorFactory::impl_showProgress() void StatusIndicatorFactory::impl_hideProgress() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame (m_xFrame.get() , css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xWindow(m_xPluggWindow.get(), css::uno::UNO_QUERY); @@ -528,7 +527,7 @@ void StatusIndicatorFactory::impl_hideProgress() void StatusIndicatorFactory::impl_reschedule(sal_Bool bForce) { // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); if (m_bDisableReschedule) return; aReadLock.unlock(); @@ -538,7 +537,7 @@ void StatusIndicatorFactory::impl_reschedule(sal_Bool bForce) if (!bReschedule) { // SAFE -> - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); bReschedule = m_bAllowReschedule; m_bAllowReschedule = sal_False; aWriteLock.unlock(); @@ -549,7 +548,7 @@ void StatusIndicatorFactory::impl_reschedule(sal_Bool bForce) return; // SAFE -> - WriteGuard aGlobalLock(LockHelper::getGlobalLock()); + Guard aGlobalLock(LockHelper::getGlobalLock()); if (m_nInReschedule == 0) { @@ -572,7 +571,7 @@ void StatusIndicatorFactory::impl_reschedule(sal_Bool bForce) void StatusIndicatorFactory::impl_startWakeUpThread() { // SAFE -> - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_bDisableReschedule) return; @@ -590,7 +589,7 @@ void StatusIndicatorFactory::impl_startWakeUpThread() void StatusIndicatorFactory::impl_stopWakeUpThread() { // SAFE -> - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_pWakeUp) { // Thread kill itself after terminate()! diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx index 3e713ca31a54..b0c68bc6ca35 100644 --- a/framework/source/helper/tagwindowasmodified.cxx +++ b/framework/source/helper/tagwindowasmodified.cxx @@ -19,8 +19,7 @@ #include <helper/tagwindowasmodified.hxx> #include <pattern/window.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <macros/generic.hxx> #include <services.h> @@ -67,7 +66,7 @@ void SAL_CALL TagWindowAsModified::initialize(const css::uno::Sequence< css::uno return; // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xFrame = xFrame ; aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -81,7 +80,7 @@ void SAL_CALL TagWindowAsModified::modified(const css::lang::EventObject& aEvent throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::util::XModifiable > xModel (m_xModel.get (), css::uno::UNO_QUERY); css::uno::Reference< css::awt::XWindow > xWindow(m_xWindow.get(), css::uno::UNO_QUERY); @@ -127,7 +126,7 @@ void SAL_CALL TagWindowAsModified::frameAction(const css::frame::FrameActionEven return; // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY); if ( @@ -147,7 +146,7 @@ void SAL_CALL TagWindowAsModified::disposing(const css::lang::EventObject& aEven throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY); if ( @@ -192,7 +191,7 @@ void TagWindowAsModified::impl_update (const css::uno::Reference< css::frame::XF return; // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // Note: frame was set as member outside ! we have to refresh connections // regarding window and model only here. m_xWindow = xWindow; diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index 5a95a936e504..1805872aa5cd 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -20,8 +20,7 @@ #include <helper/titlebarupdate.hxx> #include <pattern/window.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <macros/generic.hxx> #include <services.h> #include <properties.h> @@ -87,7 +86,7 @@ void SAL_CALL TitleBarUpdate::initialize(const css::uno::Sequence< css::uno::Any 1); // SYNCHRONIZED -> - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // hold the frame as weak reference(!) so it can die everytimes :-) m_xFrame = xFrame; aWriteLock.unlock(); @@ -146,7 +145,7 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr try { // SYNCHRONIZED -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SYNCHRONIZED @@ -217,7 +216,7 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr return sal_False; // SYNCHRONIZED -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SYNCHRONIZED @@ -248,7 +247,7 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr void TitleBarUpdate::impl_forceUpdate() { // SYNCHRONIZED -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XFrame > xFrame(m_xFrame.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SYNCHRONIZED diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx index 3e66b5dc87b4..099e02a8b57f 100644 --- a/framework/source/helper/vclstatusindicator.cxx +++ b/framework/source/helper/vclstatusindicator.cxx @@ -19,8 +19,7 @@ #include <helper/vclstatusindicator.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> @@ -54,7 +53,7 @@ void SAL_CALL VCLStatusIndicator::start(const OUString& sText , throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::awt::XWindow > xParentWindow = m_xParentWindow; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -81,7 +80,7 @@ void SAL_CALL VCLStatusIndicator::start(const OUString& sText , // <- SOLAR SAFE ---------------------------- // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_sText = sText; m_nRange = nRange; m_nValue = 0; @@ -108,7 +107,7 @@ void SAL_CALL VCLStatusIndicator::end() throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_sText = OUString(); m_nRange = 0; m_nValue = 0; @@ -135,7 +134,7 @@ void SAL_CALL VCLStatusIndicator::setText(const OUString& sText) throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_sText = sText; aWriteLock.unlock(); // <- SAFE ---------------------------------- @@ -154,7 +153,7 @@ void SAL_CALL VCLStatusIndicator::setValue(sal_Int32 nValue) throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (nValue <= m_nRange) m_nValue = nValue; diff --git a/framework/source/helper/wakeupthread.cxx b/framework/source/helper/wakeupthread.cxx index b89478260fdf..97b60f778ad2 100644 --- a/framework/source/helper/wakeupthread.cxx +++ b/framework/source/helper/wakeupthread.cxx @@ -23,9 +23,7 @@ // include files of own module #include <helper/wakeupthread.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> - +#include <threadhelp/guard.hxx> namespace framework{ @@ -52,7 +50,7 @@ void SAL_CALL WakeUpThread::run() aSleeper.wait(&aTime); // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::util::XUpdatable > xListener(m_xListener.get(), css::uno::UNO_QUERY); aReadLock.unlock(); // <- SAFE diff --git a/framework/source/interaction/quietinteraction.cxx b/framework/source/interaction/quietinteraction.cxx index 4c359121a438..2ec220c5ccdf 100644 --- a/framework/source/interaction/quietinteraction.cxx +++ b/framework/source/interaction/quietinteraction.cxx @@ -19,8 +19,7 @@ #include "interaction/quietinteraction.hxx" -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <macros/generic.hxx> #include <com/sun/star/task/XInteractionAbort.hpp> @@ -56,7 +55,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI // safe the request for outside analyzing everytime! css::uno::Any aRequest = xRequest->getRequest(); /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_aRequest = aRequest; aWriteLock.unlock(); /* } SAFE */ @@ -143,7 +142,7 @@ void SAL_CALL QuietInteraction::handle( const css::uno::Reference< css::task::XI css::uno::Any QuietInteraction::getRequest() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_aRequest; /* } SAFE */ } @@ -153,7 +152,7 @@ css::uno::Any QuietInteraction::getRequest() const sal_Bool QuietInteraction::wasUsed() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_aRequest.hasValue(); /* } SAFE */ } diff --git a/framework/source/jobs/job.cxx b/framework/source/jobs/job.cxx index 454bd695e1b3..a5de92872835 100644 --- a/framework/source/jobs/job.cxx +++ b/framework/source/jobs/job.cxx @@ -18,8 +18,7 @@ */ #include <jobs/job.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -122,7 +121,7 @@ void Job::setDispatchResultFake( /*IN*/ const css::uno::Reference< css::frame::X /*IN*/ const css::uno::Reference< css::uno::XInterface >& xSourceFake ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // reject dangerous calls if (m_eRunState != E_NEW) @@ -140,7 +139,7 @@ void Job::setDispatchResultFake( /*IN*/ const css::uno::Reference< css::frame::X void Job::setJobData( const JobData& aData ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // reject dangerous calls if (m_eRunState != E_NEW) @@ -169,7 +168,7 @@ void Job::setJobData( const JobData& aData ) void Job::execute( /*IN*/ const css::uno::Sequence< css::beans::NamedValue >& lDynamicArgs ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // reject dangerous calls if (m_eRunState != E_NEW) @@ -293,7 +292,7 @@ void Job::execute( /*IN*/ const css::uno::Sequence< css::beans::NamedValue >& lD void Job::die() { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); impl_stopListening(); @@ -348,7 +347,7 @@ css::uno::Sequence< css::beans::NamedValue > Job::impl_generateJobArgs( /*IN*/ c css::uno::Sequence< css::beans::NamedValue > lAllArgs; /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // the real structure of the returned list depends from the environment of this job! JobData::EMode eMode = m_aJobCfg.getMode(); @@ -443,7 +442,7 @@ css::uno::Sequence< css::beans::NamedValue > Job::impl_generateJobArgs( /*IN*/ c void Job::impl_reactForJobResult( /*IN*/ const css::uno::Any& aResult ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // analyze the result set ... JobResult aAnalyzedResult(aResult); @@ -514,7 +513,7 @@ void Job::impl_reactForJobResult( /*IN*/ const css::uno::Any& aResult ) void Job::impl_startListening() { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // listening for office shutdown if (!m_xDesktop.is() && !m_bListenOnDesktop) @@ -582,7 +581,7 @@ void Job::impl_startListening() void Job::impl_stopListening() { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // stop listening for office shutdown if (m_xDesktop.is() && m_bListenOnDesktop) @@ -658,7 +657,7 @@ void SAL_CALL Job::jobFinished( /*IN*/ const css::uno::Reference< css::task::XAs /*IN*/ const css::uno::Any& aResult ) throw(css::uno::RuntimeException, std::exception) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // It's necessary to check this. // May this job was cancelled by any other reason @@ -702,7 +701,7 @@ void SAL_CALL Job::queryTermination( /*IN*/ const css::lang::EventObject& ) thro css::uno::RuntimeException, std::exception ) { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // Otherwhise try to close() it @@ -772,7 +771,7 @@ void SAL_CALL Job::queryClosing( const css::lang::EventObject& aEvent , css::uno::RuntimeException, std::exception ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // do nothing, if no internal job is still running ... // The frame or model can be closed then successfully. @@ -860,7 +859,7 @@ void SAL_CALL Job::notifyClosing( const css::lang::EventObject& ) throw(css::uno void SAL_CALL Job::disposing( const css::lang::EventObject& aEvent ) throw(css::uno::RuntimeException, std::exception) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_xDesktop.is() && aEvent.Source == m_xDesktop) { diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx index 37a40e232221..e21649534d2f 100644 --- a/framework/source/jobs/jobdata.cxx +++ b/framework/source/jobs/jobdata.cxx @@ -18,8 +18,7 @@ */ #include <jobs/jobdata.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <classes/converter.hxx> #include <general.h> #include <services.h> @@ -81,7 +80,7 @@ JobData::JobData( const JobData& rCopy ) void JobData::operator=( const JobData& rCopy ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // Please don't copy the uno service manager reference. // That can change the uno context, which isn't a good idea! m_eMode = rCopy.m_eMode ; @@ -120,7 +119,7 @@ JobData::~JobData() void JobData::setAlias( const OUString& sAlias ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // delete all old information! Otherwhise we mix it with the new one ... impl_reset(); @@ -190,7 +189,7 @@ void JobData::setAlias( const OUString& sAlias ) void JobData::setService( const OUString& sService ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // delete all old information! Otherwhise we mix it with the new one ... impl_reset(); @@ -228,7 +227,7 @@ void JobData::setEvent( const OUString& sEvent , setAlias(sAlias); /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // take over the new information - which differ against set on of method setAlias()! m_sEvent = sEvent; @@ -253,7 +252,7 @@ void JobData::setEvent( const OUString& sEvent , void JobData::setJobConfig( const css::uno::Sequence< css::beans::NamedValue >& lArguments ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // update member m_lArguments = lArguments; @@ -310,7 +309,7 @@ void JobData::setJobConfig( const css::uno::Sequence< css::beans::NamedValue >& void JobData::setResult( const JobResult& aResult ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // overwrite the last saved result m_aLastExecutionResult = aResult; @@ -333,7 +332,7 @@ void JobData::setResult( const JobResult& aResult ) void JobData::setEnvironment( EEnvironment eEnvironment ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_eEnvironment = eEnvironment; aWriteLock.unlock(); /* } SAFE */ @@ -348,7 +347,7 @@ void JobData::setEnvironment( EEnvironment eEnvironment ) JobData::EMode JobData::getMode() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_eMode; /* } SAFE */ } @@ -358,7 +357,7 @@ JobData::EMode JobData::getMode() const JobData::EEnvironment JobData::getEnvironment() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_eEnvironment; /* } SAFE */ } @@ -369,7 +368,7 @@ OUString JobData::getEnvironmentDescriptor() const { OUString sDescriptor; /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); switch(m_eEnvironment) { case E_EXECUTION : @@ -395,7 +394,7 @@ OUString JobData::getEnvironmentDescriptor() const OUString JobData::getService() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_sService; /* } SAFE */ } @@ -405,7 +404,7 @@ OUString JobData::getService() const OUString JobData::getEvent() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_sEvent; /* } SAFE */ } @@ -415,7 +414,7 @@ OUString JobData::getEvent() const css::uno::Sequence< css::beans::NamedValue > JobData::getJobConfig() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_lArguments; /* } SAFE */ } @@ -425,7 +424,7 @@ css::uno::Sequence< css::beans::NamedValue > JobData::getJobConfig() const css::uno::Sequence< css::beans::NamedValue > JobData::getConfig() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Sequence< css::beans::NamedValue > lConfig; if (m_eMode==E_ALIAS) { @@ -464,7 +463,7 @@ css::uno::Sequence< css::beans::NamedValue > JobData::getConfig() const sal_Bool JobData::hasConfig() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return (m_eMode==E_ALIAS || m_eMode==E_EVENT); /* } SAFE */ } @@ -483,7 +482,7 @@ sal_Bool JobData::hasConfig() const void JobData::disableJob() { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // No configuration - not used from EXECUTOR and not triggered from an event => no chance! if (m_eMode!=E_EVENT) @@ -671,7 +670,7 @@ css::uno::Sequence< OUString > JobData::getEnabledJobsForEvent( const css::uno:: void JobData::impl_reset() { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_eMode = E_UNKNOWN_MODE; m_eEnvironment = E_UNKNOWN_ENVIRONMENT; m_sAlias = ""; diff --git a/framework/source/jobs/jobdispatch.cxx b/framework/source/jobs/jobdispatch.cxx index a7e13e1063fa..57c63b915f8d 100644 --- a/framework/source/jobs/jobdispatch.cxx +++ b/framework/source/jobs/jobdispatch.cxx @@ -20,10 +20,9 @@ #include <jobs/configaccess.hxx> #include <jobs/joburl.hxx> #include <jobs/job.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <threadhelp/resetableguard.hxx> #include <threadhelp/threadhelpbase.hxx> -#include <threadhelp/writeguard.hxx> #include <classes/converter.hxx> #include <general.h> @@ -181,7 +180,7 @@ void SAL_CALL JobDispatch::initialize( const css::uno::Sequence< css::uno::Any > css::uno::RuntimeException, std::exception) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); for (int a=0; a<lArguments.getLength(); ++a) { @@ -330,7 +329,7 @@ void JobDispatch::impl_dispatchEvent( /*IN*/ const OUString& // The called static helper methods read it from the configuration and // filter disabled jobs using it's time stamp values. /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Sequence< OUString > lJobs = JobData::getEnabledJobsForEvent(m_xContext, sEvent); aReadLock.unlock(); /* } SAFE */ @@ -410,7 +409,7 @@ void JobDispatch::impl_dispatchService( /*IN*/ const OUString& /*IN*/ const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); JobData aCfg(m_xContext); aCfg.setService(sService); @@ -461,7 +460,7 @@ void JobDispatch::impl_dispatchAlias( /*IN*/ const OUString& /*IN*/ const css::uno::Reference< css::frame::XDispatchResultListener >& xListener ) { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); JobData aCfg(m_xContext); aCfg.setAlias(sAlias); diff --git a/framework/source/jobs/jobresult.cxx b/framework/source/jobs/jobresult.cxx index 19c91426f9aa..749f03367a40 100644 --- a/framework/source/jobs/jobresult.cxx +++ b/framework/source/jobs/jobresult.cxx @@ -19,8 +19,7 @@ #include <jobs/jobresult.hxx> #include <jobs/jobconst.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <services.h> @@ -167,7 +166,7 @@ JobResult::~JobResult() void JobResult::operator=( const JobResult& rCopy ) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_aPureResult = rCopy.m_aPureResult ; m_eParts = rCopy.m_eParts ; m_lArguments = rCopy.m_lArguments ; @@ -193,7 +192,7 @@ void JobResult::operator=( const JobResult& rCopy ) sal_Bool JobResult::existPart( sal_uInt32 eParts ) const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return ((m_eParts & eParts) == eParts); /* } SAFE */ } @@ -210,7 +209,7 @@ sal_Bool JobResult::existPart( sal_uInt32 eParts ) const css::uno::Sequence< css::beans::NamedValue > JobResult::getArguments() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_lArguments; /* } SAFE */ } @@ -220,7 +219,7 @@ css::uno::Sequence< css::beans::NamedValue > JobResult::getArguments() const css::frame::DispatchResultEvent JobResult::getDispatchResult() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_aDispatchResult; /* } SAFE */ } diff --git a/framework/source/jobs/joburl.cxx b/framework/source/jobs/joburl.cxx index bfcc75b944e1..d930c78c19af 100644 --- a/framework/source/jobs/joburl.cxx +++ b/framework/source/jobs/joburl.cxx @@ -18,8 +18,7 @@ */ #include <jobs/joburl.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <rtl/ustrbuf.hxx> @@ -109,7 +108,7 @@ JobURL::JobURL( /*IN*/ const OUString& sURL ) sal_Bool JobURL::isValid() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return (m_eRequest!=E_UNKNOWN); } @@ -133,7 +132,7 @@ sal_Bool JobURL::isValid() const sal_Bool JobURL::getEvent( /*OUT*/ OUString& sEvent ) const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sEvent = OUString(); sal_Bool bSet = ((m_eRequest & E_EVENT) == E_EVENT); @@ -166,7 +165,7 @@ sal_Bool JobURL::getEvent( /*OUT*/ OUString& sEvent ) const sal_Bool JobURL::getAlias( /*OUT*/ OUString& sAlias ) const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sAlias = OUString(); sal_Bool bSet = ((m_eRequest & E_ALIAS) == E_ALIAS); @@ -199,7 +198,7 @@ sal_Bool JobURL::getAlias( /*OUT*/ OUString& sAlias ) const sal_Bool JobURL::getService( /*OUT*/ OUString& sService ) const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sService = OUString(); sal_Bool bSet = ((m_eRequest & E_SERVICE) == E_SERVICE); @@ -539,7 +538,7 @@ void JobURL::impldbg_checkURL( /*IN*/ const sal_Char* pURL , OUString JobURL::impldbg_toString() const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); OUStringBuffer sBuffer(256); @@ -570,7 +569,7 @@ OUString JobURL::impldbg_toString() const sal_Bool JobURL::getServiceArgs( /*OUT*/ OUString& sServiceArgs ) const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sServiceArgs = OUString(); sal_Bool bSet = ((m_eRequest & E_SERVICE) == E_SERVICE); @@ -588,7 +587,7 @@ sal_Bool JobURL::getServiceArgs( /*OUT*/ OUString& sServiceArgs ) const sal_Bool JobURL::getEventArgs( /*OUT*/ OUString& sEventArgs ) const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sEventArgs = OUString(); sal_Bool bSet = ((m_eRequest & E_EVENT) == E_EVENT); @@ -606,7 +605,7 @@ sal_Bool JobURL::getEventArgs( /*OUT*/ OUString& sEventArgs ) const sal_Bool JobURL::getAliasArgs( /*OUT*/ OUString& sAliasArgs ) const { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); sAliasArgs = OUString(); sal_Bool bSet = ((m_eRequest & E_ALIAS) == E_ALIAS); diff --git a/framework/source/jobs/shelljob.cxx b/framework/source/jobs/shelljob.cxx index 346f2d9ee15c..8a63290fc4cc 100644 --- a/framework/source/jobs/shelljob.cxx +++ b/framework/source/jobs/shelljob.cxx @@ -23,7 +23,7 @@ #include <jobs/shelljob.hxx> #include <jobs/jobconst.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> @@ -142,7 +142,7 @@ css::uno::Any ShellJob::impl_generateAnswer4Deactivation() OUString ShellJob::impl_substituteCommandVariables(const OUString& sCommand) { // SYNCHRONIZED -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SYNCHRONIZED diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx index bcfcf090fc35..b464e8630693 100644 --- a/framework/source/layoutmanager/layoutmanager.cxx +++ b/framework/source/layoutmanager/layoutmanager.cxx @@ -19,6 +19,7 @@ #include <services/layoutmanager.hxx> #include <helpers.hxx> +#include <threadhelp/guard.hxx> #include <threadhelp/resetableguard.hxx> #include <framework/sfxhelperfunctions.hxx> @@ -222,13 +223,13 @@ void LayoutManager::impl_clearUpMenuBar() void LayoutManager::implts_lock() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); ++m_nLockCount; } sal_Bool LayoutManager::implts_unlock() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_nLockCount = std::max( m_nLockCount-1, static_cast<sal_Int32>(0) ); return ( m_nLockCount == 0 ); } @@ -236,7 +237,7 @@ sal_Bool LayoutManager::implts_unlock() void LayoutManager::implts_reset( sal_Bool bAttached ) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< XFrame > xFrame = m_xFrame; Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); Reference< XUIConfiguration > xModuleCfgMgr( m_xModuleCfgMgr, UNO_QUERY ); @@ -376,7 +377,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) Reference< XUIConfigurationManager > xDokCfgMgr( xDocCfgMgr, UNO_QUERY ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xModel = xModel; m_aDockingArea = awt::Rectangle(); m_bComponentAttached = bAttached; @@ -412,7 +413,7 @@ void LayoutManager::implts_reset( sal_Bool bAttached ) sal_Bool LayoutManager::implts_isEmbeddedLayoutManager() const { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< XFrame > xFrame = m_xFrame; Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); aReadLock.unlock(); @@ -426,7 +427,7 @@ sal_Bool LayoutManager::implts_isEmbeddedLayoutManager() const void LayoutManager::implts_destroyElements() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aWriteLock.unlock(); @@ -442,7 +443,7 @@ void LayoutManager::implts_destroyElements() void LayoutManager::implts_toggleFloatingUIElementsVisibility( sal_Bool bActive ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -483,7 +484,7 @@ sal_Bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& r { bool bGetSettingsState( false ); - WriteGuard aWriteLock( rLock ); + Guard aWriteLock( rLock ); Reference< XNameAccess > xPersistentWindowState( rPersistentWindowState ); aWriteLock.unlock(); @@ -583,7 +584,7 @@ sal_Bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& r { if ( pGlobalSettings->HasStatesInfo( GlobalSettings::UIELEMENT_TYPE_TOOLBAR )) { - WriteGuard aWriteLock2( rLock ); + Guard aWriteLock2( rLock ); bInGlobalSettings = true; aWriteLock2.unlock(); @@ -615,7 +616,7 @@ sal_Bool LayoutManager::readWindowStateData( const OUString& aName, UIElement& r void LayoutManager::implts_writeWindowStateData( const OUString& aName, const UIElement& rElementData ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); Reference< XNameAccess > xPersistentWindowState( m_xPersistentWindowState ); // set flag to determine that we triggered the notification @@ -708,7 +709,7 @@ Reference< XUIElement > LayoutManager::implts_createElement( const OUString& aNa { Reference< ui::XUIElement > xUIElement; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Sequence< PropertyValue > aPropSeq( 2 ); aPropSeq[0].Name = "Frame"; aPropSeq[0].Value <<= m_xFrame; @@ -731,7 +732,7 @@ Reference< XUIElement > LayoutManager::implts_createElement( const OUString& aNa void LayoutManager::implts_setVisibleState( sal_Bool bShow ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aStatusBarElement.m_bMasterHide = !bShow; aWriteLock.unlock(); @@ -747,7 +748,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible ) else implts_notifyListeners( frame::LayoutManagerEvents::INVISIBLE, a ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); Reference< XUIElement > xMenuBar( m_xMenuBar, UNO_QUERY ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); Reference< XComponent > xInplaceMenuBar( m_xInplaceMenuBar ); @@ -801,7 +802,7 @@ void LayoutManager::implts_updateUIElementsVisibleState( sal_Bool bSetVisible ) void LayoutManager::implts_setCurrentUIVisibility( sal_Bool bShow ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( !bShow && m_aStatusBarElement.m_bVisible && m_aStatusBarElement.m_xUIElement.is() ) m_aStatusBarElement.m_bMasterHide = true; else if ( bShow && m_aStatusBarElement.m_bVisible ) @@ -815,7 +816,7 @@ void LayoutManager::implts_destroyStatusBar() { Reference< XComponent > xCompStatusBar; - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aStatusBarElement.m_aName = OUString(); xCompStatusBar = Reference< XComponent >( m_aStatusBarElement.m_xUIElement, UNO_QUERY ); m_aStatusBarElement.m_xUIElement.clear(); @@ -829,7 +830,7 @@ void LayoutManager::implts_destroyStatusBar() void LayoutManager::implts_createStatusBar( const OUString& aStatusBarName ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( !m_aStatusBarElement.m_xUIElement.is() ) { implts_readStatusBarState( aStatusBarName ); @@ -843,7 +844,7 @@ void LayoutManager::implts_createStatusBar( const OUString& aStatusBarName ) void LayoutManager::implts_readStatusBarState( const OUString& rStatusBarName ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( !m_aStatusBarElement.m_bStateRead ) { // Read persistent data for status bar if not yet read! @@ -859,7 +860,7 @@ void LayoutManager::implts_createProgressBar() Reference< XUIElement > xProgressBarBackup; Reference< awt::XWindow > xContainerWindow; - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); xStatusBar = Reference< XUIElement >( m_aStatusBarElement.m_xUIElement, UNO_QUERY ); xProgressBar = Reference< XUIElement >( m_aProgressBarElement.m_xUIElement, UNO_QUERY ); xProgressBarBackup = m_xProgressBarBackup; @@ -913,7 +914,7 @@ void LayoutManager::implts_createProgressBar() void LayoutManager::implts_backupProgressBarWrapper() { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_xProgressBarBackup.is()) return; @@ -956,7 +957,7 @@ void LayoutManager::implts_setStatusBarPosSize( const ::Point& rPos, const ::Siz Reference< awt::XWindow > xContainerWindow; /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); xStatusBar = Reference< XUIElement >( m_aStatusBarElement.m_xUIElement, UNO_QUERY ); xProgressBar = Reference< XUIElement >( m_aProgressBarElement.m_xUIElement, UNO_QUERY ); xContainerWindow = m_xContainerWindow; @@ -995,7 +996,7 @@ sal_Bool LayoutManager::implts_showProgressBar() Reference< awt::XWindow > xWindow; /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); xStatusBar = Reference< XUIElement >( m_aStatusBarElement.m_xUIElement, UNO_QUERY ); xProgressBar = Reference< XUIElement >( m_aProgressBarElement.m_xUIElement, UNO_QUERY ); sal_Bool bVisible( m_bVisible ); @@ -1040,7 +1041,7 @@ sal_Bool LayoutManager::implts_hideProgressBar() sal_Bool bHideStatusBar( sal_False ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); xProgressBar = Reference< XUIElement >( m_aProgressBarElement.m_xUIElement, UNO_QUERY ); sal_Bool bInternalStatusBar( sal_False ); @@ -1076,7 +1077,7 @@ sal_Bool LayoutManager::implts_hideProgressBar() sal_Bool LayoutManager::implts_showStatusBar( sal_Bool bStoreState ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); Reference< ui::XUIElement > xStatusBar = m_aStatusBarElement.m_xUIElement; if ( bStoreState ) m_aStatusBarElement.m_bVisible = true; @@ -1102,7 +1103,7 @@ sal_Bool LayoutManager::implts_showStatusBar( sal_Bool bStoreState ) sal_Bool LayoutManager::implts_hideStatusBar( sal_Bool bStoreState ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); Reference< ui::XUIElement > xStatusBar = m_aStatusBarElement.m_xUIElement; if ( bStoreState ) m_aStatusBarElement.m_bVisible = false; @@ -1140,7 +1141,7 @@ void LayoutManager::implts_setInplaceMenuBar( const Reference< XIndexAccess >& x throw (uno::RuntimeException) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( !m_bInplaceMenuSet ) { @@ -1181,7 +1182,7 @@ void LayoutManager::implts_resetInplaceMenuBar() throw (uno::RuntimeException) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bInplaceMenuSet = false; if ( m_xContainerWindow.is() ) @@ -1209,7 +1210,7 @@ throw (uno::RuntimeException) void SAL_CALL LayoutManager::attachFrame( const Reference< XFrame >& xFrame ) throw (uno::RuntimeException, std::exception) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xFrame = xFrame; } @@ -1242,14 +1243,14 @@ throw (uno::RuntimeException, std::exception) awt::Rectangle SAL_CALL LayoutManager::getCurrentDockingArea() throw ( RuntimeException, std::exception ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_aDockingArea; } Reference< XDockingAreaAcceptor > SAL_CALL LayoutManager::getDockingAreaAcceptor() throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xDockingAreaAcceptor; } @@ -1257,7 +1258,7 @@ void SAL_CALL LayoutManager::setDockingAreaAcceptor( const Reference< ui::XDocki throw ( RuntimeException, std::exception ) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if (( m_xDockingAreaAcceptor == xDockingAreaAcceptor ) || !m_xFrame.is() ) return; @@ -1354,7 +1355,7 @@ throw ( RuntimeException, std::exception ) void LayoutManager::implts_reparentChildWindows() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); UIElement aStatusBarElement = m_aStatusBarElement; uno::Reference< awt::XWindow > xContainerWindow = m_xContainerWindow; aWriteLock.unlock(); @@ -1408,7 +1409,7 @@ IMPL_LINK( LayoutManager, WindowEventListener, VclSimpleEvent*, pEvent ) Window* pWindow = static_cast< VclWindowEvent* >(pEvent)->GetWindow(); if ( pWindow && pWindow->GetType() == WINDOW_TOOLBOX ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager( m_pToolbarManager ); aReadLock.unlock(); @@ -1425,7 +1426,7 @@ throw (RuntimeException, std::exception) { SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::createElement" ); - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< XFrame > xFrame = m_xFrame; Reference< XURLTransformer > xURLTransformer = m_xURLTransformer; sal_Bool bInPlaceMenu = m_bInplaceMenuSet; @@ -1435,7 +1436,7 @@ throw (RuntimeException, std::exception) return; /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); bool bMustBeLayouted( false ); bool bNotify( false ); @@ -1560,7 +1561,7 @@ throw (RuntimeException, std::exception) SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::destroyElement" ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); bool bMustBeLayouted( false ); bool bNotify( false ); @@ -1633,7 +1634,7 @@ throw (uno::RuntimeException, std::exception) parseResourceURL( rResourceURL, aElementType, aElementName ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); OString aResName = OUStringToOString( aElementName, RTL_TEXTENCODING_ASCII_US ); SAL_INFO( "fwk", "framework (cd100003) Element " << aResName.getStr() << " requested." ); @@ -1706,7 +1707,7 @@ throw (RuntimeException, std::exception) Reference< XUIElement > xUIElement = implts_findElement( aName ); if ( !xUIElement.is() ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager( m_pToolbarManager ); aReadLock.unlock(); @@ -1720,7 +1721,7 @@ throw (RuntimeException, std::exception) Sequence< Reference< ui::XUIElement > > SAL_CALL LayoutManager::getElements() throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< ui::XUIElement > xMenuBar( m_xMenuBar ); uno::Reference< ui::XUIElement > xStatusBar( m_aStatusBarElement.m_xUIElement ); ToolbarLayoutManager* pToolbarManager( m_pToolbarManager ); @@ -1772,7 +1773,7 @@ throw (RuntimeException, std::exception) if ( aElementType.equalsIgnoreAsciiCase("menubar") && aElementName.equalsIgnoreAsciiCase("menubar") ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bMenuVisible = true; aWriteLock.unlock(); @@ -1783,7 +1784,7 @@ throw (RuntimeException, std::exception) aElementName.equalsIgnoreAsciiCase("statusbar") ) || ( m_aStatusBarElement.m_aName == aName )) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( m_aStatusBarElement.m_xUIElement.is() && !m_aStatusBarElement.m_bMasterHide && implts_showStatusBar( sal_True )) { @@ -1802,7 +1803,7 @@ throw (RuntimeException, std::exception) } else if ( aElementType.equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -1814,7 +1815,7 @@ throw (RuntimeException, std::exception) } else if ( aElementType.equalsIgnoreAsciiCase("dockingwindow")) { - ReadGuard aReadGuard( m_aLock ); + Guard aReadGuard( m_aLock ); uno::Reference< frame::XFrame > xFrame( m_xFrame ); uno::Reference< XComponentContext > xContext( m_xContext ); aReadGuard.unlock(); @@ -1823,7 +1824,7 @@ throw (RuntimeException, std::exception) } else if ( aElementType.equalsIgnoreAsciiCase("toolpanel")) { - ReadGuard aReadGuard( m_aLock ); + Guard aReadGuard( m_aLock ); uno::Reference< frame::XFrame > xFrame( m_xFrame ); aReadGuard.unlock(); ActivateToolPanel( m_xFrame, aName ); @@ -1855,7 +1856,7 @@ throw (RuntimeException, std::exception) if ( aElementType.equalsIgnoreAsciiCase("menubar") && aElementName.equalsIgnoreAsciiCase("menubar") ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( m_xContainerWindow.is() ) { @@ -1878,7 +1879,7 @@ throw (RuntimeException, std::exception) aElementName.equalsIgnoreAsciiCase("statusbar") ) || ( m_aStatusBarElement.m_aName == aName )) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( m_aStatusBarElement.m_xUIElement.is() && !m_aStatusBarElement.m_bMasterHide && implts_hideStatusBar( sal_True )) { @@ -1894,7 +1895,7 @@ throw (RuntimeException, std::exception) } else if ( aElementType.equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -1906,7 +1907,7 @@ throw (RuntimeException, std::exception) } else if ( aElementType.equalsIgnoreAsciiCase("dockingwindow")) { - ReadGuard aReadGuard( m_aLock ); + Guard aReadGuard( m_aLock ); uno::Reference< frame::XFrame > xFrame( m_xFrame ); uno::Reference< XComponentContext > xContext( m_xContext ); aReadGuard.unlock(); @@ -1932,7 +1933,7 @@ throw (RuntimeException, std::exception) parseResourceURL( aName, aElementType, aElementName ); if ( aElementType.equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -1948,7 +1949,7 @@ throw (RuntimeException, std::exception) ::sal_Bool SAL_CALL LayoutManager::dockAllWindows( ::sal_Int16 /*nElementType*/ ) throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bResult( false ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -1968,7 +1969,7 @@ throw (RuntimeException, std::exception) bool bResult( false ); if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -1988,7 +1989,7 @@ throw (uno::RuntimeException, std::exception) bool bResult( false ); if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2008,7 +2009,7 @@ throw (uno::RuntimeException, std::exception) bool bResult( false ); if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2027,7 +2028,7 @@ throw (RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2045,7 +2046,7 @@ throw (RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager( m_pToolbarManager ); aReadLock.unlock(); @@ -2063,7 +2064,7 @@ throw (RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager( m_pToolbarManager ); aReadLock.unlock(); @@ -2086,7 +2087,7 @@ throw (RuntimeException, std::exception) if ( aElementType.equalsIgnoreAsciiCase("menubar") && aElementName.equalsIgnoreAsciiCase("menubar") ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); if ( m_xContainerWindow.is() ) { aReadLock.unlock(); @@ -2131,7 +2132,7 @@ throw (RuntimeException, std::exception) } else if ( aElementType.equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2140,7 +2141,7 @@ throw (RuntimeException, std::exception) } else if ( aElementType.equalsIgnoreAsciiCase("dockingwindow")) { - ReadGuard aReadGuard( m_aLock ); + Guard aReadGuard( m_aLock ); uno::Reference< frame::XFrame > xFrame( m_xFrame ); aReadGuard.unlock(); @@ -2155,7 +2156,7 @@ throw (RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2171,7 +2172,7 @@ throw (RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2187,7 +2188,7 @@ throw (uno::RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2203,7 +2204,7 @@ throw (RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2219,7 +2220,7 @@ throw (RuntimeException, std::exception) { if ( getElementTypeFromResourceURL( aName ).equalsIgnoreAsciiCase( UIRESOURCETYPE_TOOLBAR )) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; aReadLock.unlock(); @@ -2235,7 +2236,7 @@ throw (RuntimeException, std::exception) { implts_lock(); - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); sal_Int32 nLockCount( m_nLockCount ); aReadLock.unlock(); @@ -2257,7 +2258,7 @@ throw (RuntimeException, std::exception) { sal_Bool bDoLayout( implts_unlock() ); - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); sal_Int32 nLockCount( m_nLockCount ); aReadLock.unlock(); @@ -2271,7 +2272,7 @@ throw (RuntimeException, std::exception) #endif // conform to documentation: unlock with lock count == 0 means force a layout - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( bDoLayout ) m_aAsyncLayoutTimer.Stop(); aWriteLock.unlock(); @@ -2310,7 +2311,7 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_ SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::implts_doLayout" ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); if ( !m_xFrame.is() || !m_bParentWindowVisible ) return sal_False; @@ -2332,7 +2333,7 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_ { bLayouted = sal_True; - WriteGuard aWriteGuard( m_aLock ); + Guard aWriteGuard( m_aLock ); m_bDoLayout = true; aWriteGuard.unlock(); @@ -2427,7 +2428,7 @@ sal_Bool LayoutManager::implts_doLayout( sal_Bool bForceRequestBorderSpace, sal_ sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContainerSize, const awt::Point& rComponentPos ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< awt::XWindow > xContainerWindow = m_xContainerWindow; Reference< awt::XTopWindow2 > xContainerTopWindow = m_xContainerTopWindow; Reference< awt::XWindow > xComponentWindow = m_xFrame->getComponentWindow(); @@ -2459,7 +2460,7 @@ sal_Bool LayoutManager::implts_resizeContainerWindow( const awt::Size& rContaine void SAL_CALL LayoutManager::setVisible( sal_Bool bVisible ) throw (uno::RuntimeException, std::exception) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); sal_Bool bWasVisible( m_bVisible ); m_bVisible = bVisible; aWriteLock.unlock(); @@ -2471,13 +2472,13 @@ throw (uno::RuntimeException, std::exception) sal_Bool SAL_CALL LayoutManager::isVisible() throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_bVisible; } ::Size LayoutManager::implts_getStatusBarSize() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bStatusBarVisible( isElementVisible( STATUS_BAR_ALIAS )); bool bProgressBarVisible( isElementVisible( PROGRESS_BAR_ALIAS )); bool bVisible( m_bVisible ); @@ -2506,7 +2507,7 @@ throw (uno::RuntimeException, std::exception) awt::Rectangle LayoutManager::implts_calcDockingAreaSizes() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); Reference< XDockingAreaAcceptor > xDockingAreaAcceptor( m_xDockingAreaAcceptor ); aReadLock.unlock(); @@ -2520,7 +2521,7 @@ awt::Rectangle LayoutManager::implts_calcDockingAreaSizes() void LayoutManager::implts_setDockingAreaWindowSizes( const awt::Rectangle& /*rBorderSpace*/ ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); aReadLock.unlock(); @@ -2545,7 +2546,7 @@ void LayoutManager::implts_setDockingAreaWindowSizes( const awt::Rectangle& /*rB void LayoutManager::implts_updateMenuBarClose() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); bool bShowCloser( m_bMenuBarCloser ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); aWriteLock.unlock(); @@ -2571,7 +2572,7 @@ void LayoutManager::implts_updateMenuBarClose() sal_Bool LayoutManager::implts_resetMenuBar() { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); sal_Bool bMenuVisible( m_bMenuVisible ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); @@ -2601,7 +2602,7 @@ sal_Bool LayoutManager::implts_resetMenuBar() IMPL_LINK_NOARG(LayoutManager, MenuBarClose) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< frame::XDispatchProvider > xProvider(m_xFrame, uno::UNO_QUERY); uno::Reference< XComponentContext > xContext( m_xContext ); aReadLock.unlock(); @@ -2669,7 +2670,7 @@ void SAL_CALL LayoutManager::windowResized( const awt::WindowEvent& aEvent ) throw( uno::RuntimeException, std::exception ) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( !m_xDockingAreaAcceptor.is() ) return; @@ -2721,7 +2722,7 @@ void SAL_CALL LayoutManager::windowMoved( const awt::WindowEvent& ) throw( uno:: void SAL_CALL LayoutManager::windowShown( const lang::EventObject& aEvent ) throw( uno::RuntimeException, std::exception ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); bool bParentWindowVisible( m_bParentWindowVisible ); aReadLock.unlock(); @@ -2729,7 +2730,7 @@ void SAL_CALL LayoutManager::windowShown( const lang::EventObject& aEvent ) thro Reference< XInterface > xIfac( xContainerWindow, UNO_QUERY ); if ( xIfac == aEvent.Source ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bParentWindowVisible = true; bool bSetVisible = ( m_bParentWindowVisible != bParentWindowVisible ); aWriteLock.unlock(); @@ -2741,7 +2742,7 @@ void SAL_CALL LayoutManager::windowShown( const lang::EventObject& aEvent ) thro void SAL_CALL LayoutManager::windowHidden( const lang::EventObject& aEvent ) throw( uno::RuntimeException, std::exception ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); bool bParentWindowVisible( m_bParentWindowVisible ); aReadLock.unlock(); @@ -2749,7 +2750,7 @@ void SAL_CALL LayoutManager::windowHidden( const lang::EventObject& aEvent ) thr Reference< XInterface > xIfac( xContainerWindow, UNO_QUERY ); if ( xIfac == aEvent.Source ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bParentWindowVisible = false; bool bSetInvisible = ( m_bParentWindowVisible != bParentWindowVisible ); aWriteLock.unlock(); @@ -2761,7 +2762,7 @@ void SAL_CALL LayoutManager::windowHidden( const lang::EventObject& aEvent ) thr IMPL_LINK_NOARG(LayoutManager, AsyncLayoutHdl) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); m_aAsyncLayoutTimer.Stop(); if( !m_xContainerWindow.is() ) @@ -2790,7 +2791,7 @@ throw ( RuntimeException, std::exception ) { SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::frameAction (COMPONENT_ATTACHED|REATTACHED)" ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bComponentAttached = true; m_bMustDoLayout = true; aWriteLock.unlock(); @@ -2803,7 +2804,7 @@ throw ( RuntimeException, std::exception ) { SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::frameAction (FRAME_UI_ACTIVATED|DEACTIVATING)" ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bActive = ( aEvent.Action == FrameAction_FRAME_UI_ACTIVATED ); aWriteLock.unlock(); @@ -2813,7 +2814,7 @@ throw ( RuntimeException, std::exception ) { SAL_INFO( "fwk", "framework (cd100003) ::LayoutManager::frameAction (COMPONENT_DETACHING)" ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bComponentAttached = false; aWriteLock.unlock(); @@ -2829,7 +2830,7 @@ throw( RuntimeException, std::exception ) sal_Bool bDisposeAndClear( sal_False ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( rEvent.Source == Reference< XInterface >( m_xFrame, UNO_QUERY )) { @@ -2929,7 +2930,7 @@ throw( RuntimeException, std::exception ) void SAL_CALL LayoutManager::elementInserted( const ui::ConfigurationEvent& Event ) throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< XFrame > xFrame( m_xFrame ); Reference< ui::XUIConfigurationListener > xUICfgListener( m_xToolbarManager ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; @@ -2974,7 +2975,7 @@ void SAL_CALL LayoutManager::elementInserted( const ui::ConfigurationEvent& Even void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event ) throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< frame::XFrame > xFrame( m_xFrame ); Reference< ui::XUIConfigurationListener > xToolbarManager( m_xToolbarManager ); Reference< awt::XWindow > xContainerWindow( m_xContainerWindow ); @@ -3048,7 +3049,7 @@ void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event if ( xComp.is() ) xComp->dispose(); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xMenuBar.clear(); } } @@ -3062,7 +3063,7 @@ void SAL_CALL LayoutManager::elementRemoved( const ui::ConfigurationEvent& Event void SAL_CALL LayoutManager::elementReplaced( const ui::ConfigurationEvent& Event ) throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Reference< XFrame > xFrame( m_xFrame ); Reference< ui::XUIConfigurationListener > xToolbarManager( m_xToolbarManager ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; @@ -3138,7 +3139,7 @@ void SAL_CALL LayoutManager::setFastPropertyValue_NoBroadcast( sal_Int32 n sal_Bool bValue(sal_False); if (( aValue >>= bValue ) && bValue ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; bool bAutomaticToolbars( m_bAutomaticToolbars ); aReadLock.unlock(); diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx index 851b6838b6c5..92d7fd29545a 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx @@ -23,6 +23,7 @@ #include <helpers.hxx> #include <services.h> #include <services/layoutmanager.hxx> +#include <threadhelp/guard.hxx> #include <classes/resource.hrc> #include <classes/fwkresid.hxx> @@ -120,7 +121,7 @@ void SAL_CALL ToolbarLayoutManager::disposing( const lang::EventObject& aEvent ) awt::Rectangle ToolbarLayoutManager::getDockingArea() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); Rectangle aNewDockingArea( m_aDockingArea ); aWriteLock.unlock(); @@ -136,7 +137,7 @@ awt::Rectangle ToolbarLayoutManager::getDockingArea() void ToolbarLayoutManager::setDockingArea( const awt::Rectangle& rDockingArea ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aDockingArea = putAWTToRectangle( rDockingArea ); m_bLayoutDirty = true; aWriteLock.unlock(); @@ -144,7 +145,7 @@ void ToolbarLayoutManager::setDockingArea( const awt::Rectangle& rDockingArea ) void ToolbarLayoutManager::implts_setDockingAreaWindowSizes( const awt::Rectangle& rBorderSpace ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Rectangle aDockOffsets = m_aDockingAreaOffsets; uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow ); uno::Reference< awt::XWindow > xTopDockAreaWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP] ); @@ -212,7 +213,7 @@ bool ToolbarLayoutManager::isLayoutDirty() void ToolbarLayoutManager::doLayout(const ::Size& aContainerSize) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); bool bLayoutInProgress( m_bLayoutInProgress ); m_bLayoutInProgress = true; awt::Rectangle aDockingArea = putRectangleValueToAWT( m_aDockingArea ); @@ -249,7 +250,7 @@ void ToolbarLayoutManager::doLayout(const ::Size& aContainerSize) bool ToolbarLayoutManager::implts_isParentWindowVisible() const { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bVisible( false ); if ( m_xContainerWindow.is() ) bVisible = m_xContainerWindow->isVisible(); @@ -259,7 +260,7 @@ bool ToolbarLayoutManager::implts_isParentWindowVisible() const Rectangle ToolbarLayoutManager::implts_calcDockingArea() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); UIElementVector aWindowVector( m_aUIElements ); aReadLock.unlock(); @@ -359,7 +360,7 @@ Rectangle ToolbarLayoutManager::implts_calcDockingArea() void ToolbarLayoutManager::reset() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); uno::Reference< ui::XUIConfigurationManager > xModuleCfgMgr( m_xModuleCfgMgr ); uno::Reference< ui::XUIConfigurationManager > xDocCfgMgr( m_xDocCfgMgr ); m_xModuleCfgMgr.clear(); @@ -382,7 +383,7 @@ void ToolbarLayoutManager::attach( if ( m_xFrame.is() && m_xFrame != xFrame ) reset(); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xFrame = xFrame; m_xModuleCfgMgr = xModuleCfgMgr; m_xDocCfgMgr = xDocCfgMgr; @@ -392,14 +393,14 @@ void ToolbarLayoutManager::attach( bool ToolbarLayoutManager::isPreviewFrame() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); if (m_ePreviewDetection == PREVIEWFRAME_UNKNOWN) { uno::Reference< frame::XFrame > xFrame( m_xFrame ); uno::Reference< frame::XModel > xModel( impl_getModelFromFrame( xFrame )); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_ePreviewDetection = (implts_isPreviewModel( xModel ) ? PREVIEWFRAME_YES : PREVIEWFRAME_NO); } return m_ePreviewDetection == PREVIEWFRAME_YES; @@ -468,7 +469,7 @@ bool ToolbarLayoutManager::destroyToolbar( const OUString& rResourceURL ) bool bMustLayouted( false ); bool bMustBeDestroyed( !rResourceURL.startsWith("private:resource/toolbar/addon_") ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); ++pIter ) { if ( pIter->m_aName == rResourceURL ) @@ -544,7 +545,7 @@ void ToolbarLayoutManager::destroyToolbars() UIElementVector aUIElementVector; implts_getUIElementVectorCopy( aUIElementVector ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aUIElements.clear(); m_bLayoutDirty = true; aWriteLock.unlock(); @@ -614,7 +615,7 @@ void ToolbarLayoutManager::refreshToolbarsVisibility( bool bAutomaticToolbars ) { UIElementVector aUIElementVector; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bVisible( m_bVisible ); aReadLock.unlock(); @@ -631,7 +632,7 @@ void ToolbarLayoutManager::refreshToolbarsVisibility( bool bAutomaticToolbars ) if ( implts_readWindowStateData( pIter->m_aName, aUIElement ) && ( pIter->m_bVisible != aUIElement.m_bVisible ) && !pIter->m_bMasterHide ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); UIElement& rUIElement = impl_findToolbar( pIter->m_aName ); if ( rUIElement.m_aName == pIter->m_aName ) { @@ -788,7 +789,7 @@ bool ToolbarLayoutManager::dockAllToolbars() { std::vector< OUString > aToolBarNameVector; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); UIElementVector::iterator pIter; for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); ++pIter ) { @@ -832,7 +833,7 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent ) if ( !aToolbarName.isEmpty() && !aCommand.isEmpty() ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); ::std::vector< uno::Reference< ui::XUIFunctionListener > > aListenerArray; UIElementVector::iterator pIter; @@ -895,7 +896,7 @@ long ToolbarLayoutManager::childWindowEvent( VclSimpleEvent* pEvent ) void ToolbarLayoutManager::resetDockingArea() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< awt::XWindow > xTopDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP] ); uno::Reference< awt::XWindow > xLeftDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_LEFT] ); uno::Reference< awt::XWindow > xRightDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_RIGHT] ); @@ -922,7 +923,7 @@ void ToolbarLayoutManager::setParentWindow( uno::Reference< awt::XWindow > xRightDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY ); uno::Reference< awt::XWindow > xBottomDockWindow = uno::Reference< awt::XWindow >( createToolkitWindow( m_xContext, xParentWindow, DOCKINGAREASTRING ), uno::UNO_QUERY ); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xContainerWindow = uno::Reference< awt::XWindow2 >( xParentWindow, uno::UNO_QUERY ); m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP] = xTopDockWindow; m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_LEFT] = xLeftDockWindow; @@ -952,7 +953,7 @@ void ToolbarLayoutManager::setParentWindow( void ToolbarLayoutManager::setDockingAreaOffsets( const ::Rectangle aOffsets ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aDockingAreaOffsets = aOffsets; m_bLayoutDirty = true; } @@ -970,7 +971,7 @@ OUString ToolbarLayoutManager::implts_generateGenericAddonToolbarTitle( sal_Int3 void ToolbarLayoutManager::implts_createAddonsToolBars() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( !m_pAddonOptions ) m_pAddonOptions = new AddonsOptions; @@ -1083,7 +1084,7 @@ void ToolbarLayoutManager::implts_createAddonsToolBars() void ToolbarLayoutManager::implts_createCustomToolBars() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); if ( !m_bComponentAttached ) return; @@ -1114,7 +1115,7 @@ void ToolbarLayoutManager::implts_createCustomToolBars() void ToolbarLayoutManager::implts_createNonContextSensitiveToolBars() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); if ( !m_xPersistentWindowState.is() || !m_xFrame.is() || !m_bComponentAttached ) return; @@ -1142,7 +1143,7 @@ void ToolbarLayoutManager::implts_createNonContextSensitiveToolBars() aMakeVisibleToolbars.reserve(aToolbarNames.getLength()); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); const OUString* pTbNames = aToolbarNames.getConstArray(); for ( sal_Int32 i = 0; i < aToolbarNames.getLength(); i++ ) @@ -1228,7 +1229,7 @@ void ToolbarLayoutManager::implts_createCustomToolBar( const OUString& aTbxResNa void ToolbarLayoutManager::implts_reparentToolbars() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); UIElementVector aUIElementVector = m_aUIElements; Window* pContainerWindow = VCLUnoHelper::GetWindow( m_xContainerWindow ); Window* pTopDockWindow = VCLUnoHelper::GetWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP] ); @@ -1286,19 +1287,19 @@ void ToolbarLayoutManager::implts_reparentToolbars() void ToolbarLayoutManager::implts_setToolbarCreation( bool bStart ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bToolbarCreation = bStart; } bool ToolbarLayoutManager::implts_isToolbarCreationActive() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_bToolbarCreation; } void ToolbarLayoutManager::implts_createToolBar( const OUString& aName, bool& bNotify, uno::Reference< ui::XUIElement >& rUIElement ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< frame::XFrame > xFrame( m_xFrame ); uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow ); aReadLock.unlock(); @@ -1337,7 +1338,7 @@ void ToolbarLayoutManager::implts_createToolBar( const OUString& aName, bool& bN } /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); UIElement& rElement = impl_findToolbar( aName ); if ( !rElement.m_aName.isEmpty() ) @@ -1390,7 +1391,7 @@ uno::Reference< ui::XUIElement > ToolbarLayoutManager::implts_createElement( con { uno::Reference< ui::XUIElement > xUIElement; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Sequence< beans::PropertyValue > aPropSeq( 2 ); aPropSeq[0].Name = "Frame"; aPropSeq[0].Value <<= m_xFrame; @@ -1418,7 +1419,7 @@ uno::Reference< ui::XUIElement > ToolbarLayoutManager::implts_createElement( con void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno::Reference< awt::XDockableWindow >& rDockWindow ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bShowElement( rElement.m_bVisible && !rElement.m_bMasterHide && implts_isParentWindowVisible() ); aReadLock.unlock(); @@ -1548,7 +1549,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno void ToolbarLayoutManager::implts_destroyDockingAreaWindows() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); uno::Reference< awt::XWindow > xTopDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP] ); uno::Reference< awt::XWindow > xLeftDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_LEFT] ); uno::Reference< awt::XWindow > xRightDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_RIGHT] ); @@ -1578,7 +1579,7 @@ sal_Bool ToolbarLayoutManager::implts_readWindowStateData( const OUString& aName void ToolbarLayoutManager::implts_writeWindowStateData( const UIElement& rElementData ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); uno::Reference< container::XNameAccess > xPersistentWindowState( m_xPersistentWindowState ); m_bStoreWindowState = true; // set flag to determine that we triggered the notification aWriteLock.unlock(); @@ -1663,7 +1664,7 @@ UIElement& ToolbarLayoutManager::impl_findToolbar( const OUString& aName ) static UIElement aEmptyElement; UIElementVector::iterator pIter; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); ++pIter ) { if ( pIter->m_aName == aName ) @@ -1675,7 +1676,7 @@ UIElement& ToolbarLayoutManager::impl_findToolbar( const OUString& aName ) UIElement ToolbarLayoutManager::implts_findToolbar( const OUString& aName ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); UIElement aElement = impl_findToolbar( aName ); aReadLock.unlock(); @@ -1687,7 +1688,7 @@ UIElement ToolbarLayoutManager::implts_findToolbar( const uno::Reference< uno::X UIElement aToolbar; UIElementVector::const_iterator pIter; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); ++pIter ) { if ( pIter->m_xUIElement.is() ) @@ -1709,7 +1710,7 @@ uno::Reference< awt::XWindow > ToolbarLayoutManager::implts_getXWindow( const OU UIElementVector::iterator pIter; uno::Reference< awt::XWindow > xWindow; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); ++pIter ) { if ( pIter->m_aName == aName && pIter->m_xUIElement.is() ) @@ -1742,7 +1743,7 @@ bool ToolbarLayoutManager::implts_insertToolbar( const UIElement& rUIElement ) if ( !bFound ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aUIElements.push_back( rUIElement ); bResult = true; } @@ -1752,7 +1753,7 @@ bool ToolbarLayoutManager::implts_insertToolbar( const UIElement& rUIElement ) void ToolbarLayoutManager::implts_setToolbar( const UIElement& rUIElement ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); UIElement& rData = impl_findToolbar( rUIElement.m_aName ); if ( rData.m_aName == rUIElement.m_aName ) rData = rUIElement; @@ -1771,7 +1772,7 @@ awt::Point ToolbarLayoutManager::implts_findNextCascadeFloatingPos() const sal_Int32 nCascadeIndentX = 15; const sal_Int32 nCascadeIndentY = 15; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow ); uno::Reference< awt::XWindow > xTopDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP] ); uno::Reference< awt::XWindow > xLeftDockingWindow( m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_LEFT] ); @@ -1831,7 +1832,7 @@ awt::Point ToolbarLayoutManager::implts_findNextCascadeFloatingPos() void ToolbarLayoutManager::implts_sortUIElements() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); UIElementVector::iterator pIterStart = m_aUIElements.begin(); UIElementVector::iterator pIterEnd = m_aUIElements.end(); @@ -1846,7 +1847,7 @@ void ToolbarLayoutManager::implts_sortUIElements() void ToolbarLayoutManager::implts_getUIElementVectorCopy( UIElementVector& rCopy ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); rCopy = m_aUIElements; } @@ -1856,7 +1857,7 @@ void ToolbarLayoutManager::implts_getUIElementVectorCopy( UIElementVector& rCopy uno::Reference< awt::XWindow > xTopDockingAreaWindow; uno::Reference< awt::XWindow > xBottomDockingAreaWindow; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); xTopDockingAreaWindow = m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_TOP]; xBottomDockingAreaWindow = m_xDockAreaWindows[ui::DockingArea_DOCKINGAREA_BOTTOM]; aReadLock.unlock(); @@ -1879,7 +1880,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfos( ui::DockingArea eD uno::Reference< awt::XWindow > xDockAreaWindow; /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); aWindowVector.reserve(m_aUIElements.size()); xDockAreaWindow = m_xDockAreaWindows[eDockingArea]; UIElementVector::iterator pIter; @@ -2064,7 +2065,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D bool bHorzDockArea = isHorizontalDockingArea( eDockingArea ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); UIElementVector::iterator pIter; UIElementVector::iterator pEnd = m_aUIElements.end(); for ( pIter = m_aUIElements.begin(); pIter != pEnd; ++pIter ) @@ -2177,7 +2178,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D return aWinRect; else { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Window* pContainerWindow( VCLUnoHelper::GetWindow( m_xContainerWindow )); Window* pDockingAreaWindow( VCLUnoHelper::GetWindow( m_xDockAreaWindows[DockingArea] )); aReadLock.unlock(); @@ -2273,7 +2274,7 @@ void ToolbarLayoutManager::implts_getDockingAreaElementInfoOnSingleRowCol( ui::D void ToolbarLayoutManager::implts_findNextDockingPos( ui::DockingArea DockingArea, const ::Size& aUIElementSize, awt::Point& rVirtualPos, ::Point& rPixelPos ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< awt::XWindow > xDockingWindow( m_xDockAreaWindows[DockingArea] ); ::Size aDockingWinSize; Window* pDockingWindow( 0 ); @@ -2554,7 +2555,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( } } - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); Window* pDockAreaWindow = VCLUnoHelper::GetWindow( m_xDockAreaWindows[nDockingArea] ); aReadLock.unlock(); @@ -2592,13 +2593,13 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn( void ToolbarLayoutManager::implts_setLayoutDirty() { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bLayoutDirty = true; } void ToolbarLayoutManager::implts_setLayoutInProgress( bool bInProgress ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bLayoutInProgress = bInProgress; } @@ -2620,7 +2621,7 @@ void ToolbarLayoutManager::implts_calcDockingPosSize( ::Rectangle& rTrackingRect, const Point& rMousePos ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow ); ::Size aContainerWinSize; Window* pContainerWindow( 0 ); @@ -3042,7 +3043,7 @@ framework::ToolbarLayoutManager::DockingOperation ToolbarLayoutManager::implts_d const ::Rectangle& rRowColumnRect, const ::Size& rContainerWinSize ) { - ReadGuard aReadGuard( m_aLock ); + Guard aReadGuard( m_aLock ); ::Rectangle aDockingAreaOffsets( m_aDockingAreaOffsets ); aReadGuard.unlock(); @@ -3131,7 +3132,7 @@ void ToolbarLayoutManager::implts_renumberRowColumnData( DockingOperation /*eDockingOperation*/, const UIElement& rUIElement ) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< container::XNameAccess > xPersistentWindowState( m_xPersistentWindowState ); aReadLock.unlock(); @@ -3139,7 +3140,7 @@ void ToolbarLayoutManager::implts_renumberRowColumnData( sal_Int32 nRowCol( bHorzDockingArea ? rUIElement.m_aDockedData.m_aPos.Y : rUIElement.m_aDockedData.m_aPos.X ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); UIElementVector::iterator pIter; for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); ++pIter ) { @@ -3221,7 +3222,7 @@ void ToolbarLayoutManager::implts_renumberRowColumnData( void SAL_CALL ToolbarLayoutManager::windowResized( const awt::WindowEvent& aEvent ) throw( uno::RuntimeException, std::exception ) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); bool bLocked( m_bDockingInProgress ); bool bLayoutInProgress( m_bLayoutInProgress ); aWriteLock.unlock(); @@ -3291,7 +3292,7 @@ throw (uno::RuntimeException, std::exception) { bool bWinFound( false ); - ReadGuard aReadGuard( m_aLock ); + Guard aReadGuard( m_aLock ); uno::Reference< awt::XWindow2 > xContainerWindow( m_xContainerWindow ); uno::Reference< awt::XWindow2 > xWindow( e.Source, uno::UNO_QUERY ); aReadGuard.unlock(); @@ -3333,7 +3334,7 @@ throw (uno::RuntimeException, std::exception) } } - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bDockingInProgress = bWinFound; m_aDockUIElement = aUIElement; m_aDockUIElement.m_bUserActive = true; @@ -3347,7 +3348,7 @@ throw (uno::RuntimeException, std::exception) const sal_Int32 MAGNETIC_DISTANCE_UNDOCK = 25; const sal_Int32 MAGNETIC_DISTANCE_DOCK = 20; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); awt::DockingData aDockingData; uno::Reference< awt::XDockableWindow > xDockWindow( e.Source, uno::UNO_QUERY ); uno::Reference< awt::XWindow > xWindow( e.Source, uno::UNO_QUERY ); @@ -3498,7 +3499,7 @@ throw (uno::RuntimeException, std::exception) aDockingData.bFloating = ( eDockingArea == -1 ); // Write current data to the member docking progress data - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_aDockUIElement.m_bFloating = aDockingData.bFloating; if ( !aDockingData.bFloating ) { @@ -3528,7 +3529,7 @@ throw (uno::RuntimeException, std::exception) UIElement aUIDockingElement; /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); bDockingInProgress = m_bDockingInProgress; aUIDockingElement = m_aDockUIElement; bFloating = aUIDockingElement.m_bFloating; @@ -3618,7 +3619,7 @@ throw (uno::RuntimeException, std::exception) sal_Bool SAL_CALL ToolbarLayoutManager::prepareToggleFloatingMode( const lang::EventObject& e ) throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bDockingInProgress = m_bDockingInProgress; aReadLock.unlock(); @@ -3662,7 +3663,7 @@ throw (uno::RuntimeException, std::exception) { UIElement aUIDockingElement; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bDockingInProgress( m_bDockingInProgress ); if ( bDockingInProgress ) aUIDockingElement = m_aDockUIElement; @@ -3795,7 +3796,7 @@ throw (uno::RuntimeException, std::exception) UIElement aUIElement; UIElementVector::iterator pIter; - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); for ( pIter = m_aUIElements.begin(); pIter != m_aUIElements.end(); ++pIter ) { uno::Reference< ui::XUIElement > xUIElement( pIter->m_xUIElement ); @@ -3825,7 +3826,7 @@ throw (uno::RuntimeException, std::exception) implts_writeWindowStateData( aUIElement ); destroyToolbar( aName ); - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); bool bLayoutDirty = m_bLayoutDirty; ILayoutNotifications* pParentLayouter( m_pParentLayouter ); aWriteLock.unlock(); @@ -3910,7 +3911,7 @@ throw (uno::RuntimeException, std::exception) void SAL_CALL ToolbarLayoutManager::elementRemoved( const ui::ConfigurationEvent& rEvent ) throw (uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); uno::Reference< awt::XWindow > xContainerWindow( m_xContainerWindow, uno::UNO_QUERY ); uno::Reference< ui::XUIConfigurationManager > xModuleCfgMgr( m_xModuleCfgMgr ); uno::Reference< ui::XUIConfigurationManager > xDocCfgMgr( m_xDocCfgMgr ); @@ -3978,7 +3979,7 @@ throw (uno::RuntimeException, std::exception) { xElementSettings->updateSettings(); - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); bool bNotify = !aUIElement.m_bFloating; m_bLayoutDirty = bNotify; ILayoutNotifications* pParentLayouter( m_pParentLayouter ); @@ -3999,7 +4000,7 @@ uno::Sequence< uno::Reference< ui::XUIElement > > ToolbarLayoutManager::getToolb { uno::Sequence< uno::Reference< ui::XUIElement > > aSeq; - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); if ( m_aUIElements.size() > 0 ) { sal_uInt32 nCount(0); diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.hxx b/framework/source/layoutmanager/toolbarlayoutmanager.hxx index 8062eb32cf16..cc93864362e7 100644 --- a/framework/source/layoutmanager/toolbarlayoutmanager.hxx +++ b/framework/source/layoutmanager/toolbarlayoutmanager.hxx @@ -27,8 +27,6 @@ #include <threadhelp/threadhelpbase.hxx> #include <threadhelp/resetableguard.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> #include <macros/generic.hxx> #include <macros/xinterface.hxx> #include <macros/xtypeprovider.hxx> diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index b766143b5fd4..948734e2a276 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -23,8 +23,7 @@ #include <framework/framelistanalyzer.hxx> #include <interaction/quietinteraction.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <threadhelp/resetableguard.hxx> #include <properties.h> #include <protocols.h> @@ -236,7 +235,7 @@ void LoadEnv::initializeLoading(const OUString& EContentType eContentType ) // => use default ... { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // Handle still running processes! if (m_xAsynchronousJob.is()) @@ -361,7 +360,7 @@ void LoadEnv::initializeUIDefaults( const css::uno::Reference< css::uno::XCompon void LoadEnv::startLoading() { // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // Handle still running processes! if (m_xAsynchronousJob.is()) @@ -423,7 +422,7 @@ sal_Bool LoadEnv::waitWhileLoading(sal_uInt32 nTimeout) while(true) { // SAFE -> ------------------------------ - ReadGuard aReadLock1(m_aLock); + Guard aReadLock1(m_aLock); if (!m_xAsynchronousJob.is()) break; aReadLock1.unlock(); @@ -442,7 +441,7 @@ sal_Bool LoadEnv::waitWhileLoading(sal_uInt32 nTimeout) } // SAFE -> ---------------------------------- - ReadGuard aReadLock2(m_aLock); + Guard aReadLock2(m_aLock); return !m_xAsynchronousJob.is(); // <- SAFE ---------------------------------- } @@ -450,7 +449,7 @@ sal_Bool LoadEnv::waitWhileLoading(sal_uInt32 nTimeout) css::uno::Reference< css::lang::XComponent > LoadEnv::getTargetComponent() const { // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); if (!m_xTargetFrame.is()) return css::uno::Reference< css::lang::XComponent >(); @@ -472,7 +471,7 @@ void SAL_CALL LoadEnvListener::loadFinished(const css::uno::Reference< css::fram throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_bWaitingResult) m_pLoadEnv->impl_setResult(sal_True); @@ -487,7 +486,7 @@ void SAL_CALL LoadEnvListener::loadCancelled(const css::uno::Reference< css::fra throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_bWaitingResult) m_pLoadEnv->impl_setResult(sal_False); @@ -502,7 +501,7 @@ void SAL_CALL LoadEnvListener::dispatchFinished(const css::frame::DispatchResult throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (!m_bWaitingResult) return; @@ -532,7 +531,7 @@ void SAL_CALL LoadEnvListener::disposing(const css::lang::EventObject&) throw(css::uno::RuntimeException, std::exception) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if (m_bWaitingResult) m_pLoadEnv->impl_setResult(sal_False); @@ -546,7 +545,7 @@ void SAL_CALL LoadEnvListener::disposing(const css::lang::EventObject&) void LoadEnv::impl_setResult(sal_Bool bResult) { // SAFE -> ---------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_bLoaded = bResult; @@ -798,7 +797,7 @@ void LoadEnv::impl_detectTypeAndFilter() static sal_Int32 FILTERFLAG_TEMPLATEPATH = 16; // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // Attention: Because our stl media descriptor is a copy of an uno sequence // we can't use as an in/out parameter here. Copy it before and don't forget to @@ -833,7 +832,7 @@ void LoadEnv::impl_detectTypeAndFilter() LoadEnvException::ID_UNSUPPORTED_CONTENT, "type detection failed"); // SAFE -> - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // detection was successfully => update the descriptor member of this class m_lMediaDescriptor << lDescriptor; @@ -913,7 +912,7 @@ sal_Bool LoadEnv::impl_handleContent() throw(LoadEnvException, css::uno::RuntimeException) { // SAFE -> ----------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // the type must exist inside the descriptor ... otherwise this class is implemented wrong :-) OUString sType = m_lMediaDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_TYPENAME(), OUString()); @@ -960,7 +959,7 @@ sal_Bool LoadEnv::impl_handleContent() { continue; } // SAFE -> ----------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xAsynchronousJob = xHandler; LoadEnvListener* pListener = new LoadEnvListener(this); aWriteLock.unlock(); @@ -979,7 +978,7 @@ sal_Bool LoadEnv::impl_handleContent() sal_Bool LoadEnv::impl_furtherDocsAllowed() { // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE @@ -1061,7 +1060,7 @@ sal_Bool LoadEnv::impl_loadContent() throw(LoadEnvException, css::uno::RuntimeException) { // SAFE -> ----------------------------------- - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); // search or create right target frame OUString sTarget = m_sTarget; @@ -1199,7 +1198,7 @@ sal_Bool LoadEnv::impl_loadContent() css::uno::Reference< css::uno::XInterface > LoadEnv::impl_searchLoader() { // SAFE -> ----------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // special mode to set an existing component on this frame // In such case the loader is fix. It must be the SFX based implementation, @@ -1274,7 +1273,7 @@ void LoadEnv::impl_jumpToMark(const css::uno::Reference< css::frame::XFrame >& x return; // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE @@ -1299,7 +1298,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchAlreadyLoaded() throw(LoadEnvException, css::uno::RuntimeException) { // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // such search is allowed for special requests only ... // or better its not allowed for some requests in general :-) @@ -1459,7 +1458,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget() throw(LoadEnvException, css::uno::RuntimeException) { // SAFE -> .................................. - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // The special backing mode frame will be recycled by definition! // It doesn't matter if somewhere wants to create a new view @@ -1570,7 +1569,7 @@ css::uno::Reference< css::frame::XFrame > LoadEnv::impl_searchRecycleTarget() } // SAFE -> .................................. - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); css::uno::Reference< css::document::XActionLockable > xLock(xTask, css::uno::UNO_QUERY); if (!m_aTargetLock.setResource(xLock)) @@ -1593,7 +1592,7 @@ void LoadEnv::impl_reactForLoadingState() /*TODO reset action locks */ // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); if (m_bLoaded) { @@ -1711,7 +1710,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X sal_Bool bForceToFront) { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); // <- SAFE ---------------------------------- @@ -1783,7 +1782,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw // <- SOLAR SAFE // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // no filter -> no module -> no persistent window state OUString sFilter = m_lMediaDescriptor.getUnpackedValueOrDefault( diff --git a/framework/source/recording/dispatchrecorder.cxx b/framework/source/recording/dispatchrecorder.cxx index 6f9d0882e484..9e10d7b7859f 100644 --- a/framework/source/recording/dispatchrecorder.cxx +++ b/framework/source/recording/dispatchrecorder.cxx @@ -21,8 +21,7 @@ #include <recording/dispatchrecorder.hxx> #include <com/sun/star/frame/DispatchStatement.hpp> #include <com/sun/star/script/Converter.hpp> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <vcl/svapp.hxx> #include <comphelper/processfactory.hxx> @@ -144,7 +143,7 @@ void SAL_CALL DispatchRecorder::recordDispatchAsComment( const css::util::URL& void SAL_CALL DispatchRecorder::endRecording() throw( css::uno::RuntimeException, std::exception ) { /* SAFE{ */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_aStatements.clear(); /* } */ } @@ -152,7 +151,7 @@ void SAL_CALL DispatchRecorder::endRecording() throw( css::uno::RuntimeException OUString SAL_CALL DispatchRecorder::getRecordedMacro() throw( css::uno::RuntimeException, std::exception ) { /* SAFE{ */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); if ( m_aStatements.empty() ) return OUString(); diff --git a/framework/source/recording/dispatchrecordersupplier.cxx b/framework/source/recording/dispatchrecordersupplier.cxx index 209afd78af71..6fbcad461624 100644 --- a/framework/source/recording/dispatchrecordersupplier.cxx +++ b/framework/source/recording/dispatchrecordersupplier.cxx @@ -18,8 +18,7 @@ */ #include <recording/dispatchrecordersupplier.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <com/sun/star/frame/XRecordableDispatch.hpp> @@ -97,7 +96,7 @@ DispatchRecorderSupplier::~DispatchRecorderSupplier() void SAL_CALL DispatchRecorderSupplier::setDispatchRecorder( const css::uno::Reference< css::frame::XDispatchRecorder >& xRecorder ) throw (css::uno::RuntimeException, std::exception) { // SAFE => - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xDispatchRecorder=xRecorder; // => SAFE } @@ -119,7 +118,7 @@ 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) { // SAFE => - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); return m_xDispatchRecorder; // => SAFE } @@ -143,7 +142,7 @@ void SAL_CALL DispatchRecorderSupplier::dispatchAndRecord( const css::util::URL& const css::uno::Reference< css::frame::XDispatch >& xDispatcher ) throw (css::uno::RuntimeException, std::exception) { // SAFE => - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XDispatchRecorder > xRecorder = m_xDispatchRecorder; aReadLock.unlock(); // => SAFE diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index fe12cfd17a20..fadbdf074dd8 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -29,8 +29,7 @@ #include <dispatch/interceptionhelper.hxx> #include <classes/taskcreator.hxx> #include <threadhelp/transactionguard.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <general.h> #include <properties.h> @@ -221,7 +220,7 @@ sal_Bool SAL_CALL Desktop::terminate() { TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); - ReadGuard aReadLock( m_aLock ); // start synchronize + Guard aReadLock( m_aLock ); // start synchronize css::uno::Reference< css::frame::XTerminateListener > xPipeTerminator = m_xPipeTerminator; css::uno::Reference< css::frame::XTerminateListener > xQuickLauncher = m_xQuickLauncher; @@ -316,7 +315,7 @@ sal_Bool SAL_CALL Desktop::terminate() // "Protect" us against dispose before terminate calls! // see dispose() for further information. /* SAFE AREA --------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bIsTerminated = sal_True; aWriteLock.unlock(); /* UNSAFE AREA ------------------------------------------------------------------------------------- */ @@ -389,7 +388,7 @@ void SAL_CALL Desktop::addTerminateListener( const css::uno::Reference< css::fra OUString sImplementationName = xInfo->getImplementationName(); // SYCNHRONIZED -> - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if( sImplementationName == "com.sun.star.comp.sfx2.SfxTerminateListener" ) { @@ -432,7 +431,7 @@ void SAL_CALL Desktop::removeTerminateListener( const css::uno::Reference< css:: OUString sImplementationName = xInfo->getImplementationName(); // SYCNHRONIZED -> - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if( sImplementationName == "com.sun.star.comp.sfx2.SfxTerminateListener" ) { @@ -848,7 +847,7 @@ css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL Desktop::getCreator( OUString SAL_CALL Desktop::getName() throw( css::uno::RuntimeException, std::exception ) { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_sName; /* } SAFE */ } @@ -856,7 +855,7 @@ OUString SAL_CALL Desktop::getName() throw( css::uno::RuntimeException, std::exc void SAL_CALL Desktop::setName( const OUString& sName ) throw( css::uno::RuntimeException, std::exception ) { /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_sName = sName; aWriteLock.unlock(); /* } SAFE */ @@ -1088,7 +1087,7 @@ void SAL_CALL Desktop::disposing() // tests for instance in sc/qa/unit) nothing bad happens. SAL_WARN_IF( !m_bIsTerminated, "fwk", "Desktop disposed before terminating it" ); - WriteGuard aWriteLock( m_aLock ); // start synchronize + Guard aWriteLock( m_aLock ); // start synchronize // Look for multiple calls of this method! // If somewhere call dispose() twice - he will be stopped here really!!! @@ -1212,7 +1211,7 @@ void SAL_CALL Desktop::dispatchFinished( const css::frame::DispatchResultEvent& TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if( m_eLoadState != E_INTERACTION ) { m_xLastFrame = css::uno::Reference< css::frame::XFrame >(); @@ -1341,7 +1340,7 @@ void SAL_CALL Desktop::handle( const css::uno::Reference< css::task::XInteractio // For example warnings will be approved and we wait for any success story ... if (bAbort) { - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_eLoadState = E_INTERACTION; m_aInteractionRequest = aRequest ; aWriteLock.unlock(); @@ -1805,7 +1804,7 @@ void Desktop::impl_sendNotifyTerminationEvent() ::sal_Bool Desktop::impl_closeFrames(::sal_Bool bAllowUI) { - ReadGuard aReadLock( m_aLock ); // start synchronize + Guard aReadLock( m_aLock ); // start synchronize css::uno::Sequence< css::uno::Reference< css::frame::XFrame > > lFrames = m_aChildTaskContainer.getAllElements(); aReadLock.unlock(); // end synchronize diff --git a/framework/source/services/dispatchhelper.cxx b/framework/source/services/dispatchhelper.cxx index abe5e147b98d..f84ef5ca5111 100644 --- a/framework/source/services/dispatchhelper.cxx +++ b/framework/source/services/dispatchhelper.cxx @@ -18,8 +18,7 @@ */ #include <services/dispatchhelper.hxx> -#include <threadhelp/readguard.hxx> -#include <threadhelp/writeguard.hxx> +#include <threadhelp/guard.hxx> #include <services.h> #include <com/sun/star/util/URLTransformer.hpp> @@ -103,7 +102,7 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch( // parse given URL /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::util::XURLTransformer > xParser = css::util::URLTransformer::create(m_xContext); aReadLock.unlock(); /* } SAFE */ @@ -130,7 +129,7 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch( // Here we can hope for a result ... instead of the normal dispatch. css::uno::Reference< css::frame::XDispatchResultListener > xListener(xTHIS, css::uno::UNO_QUERY); /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xBroadcaster = css::uno::Reference< css::uno::XInterface >(xNotifyDispatch, css::uno::UNO_QUERY); m_aResult = css::uno::Any(); m_aBlock.reset(); @@ -166,7 +165,7 @@ void SAL_CALL DispatchHelper::dispatchFinished( const css::frame::DispatchResult throw(css::uno::RuntimeException, std::exception) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_aResult <<= aResult; m_aBlock.set(); @@ -186,7 +185,7 @@ void SAL_CALL DispatchHelper::disposing( const css::lang::EventObject& ) throw(css::uno::RuntimeException, std::exception) { /* SAFE { */ - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_aResult.clear(); m_aBlock.set(); diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index bf60a8f3047e..042d3cbfc73e 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -33,8 +33,7 @@ #include <classes/framecontainer.hxx> #include <classes/propertysethelper.hxx> #include <threadhelp/resetableguard.hxx> -#include <threadhelp/writeguard.hxx> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <threadhelp/threadhelpbase.hxx> #include <threadhelp/transactionguard.hxx> #include <threadhelp/transactionbase.hxx> @@ -453,31 +452,31 @@ protected: inline css::uno::Reference< css::uno::XComponentContext > impl_getComponentContext() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xContext; } inline OUString impl_getName() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_sName; } inline css::uno::Reference< css::awt::XWindow > impl_getContainerWindow() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xContainerWindow; } inline css::uno::Reference< css::frame::XDispatchProvider > impl_getDispatchHelper() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xDispatchHelper; } inline css::uno::Reference< css::frame::XFramesSupplier > impl_getParent() { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xParent; } }; @@ -693,7 +692,7 @@ css::uno::Reference< css::lang::XComponent > SAL_CALL Frame::loadComponentFromUR TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); } - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XComponentLoader > xThis(static_cast< css::frame::XComponentLoader* >(this), css::uno::UNO_QUERY); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); @@ -729,7 +728,7 @@ css::uno::Reference< css::frame::XFrames > SAL_CALL Frame::getFrames() throw( cs TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // Return access to all child frames to caller. // Ouer childframe container is implemented in helper class OFrames and used as a reference m_xFramesHelper! @@ -758,7 +757,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::getActiveFrame() throw TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // Return current active frame. // This information is available on the container. @@ -788,7 +787,7 @@ void SAL_CALL Frame::setActiveFrame( const css::uno::Reference< css::frame::XFra TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); // Copy necessary member for threadsafe access! // m_aChildFrameContainer is threadsafe himself and he live if we live!!! @@ -901,7 +900,7 @@ void SAL_CALL Frame::initialize( const css::uno::Reference< css::awt::XWindow >& static_cast< css::frame::XFrame* >(this)); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if ( m_xContainerWindow.is() ) throw css::uno::RuntimeException( @@ -982,7 +981,7 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL Frame::getContainerWindow() th TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xContainerWindow; } @@ -1009,7 +1008,7 @@ void SAL_CALL Frame::setCreator( const css::uno::Reference< css::frame::XFramesS TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xParent = xCreator; aWriteLock.unlock(); /* } SAFE */ @@ -1036,7 +1035,7 @@ css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL Frame::getCreator() TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xParent; } @@ -1055,7 +1054,7 @@ css::uno::Reference< css::frame::XFramesSupplier > SAL_CALL Frame::getCreator() OUString SAL_CALL Frame::getName() throw( css::uno::RuntimeException, std::exception ) { /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_sName; /* } SAFE */ } @@ -1077,7 +1076,7 @@ OUString SAL_CALL Frame::getName() throw( css::uno::RuntimeException, std::excep void SAL_CALL Frame::setName( const OUString& sName ) throw( css::uno::RuntimeException, std::exception ) { /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); // Set new name ... but look for invalid special target names! // They are not allowed to set. if (TargetHelper::isValidNameForFrame(sName)) @@ -1138,7 +1137,7 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const OUStr // get threadsafe some necessary member which are necessary for following functionality /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::frame::XFrame > xParent ( m_xParent, css::uno::UNO_QUERY ); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; sal_Bool bIsTopFrame = m_bIsFrameTop; @@ -1392,7 +1391,7 @@ sal_Bool SAL_CALL Frame::isTop() throw( css::uno::RuntimeException, std::excepti TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // This information is set in setCreator(). // We are top, if ouer parent is a task or the desktop or if no parent exist! @@ -1421,7 +1420,7 @@ void SAL_CALL Frame::activate() throw( css::uno::RuntimeException, std::exceptio TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); // Copy necessary member and free the lock. // It's not necessary for m_aChildFrameContainer ... because @@ -1514,7 +1513,7 @@ void SAL_CALL Frame::deactivate() throw( css::uno::RuntimeException, std::except TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); // Copy necessary member and free the lock. css::uno::Reference< css::frame::XFrame > xActiveChild = m_aChildFrameContainer.getActive() ; @@ -1595,7 +1594,7 @@ sal_Bool SAL_CALL Frame::isActive() throw( css::uno::RuntimeException, std::exce TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return ( ( m_eActiveState == E_ACTIVE ) || @@ -1666,7 +1665,7 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X // Get threadsafe some copies of used members. /* SAFE { */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow; css::uno::Reference< css::awt::XWindow > xOldComponentWindow = m_xComponentWindow; css::uno::Reference< css::frame::XController > xOldController = m_xController; @@ -1705,7 +1704,7 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X // Before we dispose this controller we should hide it inside this frame instance. // We hold it alive for next calls by using xOldController! /* SAFE {*/ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xController = NULL; aWriteLock.unlock(); /* } SAFE */ @@ -1735,7 +1734,7 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X ) { /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xComponentWindow = NULL; aWriteLock.unlock(); /* } SAFE */ @@ -1758,7 +1757,7 @@ sal_Bool SAL_CALL Frame::setComponent( const css::uno::Reference< css::awt::X // Now it's time to set the new component ... // By the way - find out our new "load state" - means if we have a valid component inside. /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xComponentWindow = xComponentWindow; m_xController = xController ; m_bConnected = (m_xComponentWindow.is() || m_xController.is()); @@ -1826,7 +1825,7 @@ css::uno::Reference< css::awt::XWindow > SAL_CALL Frame::getComponentWindow() th TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xComponentWindow; } @@ -1854,7 +1853,7 @@ css::uno::Reference< css::frame::XController > SAL_CALL Frame::getController() t /* UNSAFE AREA --------------------------------------------------------------------------------------------- */ /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xController; } @@ -1958,7 +1957,7 @@ void SAL_CALL Frame::close( sal_Bool bDeliverOwnership ) throw( css::util::Close if (bDeliverOwnership) { /* SAFE */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bSelfClose = sal_True; aWriteLock.unlock(); /* SAFE */ @@ -1989,7 +1988,7 @@ void SAL_CALL Frame::close( sal_Bool bDeliverOwnership ) throw( css::util::Close } /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_bIsHidden = sal_True; aWriteLock.unlock(); /* } SAFE */ @@ -2040,7 +2039,7 @@ OUString SAL_CALL Frame::getTitle() TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XTitle > xTitle(m_xTitleHelper, css::uno::UNO_QUERY_THROW); aReadLock.unlock(); // <- SAFE @@ -2055,7 +2054,7 @@ void SAL_CALL Frame::setTitle( const OUString& sTitle ) TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XTitle > xTitle(m_xTitleHelper, css::uno::UNO_QUERY_THROW); aReadLock.unlock(); // <- SAFE @@ -2070,7 +2069,7 @@ void SAL_CALL Frame::addTitleChangeListener( const css::uno::Reference< css::fra TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XTitleChangeBroadcaster > xTitle(m_xTitleHelper, css::uno::UNO_QUERY_THROW); aReadLock.unlock(); // <- SAFE @@ -2085,7 +2084,7 @@ void SAL_CALL Frame::removeTitleChangeListener( const css::uno::Reference< css:: TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XTitleChangeBroadcaster > xTitle(m_xTitleHelper, css::uno::UNO_QUERY_THROW); aReadLock.unlock(); // <- SAFE @@ -2101,7 +2100,7 @@ css::uno::Reference<css::container::XNameContainer> SAL_CALL Frame::getUserDefin css::uno::Reference<css::frame::XDispatchRecorderSupplier> SAL_CALL Frame::getDispatchRecorderSupplier() throw (css::uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xDispatchRecorderSupplier; } @@ -2110,7 +2109,7 @@ void SAL_CALL Frame::setDispatchRecorderSupplier(const css::uno::Reference<css:: TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xDispatchRecorderSupplier.set(p); aWriteLock.unlock(); /* } SAFE */ @@ -2118,7 +2117,7 @@ void SAL_CALL Frame::setDispatchRecorderSupplier(const css::uno::Reference<css:: css::uno::Reference<css::uno::XInterface> SAL_CALL Frame::getLayoutManager() throw (css::uno::RuntimeException, std::exception) { - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return m_xLayoutManager; } @@ -2127,7 +2126,7 @@ void SAL_CALL Frame::setLayoutManager(const css::uno::Reference<css::uno::XInter TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE { */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); m_xLayoutManager.set(p1, css::uno::UNO_QUERY); aWriteLock.unlock(); /* } SAFE */ @@ -2138,7 +2137,7 @@ void SAL_CALL Frame::setLayoutManager(const css::uno::Reference<css::uno::XInter void Frame::implts_forgetSubFrames() { // SAFE -> - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::container::XIndexAccess > xContainer(m_xFramesHelper, css::uno::UNO_QUERY_THROW); aReadLock.unlock(); // <- SAFE @@ -2163,7 +2162,7 @@ void Frame::implts_forgetSubFrames() } // SAFE -> - WriteGuard aWriteLock(m_aLock); + Guard aWriteLock(m_aLock); m_xFramesHelper.clear(); // clear uno reference m_aChildFrameContainer.clear(); // clear container content aWriteLock.unlock(); @@ -2376,7 +2375,7 @@ css::uno::Reference< css::task::XStatusIndicator > SAL_CALL Frame::createStatusI TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // Make snapshot of necessary member and define default return value. css::uno::Reference< css::task::XStatusIndicator > xExternal(m_xIndicatorInterception.get(), css::uno::UNO_QUERY); @@ -2558,7 +2557,7 @@ void SAL_CALL Frame::focusGained( const css::awt::FocusEvent& aEvent ) throw( cs TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // Make snapshot of member! css::uno::Reference< css::awt::XWindow > xComponentWindow = m_xComponentWindow; aReadLock.unlock(); @@ -2594,7 +2593,7 @@ void SAL_CALL Frame::windowActivated( const css::lang::EventObject& aEvent ) thr TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); // Make snapshot of member! EActiveState eState = m_eActiveState; aReadLock.unlock(); @@ -2618,7 +2617,7 @@ void SAL_CALL Frame::windowDeactivated( const css::lang::EventObject& aEvent ) t TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::frame::XFrame > xParent ( m_xParent, css::uno::UNO_QUERY ); css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow; @@ -2683,7 +2682,7 @@ void SAL_CALL Frame::windowClosing( const css::lang::EventObject& ) throw( css:: */ /* SAFE */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; aReadLock.unlock(); /* SAFE */ @@ -2729,7 +2728,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno static sal_Bool bFirstVisibleTask = sal_True; /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::frame::XDesktop > xDesktopCheck( m_xParent, css::uno::UNO_QUERY ); css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; m_bIsHidden = sal_False; @@ -2741,7 +2740,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno if (xDesktopCheck.is()) { /* STATIC SAFE { */ - WriteGuard aStaticWriteLock( LockHelper::getGlobalLock() ); + Guard aStaticWriteLock( LockHelper::getGlobalLock() ); sal_Bool bMustBeTriggered = bFirstVisibleTask; bFirstVisibleTask = sal_False; aStaticWriteLock.unlock(); @@ -2759,7 +2758,7 @@ void SAL_CALL Frame::windowShown( const css::lang::EventObject& ) throw(css::uno void SAL_CALL Frame::windowHidden( const css::lang::EventObject& ) throw(css::uno::RuntimeException, std::exception) { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); m_bIsHidden = sal_True; aReadLock.unlock(); /* } SAFE */ @@ -2792,7 +2791,7 @@ void SAL_CALL Frame::disposing( const css::lang::EventObject& aEvent ) throw( cs TransactionGuard aTransaction( m_aTransactionManager, E_SOFTEXCEPTIONS ); /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); if( aEvent.Source == m_xContainerWindow ) { @@ -2826,14 +2825,14 @@ void SAL_CALL Frame::disposing( const css::lang::EventObject& aEvent ) throw( cs sal_Bool SAL_CALL Frame::isActionLocked() throw( css::uno::RuntimeException, std::exception ) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); return( m_nExternalLockCount!=0); } void SAL_CALL Frame::addActionLock() throw( css::uno::RuntimeException, std::exception ) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); ++m_nExternalLockCount; } @@ -2843,7 +2842,7 @@ void SAL_CALL Frame::removeActionLock() throw( css::uno::RuntimeException, std:: // implts_checkSuicide()/dispose() request ... /* SAFE AREA */{ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); SAL_WARN_IF( m_nExternalLockCount<=0, "fwk", "Frame::removeActionLock(): Frame isn't locked! Possible multithreading problem detected." ); --m_nExternalLockCount; }/* SAFE */ @@ -2854,7 +2853,7 @@ void SAL_CALL Frame::removeActionLock() throw( css::uno::RuntimeException, std:: void SAL_CALL Frame::setActionLocks( sal_Int16 nLock ) throw( css::uno::RuntimeException, std::exception ) { /* SAFE AREA ----------------------------------------------------------------------------------------------- */ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); // Attention: If somewhere called resetActionLocks() before and get e.g. 5 locks ... // and tried to set these 5 ones here after his operations ... // we can't ignore setted requests during these two calls! @@ -2869,7 +2868,7 @@ sal_Int16 SAL_CALL Frame::resetActionLocks() throw( css::uno::RuntimeException, sal_Int16 nCurrentLocks = 0; /* SAFE */{ - WriteGuard aWriteLock( m_aLock ); + Guard aWriteLock( m_aLock ); nCurrentLocks = m_nExternalLockCount; m_nExternalLockCount = 0; }/* SAFE */ @@ -3173,7 +3172,7 @@ void Frame::implts_setIconOnWindow() /* SAFE AREA ----------------------------------------------------------------------------------------------- */ // Make snapshot of necessary members and release lock. - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::awt::XWindow > xContainerWindow( m_xContainerWindow, css::uno::UNO_QUERY ); css::uno::Reference< css::frame::XController > xController ( m_xController , css::uno::UNO_QUERY ); aReadLock.unlock(); @@ -3270,7 +3269,7 @@ void Frame::implts_startWindowListening() /* SAFE AREA ----------------------------------------------------------------------------------------------- */ // Make snapshot of necessary member! - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow ; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener; @@ -3310,7 +3309,7 @@ void Frame::implts_stopWindowListening() /* SAFE AREA ----------------------------------------------------------------------------------------------- */ // Make snapshot of necessary member! - ReadGuard aReadLock( m_aLock ); + Guard aReadLock( m_aLock ); css::uno::Reference< css::awt::XWindow > xContainerWindow = m_xContainerWindow ; css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext ; css::uno::Reference< css::datatransfer::dnd::XDropTargetListener > xDragDropListener = m_xDropTargetListener; @@ -3358,7 +3357,7 @@ void Frame::implts_stopWindowListening() void Frame::implts_checkSuicide() { /* SAFE */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // in case of lock==0 and safed state of previous close() request m_bSelfClose // we must force close() again. Because we had disagreed with that before. sal_Bool bSuicide = (m_nExternalLockCount==0 && m_bSelfClose); @@ -3426,7 +3425,7 @@ void Frame::impl_setCloser( /*IN*/ const css::uno::Reference< css::frame::XFrame void Frame::impl_checkMenuCloser() { /* SAFE { */ - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); // only top frames, which are part of our desktop hierarchy, can // do so! By the way - we need the desktop instance to have access @@ -3488,7 +3487,7 @@ void Frame::impl_checkMenuCloser() // Only if the closer state must be moved from one frame to another one // or must be enabled/disabled at all. /* STATIC SAFE { */ - WriteGuard aStaticWriteLock(LockHelper::getGlobalLock()); + Guard aStaticWriteLock(LockHelper::getGlobalLock()); css::uno::Reference< css::frame::XFrame2 > xCloserFrame (m_xCloserFrame.get(), css::uno::UNO_QUERY); if (xCloserFrame!=xNewCloserFrame) { diff --git a/framework/source/xml/acceleratorconfigurationwriter.cxx b/framework/source/xml/acceleratorconfigurationwriter.cxx index f18a72b9de21..82f98c1a5bb6 100644 --- a/framework/source/xml/acceleratorconfigurationwriter.cxx +++ b/framework/source/xml/acceleratorconfigurationwriter.cxx @@ -20,7 +20,7 @@ #include <xml/acceleratorconfigurationwriter.hxx> #include <acceleratorconst.h> -#include <threadhelp/readguard.hxx> +#include <threadhelp/guard.hxx> #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> #include <com/sun/star/xml/sax/XAttributeList.hpp> @@ -53,7 +53,7 @@ AcceleratorConfigurationWriter::~AcceleratorConfigurationWriter() void AcceleratorConfigurationWriter::flush() { // SAFE -> ---------------------------------- - ReadGuard aReadLock(m_aLock); + Guard aReadLock(m_aLock); css::uno::Reference< css::xml::sax::XDocumentHandler > xCFG = m_xConfig; css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > xExtendedCFG(m_xConfig, css::uno::UNO_QUERY_THROW); |