diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-01 13:10:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-01 18:06:21 +0200 |
commit | 38bef03742c94376a974f84693ff2e48693e6839 (patch) | |
tree | adeaffac0b7707f4d08463bef12cb024b2a62102 /vcl/source/control | |
parent | 75a48e37b260c145297261d0e0ab5720894404f1 (diff) |
pass menuitem ident around directly, instead of deriving from itemid
sidestepping the while duplicate itemids in separate submenus problem
Change-Id: Icb57ac805f3c8c4fc3a68341e318375c6492cbb1
Reviewed-on: https://gerrit.libreoffice.org/61189
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/menubtn.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 8ffa935e9141..6aa89d937b8b 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -50,7 +50,9 @@ void MenuButton::ExecuteMenu() { Point aPos(0, 1); tools::Rectangle aRect(aPos, aSize ); - mnCurItemId = mpMenu->Execute(this, aRect, PopupMenuFlags::ExecuteDown); + mpMenu->Execute(this, aRect, PopupMenuFlags::ExecuteDown); + mnCurItemId = mpMenu->GetCurItemId(); + msCurItemIdent = mpMenu->GetCurItemIdent(); } else { @@ -70,6 +72,7 @@ void MenuButton::ExecuteMenu() { Select(); mnCurItemId = 0; + msCurItemIdent.clear(); } } @@ -107,12 +110,6 @@ bool MenuButton::MenuShown() const } } -OString MenuButton::GetCurItemIdent() const -{ - return (mnCurItemId && mpMenu) ? - mpMenu->GetItemIdent(mnCurItemId) : OString(); -} - MenuButton::MenuButton( vcl::Window* pParent, WinBits nWinBits ) : PushButton(WindowType::MENUBUTTON) , mnCurItemId(0) |