[Libreoffice-commits] core.git: sfx2/source
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Wed Oct 6 09:07:21 UTC 2021
sfx2/source/appl/workwin.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit e304383b88d271b0e140946af201099c8314dd0a
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Oct 5 15:11:43 2021 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Oct 6 11:06:46 2021 +0200
avoid repeated calls to SfxNotebookBar::IsActive()
The call reads configuration, and so is a bit expensive when
called in a loop.
Change-Id: I62398bcfdc856f02f6e2d928bac2f144bc47424d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123103
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index ce2459d15748..fadeeca7339a 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1189,6 +1189,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl2()
// Iterate over all Toolboxes
xLayoutManager->lock();
+ const bool isNotebookBarActive = sfx2::SfxNotebookBar::IsActive();
for ( auto const & n: aObjBarList )
{
ToolbarId eId = n.eId;
@@ -1202,7 +1203,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl2()
// Is a ToolBox required in this context ?
bool bModesMatching = (nUpdateMode != SfxVisibilityFlags::Invisible) && ((nTbxMode & nUpdateMode) == nUpdateMode);
- if ( bDestroy || sfx2::SfxNotebookBar::IsActive())
+ if ( bDestroy || isNotebookBarActive)
{
OUString aTbxId = g_aTbxTypeName + GetResourceURLFromToolbarId(eId);
xLayoutManager->destroyElement( aTbxId );
More information about the Libreoffice-commits
mailing list