sc/source/ui/app/inputwin.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit bff5d1a68a8b6f5776c5edb4ef0f919af1194d03
Author:     Luboš Luňák <[email protected]>
AuthorDate: Tue Dec 7 14:42:47 2021 +0100
Commit:     Luboš Luňák <[email protected]>
CommitDate: Wed Feb 2 12:39:37 2022 +0100

    disable ScPosWnd completely in LOK mode
    
    366e328dc7f36061971c549c2d33d365026b65ca already mostly disabled it,
    but the instance was still created, and it sets up listening that
    results in ScPosWnd::FillRangeNames() getting called on every
    SfxLokHelper::setView(), which forms the major cost of the view
    switching.
    
    Change-Id: Ic16da4bdfb678d53a79da57e9bbdcb7fc59c576d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126481
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <[email protected]>

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2de934265b77..c2810113f9c8 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -161,7 +161,7 @@ static VclPtr<ScInputBarGroup> lcl_chooseRuntimeImpl( 
vcl::Window* pParent, cons
 ScInputWindow::ScInputWindow( vcl::Window* pParent, const SfxBindings* pBind ) 
:
         // With WB_CLIPCHILDREN otherwise we get flickering
         ToolBox         ( pParent, WinBits(WB_CLIPCHILDREN | WB_BORDER | 
WB_NOSHADOW) ),
-        aWndPos         ( VclPtr<ScPosWnd>::Create(this) ),
+        aWndPos         ( !comphelper::LibreOfficeKit::isActive() ? 
VclPtr<ScPosWnd>::Create(this) : nullptr ),
         mxTextWindow    ( lcl_chooseRuntimeImpl( this, pBind ) ),
         pInputHdl       ( nullptr ),
         mpViewShell     ( nullptr ),
@@ -589,7 +589,8 @@ void ScInputWindow::SetFuncString( const OUString& rString, 
bool bDoEdit )
 
 void ScInputWindow::SetPosString( const OUString& rStr )
 {
-    aWndPos->SetPos( rStr );
+    if (!comphelper::LibreOfficeKit::isActive())
+        aWndPos->SetPos( rStr );
 }
 
 void ScInputWindow::SetTextString( const OUString& rString )
@@ -648,7 +649,8 @@ void ScInputWindow::SetSumAssignMode()
 
 void ScInputWindow::SetFormulaMode( bool bSet )
 {
-    aWndPos->SetFormulaMode(bSet);
+    if (!comphelper::LibreOfficeKit::isActive())
+        aWndPos->SetFormulaMode(bSet);
     mxTextWindow->SetFormulaMode(bSet);
 }
 
@@ -713,7 +715,8 @@ void ScInputWindow::SwitchToTextWin()
 
 void ScInputWindow::PosGrabFocus()
 {
-    aWndPos->GrabFocus();
+    if (!comphelper::LibreOfficeKit::isActive())
+        aWndPos->GrabFocus();
 }
 
 void ScInputWindow::EnableButtons( bool bEnable )

Reply via email to