[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - framework/source
Vasily Melenchuk
Vasily.Melenchuk at cib.de
Thu Mar 1 21:11:40 UTC 2018
framework/source/uielement/menubarmanager.cxx | 11 +++++++++++
1 file changed, 11 insertions(+)
New commits:
commit 3cbaff79837f890510f987950d7d3ccbb95dd974
Author: Vasily Melenchuk <Vasily.Melenchuk at cib.de>
Date: Wed Feb 28 13:39:56 2018 +0300
menu bar behavior consistency: remove checkbox from disabled menu item
If menu item which can have checkbox is disabled, checkbox is not drawn
near it. After matching to enabled criteria this checkbox can appear and
after disabling menu item again it still remain, so initial and final
state of menu are different.
Change-Id: I31be02da892212e12276aa56bae15e6fa453a5bf
Reviewed-on: https://gerrit.libreoffice.org/50506
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
(cherry picked from commit af1f91ae294e90c91ea5a5b78d6cc020b893e6c7)
Reviewed-on: https://gerrit.libreoffice.org/50604
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index e7ee04322574..4c83854f66a7 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -418,8 +418,19 @@ throw ( RuntimeException, std::exception )
// Enable/disable item
if ( bEnabledItem != bMenuItemEnabled )
+ {
m_pVCLMenu->EnableItem( pMenuItemHandler->nItemId, bEnabledItem );
+ // Remove "checked" mark for disabled menu items.
+ // Initially disabled but checkable menu items do not receive
+ // checked/unchecked state, so can appear inconsistently after
+ // enabling/disabling. Since we can not pass checked state for disabled
+ // items, we will just reset checked state for them, anyway correct state
+ // will be transferred from controller once item enabled.
+ if ( !bEnabledItem && m_pVCLMenu->IsItemChecked( pMenuItemHandler->nItemId ) )
+ m_pVCLMenu->CheckItem( pMenuItemHandler->nItemId, false );
+ }
+
if ( Event.State >>= bCheckmark )
{
// Checkmark or RadioButton
More information about the Libreoffice-commits
mailing list