[Libreoffice-commits] core.git: framework/source

Vasily Melenchuk Vasily.Melenchuk at cib.de
Thu Mar 1 14:05:58 UTC 2018


 framework/source/uielement/menubarmanager.cxx |   11 +++++++++++
 1 file changed, 11 insertions(+)

New commits:
commit af1f91ae294e90c91ea5a5b78d6cc020b893e6c7
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>

diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index 018518931cd4..0122c299b97d 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -336,8 +336,19 @@ void SAL_CALL MenuBarManager::statusChanged( const FeatureStateEvent& Event )
 
                 // 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