sfx2/source/appl/workwin.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 1a7064571f68a38ae02fb1fb85447d41c47db997
Author:     Szymon Kłos <szymon.k...@collabora.com>
AuthorDate: Sat Nov 4 19:20:46 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Nov 6 09:58:31 2023 +0100

    lok: notebookbar: reduce calls to SfxNotebookBar::IsActive
    
    - in LOK case toolbars in core doesn't make any difference
    - SfxNotebookBar::IsActive which reads config
      makes doc_setView slower, avoid it in LOK case then
    - it was used for hiding contextual toolbars
    - introduced in commit 9bc1ffa2153d2474b023e0860d3c9c68ee18727b
      tdf#125040 Make single mode toolbar context aware
    
    Signed-off-by: Szymon Kłos <szymon.k...@collabora.com>
    Change-Id: I63de48faf2f7e7f30f8b509455061ac20a788f8a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158898
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index fb3955ee2c5c..793adcd8df77 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1195,7 +1195,8 @@ void SfxWorkWindow::UpdateObjectBars_Impl2()
 
     // Iterate over all Toolboxes
     xLayoutManager->lock();
-    const bool isNotebookBarActive = sfx2::SfxNotebookBar::IsActive(true);
+    const bool bForceDestroyToolbars =
+        comphelper::LibreOfficeKit::isActive() ? false : 
sfx2::SfxNotebookBar::IsActive(true);
     for ( auto const & n: aObjBarList )
     {
         ToolbarId eId = n.eId;
@@ -1209,7 +1210,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl2()
 
         // Is a ToolBox required in this context ?
         bool bModesMatching = (nUpdateMode != SfxVisibilityFlags::Invisible) 
&& ((nTbxMode & nUpdateMode) == nUpdateMode);
-        if ( bDestroy || isNotebookBarActive)
+        if ( bDestroy || bForceDestroyToolbars)
         {
             OUString aTbxId = g_aTbxTypeName + 
GetResourceURLFromToolbarId(eId);
             xLayoutManager->destroyElement( aTbxId );

Reply via email to