diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-07 15:25:20 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-05-11 12:17:42 +0000 |
commit | 82d68f9cbce4073a727c43b4a8e81d39871b71eb (patch) | |
tree | 64b3a9e1092586afee46899adfd00070821613b8 /reportdesign/source/ui/report/ReportSection.cxx | |
parent | 19ea033f380aa196c9c868a3cdb43e967eb42abe (diff) |
convert COMMAND_ constants to scoped enum
Change-Id: I88e67f89dbbab0646e8f106dfeb32c6ee1bb0b95
Reviewed-on: https://gerrit.libreoffice.org/15671
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'reportdesign/source/ui/report/ReportSection.cxx')
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index d8e97db06131..ae97c8ef5fa2 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -475,33 +475,29 @@ void lcl_insertMenuItemImages( void OReportSection::Command( const CommandEvent& _rCEvt ) { Window::Command(_rCEvt); - switch (_rCEvt.GetCommand()) + if (_rCEvt.GetCommand() == CommandEventId::ContextMenu) { - case COMMAND_CONTEXTMENU: - { - OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController(); - uno::Reference<frame::XFrame> xFrame = rController.getFrame(); - PopupMenu aContextMenu( ModuleRes( RID_MENU_REPORT ) ); - uno::Reference< report::XReportDefinition> xReportDefinition = getSection()->getReportDefinition(); + OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController(); + uno::Reference<frame::XFrame> xFrame = rController.getFrame(); + PopupMenu aContextMenu( ModuleRes( RID_MENU_REPORT ) ); + uno::Reference< report::XReportDefinition> xReportDefinition = getSection()->getReportDefinition(); - lcl_insertMenuItemImages(aContextMenu,rController,xReportDefinition,xFrame); + lcl_insertMenuItemImages(aContextMenu,rController,xReportDefinition,xFrame); - Point aPos = _rCEvt.GetMousePosPixel(); - m_pView->EndAction(); - const sal_uInt16 nId = aContextMenu.Execute(this, aPos); - if ( nId ) + Point aPos = _rCEvt.GetMousePosPixel(); + m_pView->EndAction(); + const sal_uInt16 nId = aContextMenu.Execute(this, aPos); + if ( nId ) + { + uno::Sequence< beans::PropertyValue> aArgs; + if ( nId == SID_ATTR_CHAR_COLOR_BACKGROUND ) { - uno::Sequence< beans::PropertyValue> aArgs; - if ( nId == SID_ATTR_CHAR_COLOR_BACKGROUND ) - { - aArgs.realloc(1); - aArgs[0].Name = "Selection"; - aArgs[0].Value <<= m_xSection; - } - rController.executeChecked(nId,aArgs); + aArgs.realloc(1); + aArgs[0].Name = "Selection"; + aArgs[0].Value <<= m_xSection; } + rController.executeChecked(nId,aArgs); } - break; } } |