diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-04-10 10:20:34 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-04-10 10:38:29 +0100 |
commit | 37530ebbfe92893b1fd7e0b55d25b13695f06776 (patch) | |
tree | 0e6dfd76a3f852f80cecde11626a47fa2cedf42b /sc/source | |
parent | 73295fa4e0df4637f1ddcca30311481efc1009e3 (diff) |
convert scenario menu to .ui
Change-Id: Iac0f52898ce9e8484731d62b2555ed3c83563d1d
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/navipi/navipi.src | 19 | ||||
-rw-r--r-- | sc/source/ui/navipi/scenwnd.cxx | 22 |
2 files changed, 8 insertions, 33 deletions
diff --git a/sc/source/ui/navipi/navipi.src b/sc/source/ui/navipi/navipi.src index a51d48f10fed..4da7b17d911b 100644 --- a/sc/source/ui/navipi/navipi.src +++ b/sc/source/ui/navipi/navipi.src @@ -176,23 +176,4 @@ String SCSTR_QHLP_SCEN_COMMENT Text [ en-US ] = "Comment"; }; -Menu RID_POPUP_NAVIPI_SCENARIO -{ - ItemList = - { - MenuItem - { - Identifier = RID_NAVIPI_SCENARIO_DELETE ; - HelpId = HID_SC_SCENARIO_DELETE ; - Text [ en-US ] = "Delete" ; - }; - MenuItem - { - Identifier = RID_NAVIPI_SCENARIO_EDIT ; - HelpId = HID_SC_SCENARIO_EDIT ; - Text [ en-US ] = "Properties..." ; - }; - }; -}; - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx index 71c40d913146..b9ae59960e7f 100644 --- a/sc/source/ui/navipi/scenwnd.cxx +++ b/sc/source/ui/navipi/scenwnd.cxx @@ -135,20 +135,14 @@ bool ScScenarioListBox::EventNotify( NotifyEvent& rNEvt ) { if( !pEntry->mbProtected ) { - ScopedVclPtrInstance<ScPopupMenu> aPopup( ScResId( RID_POPUP_NAVIPI_SCENARIO ) ); - aPopup->Execute( this, pCEvt->GetMousePosPixel() ); - if (aPopup->WasHit()) - { - switch( aPopup->GetSelected() ) - { - case RID_NAVIPI_SCENARIO_DELETE: - DeleteScenario(); - break; - case RID_NAVIPI_SCENARIO_EDIT: - EditScenario(); - break; - } - } + VclBuilder aBuilder(nullptr, VclBuilderContainer::getUIRootDir(), "modules/scalc/ui/scenariomenu.ui", ""); + VclPtr<PopupMenu> aPopup(aBuilder.get_menu("menu")); + sal_uInt16 nId = aPopup->Execute(this, pCEvt->GetMousePosPixel()); + OString sIdent(aPopup->GetItemIdent(nId)); + if (sIdent == "delete") + DeleteScenario(); + else if (sIdent == "edit") + EditScenario(); } } bHandled = true; |