diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2021-10-05 15:11:43 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2021-10-06 11:06:46 +0200 |
commit | e304383b88d271b0e140946af201099c8314dd0a (patch) | |
tree | 3937d2fc2963767609a5c7a1ef87d2bc8d3dda5d /sfx2 | |
parent | 564e12518632d937cf9e510679f33399851d8a9c (diff) |
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@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/workwin.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
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 ); |