diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-10-08 20:57:40 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-10-08 20:57:40 +0200 |
commit | cac5ec7effaae0f1f25758cf2f4fe94846a21b9a (patch) | |
tree | 7e43e0d88781a3fcc69ca33dc740ec45a41a01e0 /unotools | |
parent | 62c0e0c6b18e5e7a9d0ce9d6c53f4c3b1ba5204e (diff) |
#i103496#: have SolarMutex in tools
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/configitem.cxx | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx index 3170fae25a5d..38aee1b39d16 100644 --- a/unotools/source/config/configitem.cxx +++ b/unotools/source/config/configitem.cxx @@ -45,13 +45,12 @@ #include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/awt/XRequestCallback.hpp> -#include <com/sun/star/awt/XCallback.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/util/XStringEscape.hpp> #include <com/sun/star/util/XChangesBatch.hpp> #include <osl/diagnose.h> - +#include <tools/solarmutex.hxx> #include <rtl/ustrbuf.hxx> using namespace utl; @@ -65,7 +64,7 @@ using namespace com::sun::star::container; using namespace com::sun::star::configuration; #define C2U(cChar) OUString::createFromAscii(cChar) -#include <cppuhelper/implbase2.hxx> // helper for implementations +#include <cppuhelper/implbase1.hxx> // helper for implementations #ifdef DBG_UTIL inline void lcl_CFG_DBG_EXCEPTION(const sal_Char* cText, const Exception& rEx) @@ -85,10 +84,9 @@ catch(Exception& rEx) \ #endif namespace utl{ - class ConfigChangeListener_Impl : public cppu::WeakImplHelper2 + class ConfigChangeListener_Impl : public cppu::WeakImplHelper1 < - com::sun::star::util::XChangesListener, - com::sun::star::awt::XCallback + com::sun::star::util::XChangesListener > { public: @@ -102,9 +100,6 @@ namespace utl{ //XEventListener virtual void SAL_CALL disposing( const EventObject& Source ) throw(RuntimeException); - - //XAsyncCallback - virtual void SAL_CALL notify ( const Any& rData ) throw(RuntimeException); }; /* -----------------------------12.02.01 11:38-------------------------------- @@ -214,28 +209,23 @@ void ConfigChangeListener_Impl::changesOccurred( const ChangesEvent& rEvent ) th if(lcl_Find(sTemp, pCheckPropertyNames, aPropertyNames.getLength())) pNames[nNotify++] = sTemp; } - if(nNotify) + if( nNotify ) { - aChangedNames.realloc(nNotify); - Reference < com::sun::star::awt::XRequestCallback > aCallback( ::comphelper::getProcessServiceFactory()->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.awt.AsyncCallback") ), UNO_QUERY ); - aCallback->addCallback( this, makeAny( aChangedNames ) ); + if ( ::tools::SolarMutex::Acquire() ) + { + aChangedNames.realloc(nNotify); + pParent->CallNotify(aChangedNames); + ::tools::SolarMutex::Release(); + } } } -void ConfigChangeListener_Impl::notify ( const Any& rData ) throw(RuntimeException) -{ - Sequence<OUString> aChangedNames; - if ( (rData >>= aChangedNames) && pParent ) - pParent->CallNotify(aChangedNames); -} - /* -----------------------------29.08.00 16:34-------------------------------- ---------------------------------------------------------------------------*/ void ConfigChangeListener_Impl::disposing( const EventObject& /*rSource*/ ) throw(RuntimeException) { - if ( pParent ) - pParent->RemoveChangesListener(); + pParent->RemoveChangesListener(); } /* -----------------------------29.08.00 12:50-------------------------------- @@ -282,9 +272,6 @@ ConfigItem::~ConfigItem() { if(pImpl->pManager) { - ConfigChangeListener_Impl* pListener = dynamic_cast < ConfigChangeListener_Impl* >( xChangeLstnr.get() ); - if ( pListener ) - pListener->pParent = 0; RemoveChangesListener(); pImpl->pManager->RemoveConfigItem(*this); } |