summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-06-19 12:31:41 +0300
committerTor Lillqvist <tml@collabora.com>2018-06-27 08:38:07 +0200
commitf1d9aca4bf596c0a3be44483b1d60867f12683ec (patch)
treeeb2423bac53f22097902e682d2b2a3f5f85f4d2c
parentdb28098265cb1f137813c2f6c42663382c213aa5 (diff)
Initialise the spelling and grammar thing when Writer starts
We want to avoid the phenomenon where right after typing the first character into a Writer documnent in a LibreOffice instance, spell and grammar checking stuff is initialised which can take a quite long time, especially the LightProof one. Even after my recent change that made the Lightproof initialisation clearly faster (by avoiding the import of the large lightproof_impl_pt_BR.py module before actually doing Brazilian Portuguese proofreading), there still was a 0.3 second delay on my relatively fast machine. This change moves that delay into Writer start instead, before any document window is ready to accept input. At least then the user is not entering text and wondering why it doesn't show up right away. Change-Id: Ie578c310dc9cb9bfc964e2986eec177fb1d4e666 Reviewed-on: https://gerrit.libreoffice.org/56473 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
-rw-r--r--sw/inc/swmodule.hxx10
-rw-r--r--sw/source/core/text/guess.cxx6
-rw-r--r--sw/source/core/txtnode/txtedt.cxx6
-rw-r--r--sw/source/uibase/app/swmodule.cxx8
4 files changed, 2 insertions, 28 deletions
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 4cca346229eb..cdb88dbf3569 100644
--- a/sw/inc/swmodule.hxx
+++ b/sw/inc/swmodule.hxx
@@ -237,10 +237,6 @@ public:
static void CheckSpellChanges( bool bOnlineSpelling,
bool bIsSpellWrongAgain, bool bIsSpellAllAgain, bool bSmartTags );
- inline const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >&
- GetLngSvcEvtListener();
- void CreateLngSvcEvtListener();
-
css::uno::Reference< css::scanner::XScannerManager2 > const &
GetScannerManager();
@@ -251,12 +247,6 @@ public:
void CallAutomationApplicationEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments);
};
-inline const css::uno::Reference< css::linguistic2::XLinguServiceEventListener >&
- SwModule::GetLngSvcEvtListener()
-{
- return m_xLinguServiceEventListener;
-}
-
// Access to SwModule, the View and the shell.
#define SW_MOD() ( static_cast<SwModule*>(SfxApplication::GetModule(SfxToolsModule::Writer)))
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 6b37ce710dc4..96f82ae8dd5e 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -391,12 +391,6 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
aForbidden.beginLine, aForbidden.endLine,
rInf.HasForbiddenChars(), bAllowHanging, false );
- //! register listener to LinguServiceEvents now in order to get
- //! notified about relevant changes in the future
- SwModule *pModule = SW_MOD();
- if (!pModule->GetLngSvcEvtListener().is())
- pModule->CreateLngSvcEvtListener();
-
// !!! We must have a local copy of the locale, because inside
// getLineBreak the LinguEventListener can trigger a new formatting,
// which can corrupt the locale pointer inside pBreakIt.
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 91edaa6616e6..f2cc8fcd8d2a 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1338,12 +1338,6 @@ SwRect SwTextFrame::AutoSpell_(SwTextNode & rNode, sal_Int32 nActPos)
if( bFresh )
{
- //! register listener to LinguServiceEvents now in order to get
- //! notified about relevant changes in the future
- SwModule *pModule = SW_MOD();
- if (!pModule->GetLngSvcEvtListener().is())
- pModule->CreateLngSvcEvtListener();
-
uno::Reference< XSpellChecker1 > xSpell( ::GetSpellChecker() );
SwDoc* pDoc = pNode->GetDoc();
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 99775d994d6a..3d2744ddd2c6 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -193,6 +193,8 @@ SwModule::SwModule( SfxObjectFactory* pWebFact,
// at the view options.
GetColorConfig();
}
+
+ m_xLinguServiceEventListener = new SwLinguServiceEventListener;
}
OUString SwResId(const char* pId)
@@ -227,12 +229,6 @@ SwModule::~SwModule()
EndListening( *SfxGetpApp() );
}
-void SwModule::CreateLngSvcEvtListener()
-{
- if (!m_xLinguServiceEventListener.is())
- m_xLinguServiceEventListener = new SwLinguServiceEventListener;
-}
-
void SwDLL::RegisterFactories()
{
// These Id's must not be changed. Through these Id's the View (resume Documentview)