sfx2/source/appl/workwin.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 7a3d26a5fc2537546b448eff5d797274225fcc99 Author: Luboš Luňák <[email protected]> AuthorDate: Tue Oct 5 15:11:43 2021 +0200 Commit: Luboš Luňák <[email protected]> CommitDate: Tue Oct 12 16:57:42 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 <[email protected]> (cherry picked from commit e304383b88d271b0e140946af201099c8314dd0a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123410 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Luboš Luňák <[email protected]> diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 217ae75436bf..a466a01ea041 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1198,6 +1198,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; @@ -1211,7 +1212,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 );
