sfx2/source/appl/workwin.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit e304383b88d271b0e140946af201099c8314dd0a Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Tue Oct 5 15:11:43 2021 +0200 Commit: Szymon Kłos <szymon.k...@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.k...@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 );