From 82d68f9cbce4073a727c43b4a8e81d39871b71eb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 7 May 2015 15:25:20 +0200 Subject: convert COMMAND_ constants to scoped enum Change-Id: I88e67f89dbbab0646e8f106dfeb32c6ee1bb0b95 Reviewed-on: https://gerrit.libreoffice.org/15671 Tested-by: Jenkins Reviewed-by: Noel Grandin --- reportdesign/source/ui/dlg/GroupsSorting.cxx | 2 +- reportdesign/source/ui/dlg/Navigator.cxx | 8 ++++-- reportdesign/source/ui/report/ReportSection.cxx | 38 +++++++++++-------------- reportdesign/source/ui/report/ScrollHelper.cxx | 6 ++-- 4 files changed, 26 insertions(+), 28 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index 839fa91abfde..ff786a5fce33 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -723,7 +723,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) { switch (rEvt.GetCommand()) { - case COMMAND_CONTEXTMENU: + case CommandEventId::ContextMenu: { if (!rEvt.IsMouseEvent()) { diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 13c4e5a9066c..f65a642278e0 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -275,9 +275,9 @@ void NavigatorTree::dispose() void NavigatorTree::Command( const CommandEvent& rEvt ) { bool bHandled = false; - switch( rEvt.GetCommand() ) + switch( rEvt.GetCommand()) { - case COMMAND_CONTEXTMENU: + case CommandEventId::ContextMenu: { // die Stelle, an der geklickt wurde SvTreeListEntry* ptClickedOn = NULL; @@ -349,7 +349,9 @@ void NavigatorTree::Command( const CommandEvent& rEvt ) } bHandled = true; - } break; + } + break; + default: break; } if (!bHandled) 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 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 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; } } diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index ba789bc9f774..938fd45942db 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -330,9 +330,9 @@ bool OScrollWindowHelper::Notify( NotifyEvent& rNEvt ) { const CommandEvent* pCommandEvent = rNEvt.GetCommandEvent(); if ( pCommandEvent && - ( ((pCommandEvent->GetCommand() == COMMAND_WHEEL) || - (pCommandEvent->GetCommand() == COMMAND_STARTAUTOSCROLL) || - (pCommandEvent->GetCommand() == COMMAND_AUTOSCROLL))) ) + ( ((pCommandEvent->GetCommand() == CommandEventId::Wheel) || + (pCommandEvent->GetCommand() == CommandEventId::StartAutoScroll) || + (pCommandEvent->GetCommand() == CommandEventId::AutoScroll))) ) { ScrollBar* pHScrBar = NULL; ScrollBar* pVScrBar = NULL; -- cgit v1.2.3