diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-12 09:37:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-12 13:27:12 +0000 |
commit | a705b8fe9d4f57fb51e2e4bf474dfde4bf58337e (patch) | |
tree | b1c83f5cf0422f5f83c967a309140414156ac91f /vcl/source/control | |
parent | 6f6056b62e2107b325624832d851b09711a11dd8 (diff) |
callcatcher: update unused code list
Change-Id: Iff29c1f0a795d920a071eadc64e6639ff7506fff
Diffstat (limited to 'vcl/source/control')
-rw-r--r-- | vcl/source/control/menubtn.cxx | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/vcl/source/control/menubtn.cxx b/vcl/source/control/menubtn.cxx index 12685b12c1b6..f8fb86fcaf6b 100644 --- a/vcl/source/control/menubtn.cxx +++ b/vcl/source/control/menubtn.cxx @@ -77,7 +77,6 @@ void MenuButton::ImplExecuteMenu() MenuButton::MenuButton( Window* pParent, WinBits nWinBits ) : PushButton( WINDOW_MENUBUTTON ) - , mbDisplaySelectedItem(false) { ImplInitMenuButtonData(); ImplInit( pParent, nWinBits ); @@ -87,7 +86,6 @@ MenuButton::MenuButton( Window* pParent, WinBits nWinBits ) MenuButton::MenuButton( Window* pParent, const ResId& rResId ) : PushButton( WINDOW_MENUBUTTON ) - , mbDisplaySelectedItem(false) { ImplInitMenuButtonData(); rResId.SetRT( RSC_MENUBUTTON ); @@ -120,8 +118,6 @@ void MenuButton::ImplLoadRes( const ResId& rResId ) MenuButton::~MenuButton() { delete mpMenuTimer; - if (mbDisplaySelectedItem && mpMenu) - mpMenu->RemoveEventListener(LINK(this, MenuButton, MenuEventListener)); delete mpOwnMenu; } @@ -203,33 +199,9 @@ void MenuButton::Activate() void MenuButton::Select() { - updateText(); maSelectHdl.Call( this ); } -void MenuButton::updateText() -{ - if (mbDisplaySelectedItem) - { - if (mpMenu) - SetText(mpMenu->GetItemText(mpMenu->GetCurItemId())); - else - SetText(OUString()); - } -} - -Size MenuButton::GetOptimalSize(WindowSizeType eType) const -{ - Size aRet = PushButton::GetOptimalSize(eType); - if (mbDisplaySelectedItem && mpMenu) - { - Size aMenuSize(mpMenu->ImplCalcSize(const_cast<MenuButton*>(this))); - if (aMenuSize.Width() > aRet.Width()) - aRet.Width() = aMenuSize.Width(); - } - return aRet; -} - // ----------------------------------------------------------------------- void MenuButton::SetMenuMode( sal_uInt16 nMode ) @@ -239,52 +211,13 @@ void MenuButton::SetMenuMode( sal_uInt16 nMode ) mnMenuMode = nMode; } -void MenuButton::SetShowDisplaySelectedItem(bool bShow) -{ - if (mbDisplaySelectedItem == bShow) - return; - if (mbDisplaySelectedItem && mpMenu) - mpMenu->RemoveEventListener(LINK(this, MenuButton, MenuEventListener)); - mbDisplaySelectedItem = bShow; - if (mbDisplaySelectedItem && mpMenu) - mpMenu->AddEventListener(LINK(this, MenuButton, MenuEventListener)); -} - void MenuButton::SetPopupMenu( PopupMenu* pNewMenu ) { if (pNewMenu == mpMenu) return; - if (mbDisplaySelectedItem && mpMenu) - mpMenu->RemoveEventListener(LINK(this, MenuButton, MenuEventListener)); // Fuer die 5.1-Auslieferung besser noch nicht inline, ansonsten kann // diese Funktion zur 6.0 inline werden mpMenu = pNewMenu; - updateText(); - if (mbDisplaySelectedItem && mpMenu) - mpMenu->AddEventListener(LINK(this, MenuButton, MenuEventListener)); -} - -IMPL_LINK(MenuButton, MenuEventListener, VclSimpleEvent*, pEvent) -{ - if (pEvent && pEvent->ISA(VclMenuEvent)) - { - VclMenuEvent* pMenuEvent = (VclMenuEvent*)pEvent; - if (pMenuEvent->GetMenu() == mpMenu) - { - switch (pMenuEvent->GetId()) - { - case VCLEVENT_MENU_INSERTITEM: - case VCLEVENT_MENU_REMOVEITEM: - case VCLEVENT_MENU_ITEMTEXTCHANGED: - queue_resize(); - break; - case VCLEVENT_MENU_SELECT: - updateText(); - break; - } - } - } - return 0; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |