diff options
Diffstat (limited to 'linguistic/source/lngsvcmgr.cxx')
-rw-r--r-- | linguistic/source/lngsvcmgr.cxx | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 2a70e9eeb1..64de21260c 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ #include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp> #include <tools/solar.h> -#include <svtools/lingucfg.hxx> +#include <unotools/lingucfg.hxx> #include <unotools/processfactory.hxx> #include <i18npool/lang.h> #include <i18npool/mslangid.hxx> @@ -134,7 +134,7 @@ static uno::Sequence< lang::Locale > GetAvailLocales( aLanguages.insert( nLang ); } } - else + else { DBG_ASSERT( 0, "interface not supported by service" ); } @@ -288,7 +288,7 @@ class LngSvcMgrListenerHelper : > { LngSvcMgr &rMyManager; - Timer aLaunchTimer; +// Timer aLaunchTimer; //cppu::OMultiTypeInterfaceContainerHelper aListeners; ::cppu::OInterfaceContainerHelper aLngSvcMgrListeners; @@ -304,7 +304,8 @@ class LngSvcMgrListenerHelper : void LaunchEvent( INT16 nLngSvcEvtFlags ); - DECL_LINK( TimeOut, Timer* ); +// DECL_LINK( TimeOut, Timer* ); + long Timeout(); public: LngSvcMgrListenerHelper( LngSvcMgr &rLngSvcMgr, @@ -363,8 +364,8 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( //! listeners, and each of them is launching an event of it's own!) //! Thus this behaviour is necessary to avoid unecessary actions of //! this objects listeners! - aLaunchTimer.SetTimeout( 2000 ); - aLaunchTimer.SetTimeoutHdl( LINK( this, LngSvcMgrListenerHelper, TimeOut ) ); +// aLaunchTimer.SetTimeout( 2000 ); +// aLaunchTimer.SetTimeoutHdl( LINK( this, LngSvcMgrListenerHelper, TimeOut ) ); nCombinedLngSvcEvt = 0; } @@ -385,11 +386,12 @@ void SAL_CALL LngSvcMgrListenerHelper::disposing( const lang::EventObject& rSour } -IMPL_LINK( LngSvcMgrListenerHelper, TimeOut, Timer*, pTimer ) +//IMPL_LINK( LngSvcMgrListenerHelper, TimeOut, Timer*, pTimer ) +long LngSvcMgrListenerHelper::Timeout() { osl::MutexGuard aGuard( GetLinguMutex() ); - if (&aLaunchTimer == pTimer) +// if (&aLaunchTimer == pTimer) { // change event source to LinguServiceManager since the listeners // probably do not know (and need not to know) about the specific @@ -416,7 +418,8 @@ IMPL_LINK( LngSvcMgrListenerHelper, TimeOut, Timer*, pTimer ) void LngSvcMgrListenerHelper::AddLngSvcEvt( INT16 nLngSvcEvt ) { nCombinedLngSvcEvt |= nLngSvcEvt; - aLaunchTimer.Start(); +// aLaunchTimer.Start(); + Timeout(); } @@ -753,7 +756,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) pThesDsp->SetServiceList( CreateLocale(nLang), aSvcImplNames ); } } - else + else { DBG_ASSERT( 0, "nofified for unexpected property" ); } @@ -801,9 +804,9 @@ void LngSvcMgr::GetGrammarCheckerDsp_Impl( sal_Bool bSetSvcList ) uno::Reference< linguistic2::XProofreadingIterator > xGCI; try { - uno::Reference< lang::XMultiServiceFactory > xMgr( + uno::Reference< lang::XMultiServiceFactory > xMgr( utl::getProcessServiceFactory(), uno::UNO_QUERY_THROW ); - xGCI = uno::Reference< linguistic2::XProofreadingIterator >( + xGCI = uno::Reference< linguistic2::XProofreadingIterator >( xMgr->createInstance( A2OU( SN_GRAMMARCHECKINGITERATOR ) ), uno::UNO_QUERY_THROW ); } catch (uno::Exception &) @@ -887,7 +890,7 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl() DBG_ASSERT( 0, "createInstance failed" ); } } - + if (xSvc.is()) { OUString aImplName; @@ -953,7 +956,7 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl() DBG_ASSERT( 0, "createInstance failed" ); } } - + if (xSvc.is()) { OUString aImplName; @@ -1671,7 +1674,7 @@ BOOL LngSvcMgr::SaveCfgSvcs( const String &rServiceName ) pNodeName = "ServiceManager/HyphenatorList"; else if (pDsp == pThesDsp) pNodeName = "ServiceManager/ThesaurusList"; - else + else { DBG_ASSERT( 0, "node name missing" ); } @@ -1765,7 +1768,7 @@ static uno::Sequence< OUString > GetLangSvc( const uno::Any &rVal ) aRes.realloc(1); aRes.getArray()[0] = aImplName; } - else + else { DBG_ASSERT( 0, "GetLangSvc: unexpected type encountered" ); } |