[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.0' - sw/inc sw/source
Tor Lillqvist
tml at collabora.com
Thu Jun 28 08:23:08 UTC 2018
sw/inc/swmodule.hxx | 10 ----------
sw/source/core/text/guess.cxx | 6 ------
sw/source/core/txtnode/txtedt.cxx | 6 ------
sw/source/uibase/app/swmodule.cxx | 8 ++------
4 files changed, 2 insertions(+), 28 deletions(-)
New commits:
commit 9f55673859400ba30b51e168142c3acb4dcea6f4
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Jun 19 12:31:41 2018 +0300
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/56465
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/sw/inc/swmodule.hxx b/sw/inc/swmodule.hxx
index 3e468498a974..422782944a91 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 bcbdf0650a33..8951720a7e3d 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -380,12 +380,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 8ab99e5e8edf..79632fbe9f44 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1323,12 +1323,6 @@ SwRect SwTextFrame::AutoSpell_( const SwContentNode* pActNode, 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 0fb7e491bcb4..99347905394c 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)
More information about the Libreoffice-commits
mailing list