diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-06 07:08:30 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-04-19 08:37:31 +0200 |
commit | 9f06c54ca1819b6d4df48f33772cfa5ceb90dccd (patch) | |
tree | c568d358f3304a0d1c9830feb1d9aec11f20970c /sfx2 | |
parent | 075ae953e3e673dedcb74d693e516a07b0bebca2 (diff) |
notebookbar: minify for online
Notebookbar load takes some time. We don't use most of
the items in online so minify .ui file to contain
only needed widgets.
Change-Id: I4796caae14bb63e3e04d318093209adfb87a77df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113623
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114154
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/notebookbar/SfxNotebookBar.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index b5606721a2ff..fb90113f9f05 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -266,6 +266,9 @@ bool SfxNotebookBar::IsActive() OUString aActive = comphelper::getString( aAppNode.getNodeValue( "Active" ) ); + if (comphelper::LibreOfficeKit::isActive() && aActive == "notebookbar_online.ui") + return true; + const utl::OConfigurationNode aModesNode = aAppNode.openNode("Modes"); const Sequence<OUString> aModeNodeNames( aModesNode.getNodeNames() ); @@ -331,6 +334,8 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, OUString aModuleName = xModuleManager->identify( xFrame ); vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum( aModuleName ); OUString sFile = lcl_getNotebookbarFileName( eApp ); + if (comphelper::LibreOfficeKit::isActive()) + sFile = "notebookbar_online.ui"; OUString sNewFile = rUIFile + sFile; OUString sCurrentFile; VclPtr<NotebookBar> pNotebookBar = pSysWindow->GetNotebookBar(); @@ -409,8 +414,10 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, } else if (auto pNotebookBar = pSysWindow->GetNotebookBar()) { - pNotebookBar->Hide(); - pNotebookBar->GetParent()->Resize(); + vcl::Window* pParent = pNotebookBar->GetParent(); + RemoveListeners(pSysWindow); + pSysWindow->CloseNotebookBar(); + pParent->Resize(); SfxNotebookBar::ShowMenubar(true); } |