chart2/source/controller/main/ControllerCommandDispatch.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
New commits: commit eff1817dafb0e0debda32da46ac8e803cbb9b9ee Author: Mike Kaganski <[email protected]> AuthorDate: Sun Jul 6 17:27:11 2025 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Sun Jul 6 15:51:10 2025 +0200 Simplify ControllerCommandDispatch::fireStatusEvent Check m_aCommandAvailability.contains to decide if we need to call fireStatusEventForURLImpl for the given command. This also avoids an extra event for .uno:StatusBarVisible (explicitly handled below). Change-Id: If5a74e0631759bd2ace0aebc60670b70bf43aa08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187444 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx index e6abe080a655..bf96f8ecb356 100644 --- a/chart2/source/controller/main/ControllerCommandDispatch.cxx +++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx @@ -937,8 +937,7 @@ void ControllerCommandDispatch::fireStatusEvent( const OUString & rURL, const Reference< frame::XStatusListener > & xSingleListener /* = 0 */ ) { - bool bIsChartSelectorURL = rURL == ".uno:ChartElementSelector"; - if( rURL.isEmpty() || bIsChartSelectorURL ) + if (rURL.isEmpty() || rURL == ".uno:ChartElementSelector") { uno::Any aArg; aArg <<= Reference< frame::XController >(m_xChartController); @@ -950,7 +949,7 @@ void ControllerCommandDispatch::fireStatusEvent( for (auto const& elem : m_aCommandAvailability) fireStatusEventForURLImpl( elem.first, xSingleListener ); } - else if( !bIsChartSelectorURL ) + else if (m_aCommandAvailability.contains(rURL)) fireStatusEventForURLImpl( rURL, xSingleListener ); // statusbar. Should be handled by base implementation
