summaryrefslogtreecommitdiff
path: root/linguistic/source/lngsvcmgr.hxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-07-11 09:50:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-07-11 09:59:10 +0100
commit464f69b8bb5f64f9f4660ba2e2095cdc1c65952b (patch)
tree91ba961a4827a03874629bd78ff700e8d3f02fef /linguistic/source/lngsvcmgr.hxx
parent7fe61368cead27eef5d6175abd1cc254e99e8a05 (diff)
Resolves: rhbz#836937 insanely slow with Zemberek installed
Zemberek is a java spellchecker extension. With it installed the collecting of spellchecker information on first activation of spellchecking is insanely slow as the cache of spellcheckers is thrown away on each iteration through each language known to LibreOffice. So... move the config updating stuff from editeng down to the linguistic layer. Let the linguistic layer keep its spellchecker cache and listen to the extension manager to know if an extension which might be a spellchecker one has been modified and only throw away the cache on that event or if (existing implementation) the config data for linguistics changes. The polling of changed linguistic data in SvxLinguConfigUpdate::IsNeedUpdateAll can be removed and leave it up to LngSvcMgr to load everything in its ctor and keep itself up to date with its config and extension listeners. Change-Id: I9c93d998928e2e7f5128c36771b3e450a8057cd6
Diffstat (limited to 'linguistic/source/lngsvcmgr.hxx')
-rw-r--r--linguistic/source/lngsvcmgr.hxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx
index 80cbd3d65abe..537750d7d262 100644
--- a/linguistic/source/lngsvcmgr.hxx
+++ b/linguistic/source/lngsvcmgr.hxx
@@ -30,7 +30,7 @@
#define _LINGUISTIC_LNGSVCMGR_HXX_
#include <uno/lbnames.h> // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type
-#include <cppuhelper/implbase4.hxx> // helper for implementations
+#include <cppuhelper/implbase5.hxx> // helper for implementations
#include <cppuhelper/interfacecontainer.h> //OMultiTypeInterfaceContainerHelper
@@ -39,8 +39,10 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/linguistic2/XLinguServiceManager.hpp>
#include <com/sun/star/linguistic2/XAvailableLocales.hpp>
+#include <com/sun/star/util/XModifyBroadcaster.hpp>
+#include <com/sun/star/util/XModifyListener.hpp>
#include <unotools/configitem.hxx>
-
+#include <vcl/timer.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include "linguistic/misc.hxx"
@@ -64,12 +66,13 @@ namespace com { namespace sun { namespace star { namespace linguistic2 {
class LngSvcMgr :
- public cppu::WeakImplHelper4
+ public cppu::WeakImplHelper5
<
com::sun::star::linguistic2::XLinguServiceManager,
com::sun::star::linguistic2::XAvailableLocales,
com::sun::star::lang::XComponent,
- com::sun::star::lang::XServiceInfo
+ com::sun::star::lang::XServiceInfo,
+ com::sun::star::util::XModifyListener
>,
private utl::ConfigItem
{
@@ -89,6 +92,12 @@ class LngSvcMgr :
com::sun::star::uno::Reference<
::com::sun::star::lang::XEventListener > xListenerHelper;
+ com::sun::star::uno::Reference<
+ ::com::sun::star::util::XModifyBroadcaster> xMB;
+
+ Timer aUpdateTimer;
+
+
com::sun::star::uno::Sequence<
com::sun::star::lang::Locale > aAvailSpellLocales;
com::sun::star::uno::Sequence<
@@ -139,6 +148,10 @@ class LngSvcMgr :
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames );
virtual void Commit();
+ void UpdateAll();
+ void stopListening();
+ DECL_LINK( updateAndBroadcast, void* );
+
public:
LngSvcMgr();
virtual ~LngSvcMgr();
@@ -166,6 +179,11 @@ public:
virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+ // XEventListener
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& rSource ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& rEvent ) throw(::com::sun::star::uno::RuntimeException);
static inline ::rtl::OUString getImplementationName_Static();
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static() throw();