basctl/source/basicide/baside2b.cxx                           |   10 -
 basctl/source/basicide/baside3.cxx                            |    8 -
 basctl/source/basicide/bastypes.cxx                           |    2 
 chart2/source/controller/main/ChartController_Window.cxx      |   10 -
 cui/source/options/optcolor.cxx                               |    9 -
 dbaccess/source/ui/misc/WTypeSelect.cxx                       |    2 
 dbaccess/source/ui/querydesign/JoinTableView.cxx              |    6 
 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx         |    2 
 dbaccess/source/ui/querydesign/TableWindow.cxx                |    2 
 dbaccess/source/ui/querydesign/TableWindowListBox.cxx         |    2 
 dbaccess/source/ui/querydesign/TableWindowTitle.cxx           |   15 -
 dbaccess/source/ui/tabledesign/TEditControl.cxx               |    2 
 dbaccess/source/ui/tabledesign/TableDesignControl.cxx         |    2 
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx           |    2 
 editeng/source/editeng/impedit2.cxx                           |   20 +-
 extensions/source/propctrlr/browserlistbox.cxx                |    6 
 forms/source/richtext/richtextimplcontrol.cxx                 |    6 
 framework/source/dispatch/windowcommanddispatch.cxx           |    2 
 framework/source/uielement/statusbarmanager.cxx               |    2 
 framework/source/uielement/toolbarmanager.cxx                 |    2 
 include/vcl/cmdevt.hxx                                        |   76 +++++-----
 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 
 sc/source/ui/app/inputhdl.cxx                                 |    8 -
 sc/source/ui/app/inputwin.cxx                                 |   20 +-
 sc/source/ui/dbgui/csvgrid.cxx                                |    4 
 sc/source/ui/drawfunc/fupoor.cxx                              |    2 
 sc/source/ui/miscdlgs/acredlin.cxx                            |    2 
 sc/source/ui/navipi/content.cxx                               |    5 
 sc/source/ui/navipi/scenwnd.cxx                               |    2 
 sc/source/ui/view/gridwin.cxx                                 |   28 +--
 sc/source/ui/view/hdrcont.cxx                                 |    6 
 sc/source/ui/view/preview.cxx                                 |    6 
 sc/source/ui/view/tabcont.cxx                                 |   32 +---
 sd/source/ui/animations/CustomAnimationList.cxx               |    2 
 sd/source/ui/annotations/annotationtag.cxx                    |    2 
 sd/source/ui/annotations/annotationwindow.cxx                 |    4 
 sd/source/ui/app/sdmod1.cxx                                   |    2 
 sd/source/ui/app/tmplctrl.cxx                                 |    2 
 sd/source/ui/dlg/LayerTabBar.cxx                              |    2 
 sd/source/ui/dlg/RemoteDialogClientBox.cxx                    |    2 
 sd/source/ui/sidebar/LayoutMenu.cxx                           |    2 
 sd/source/ui/sidebar/MasterPagesSelector.cxx                  |    5 
 sd/source/ui/slideshow/slideshowimpl.cxx                      |    2 
 sd/source/ui/slidesorter/controller/SlideSorterController.cxx |    6 
 sd/source/ui/view/drviews4.cxx                                |    6 
 sd/source/ui/view/outlnvsh.cxx                                |    2 
 sd/source/ui/view/sdruler.cxx                                 |    2 
 sd/source/ui/view/tabcontr.cxx                                |    4 
 sd/source/ui/view/viewshel.cxx                                |   12 -
 sfx2/source/appl/newhelp.cxx                                  |    4 
 sfx2/source/control/thumbnailview.cxx                         |    6 
 sfx2/source/sidebar/Deck.cxx                                  |    2 
 sfx2/source/statbar/stbitem.cxx                               |    2 
 starmath/source/edit.cxx                                      |    4 
 starmath/source/view.cxx                                      |    6 
 svtools/source/brwbox/brwbox2.cxx                             |    2 
 svtools/source/brwbox/brwhead.cxx                             |    4 
 svtools/source/brwbox/datwin.cxx                              |   10 -
 svtools/source/contnr/imivctl1.cxx                            |   14 +
 svtools/source/contnr/svimpbox.cxx                            |    8 -
 svtools/source/control/calendar.cxx                           |    4 
 svtools/source/control/fmtfield.cxx                           |    2 
 svtools/source/control/headbar.cxx                            |    2 
 svtools/source/control/scrwin.cxx                             |    6 
 svtools/source/control/tabbar.cxx                             |    7 
 svtools/source/control/toolbarmenu.cxx                        |    2 
 svtools/source/control/valueset.cxx                           |    8 -
 svtools/source/table/tabledatawindow.cxx                      |    2 
 svx/source/dialog/imapwnd.cxx                                 |    2 
 svx/source/dialog/svxruler.cxx                                |    2 
 svx/source/fmcomp/fmgridcl.cxx                                |    4 
 svx/source/fmcomp/gridctrl.cxx                                |    2 
 svx/source/form/filtnav.cxx                                   |    6 
 svx/source/form/navigatortree.cxx                             |    6 
 svx/source/gallery2/galbrws1.cxx                              |    2 
 svx/source/gallery2/galctrl.cxx                               |    8 -
 svx/source/stbctrls/pszctrl.cxx                               |    2 
 svx/source/stbctrls/xmlsecctrl.cxx                            |    2 
 svx/source/stbctrls/zoomctrl.cxx                              |    2 
 svx/source/svdraw/svdedxv.cxx                                 |    4 
 sw/source/ui/dbui/createaddresslistdialog.cxx                 |    9 -
 sw/source/ui/dbui/mmaddressblockpage.cxx                      |    9 -
 sw/source/uibase/docvw/SidebarTxtControl.cxx                  |    4 
 sw/source/uibase/docvw/edtdd.cxx                              |    2 
 sw/source/uibase/docvw/edtwin.cxx                             |   41 ++---
 sw/source/uibase/docvw/srcedtw.cxx                            |   14 -
 sw/source/uibase/misc/redlndlg.cxx                            |    3 
 sw/source/uibase/uiview/pview.cxx                             |    8 -
 sw/source/uibase/uiview/viewport.cxx                          |    2 
 sw/source/uibase/utlui/bookctrl.cxx                           |    2 
 sw/source/uibase/utlui/tmplctrl.cxx                           |    2 
 sw/source/uibase/utlui/unotools.cxx                           |    8 -
 toolkit/source/awt/vclxwindow.cxx                             |    4 
 vcl/osx/salinst.cxx                                           |    2 
 vcl/source/control/combobox.cxx                               |    2 
 vcl/source/control/edit.cxx                                   |   14 -
 vcl/source/control/ilstbox.cxx                                |    4 
 vcl/source/control/lstbox.cxx                                 |    2 
 vcl/source/control/spinfld.cxx                                |    2 
 vcl/source/control/tabctrl.cxx                                |    2 
 vcl/source/edit/textview.cxx                                  |   12 -
 vcl/source/edit/vclmedit.cxx                                  |    8 -
 vcl/source/window/event.cxx                                   |    2 
 vcl/source/window/layout.cxx                                  |    2 
 vcl/source/window/menufloatingwindow.cxx                      |    2 
 vcl/source/window/openglwin.cxx                               |    2 
 vcl/source/window/printdlg.cxx                                |    4 
 vcl/source/window/scrwnd.cxx                                  |    2 
 vcl/source/window/seleng.cxx                                  |    2 
 vcl/source/window/toolbox.cxx                                 |    4 
 vcl/source/window/window2.cxx                                 |    8 -
 vcl/source/window/winproc.cxx                                 |   40 ++---
 vcl/win/source/window/salframe.cxx                            |    2 
 116 files changed, 391 insertions(+), 386 deletions(-)

New commits:
commit 82d68f9cbce4073a727c43b4a8e81d39871b71eb
Author: Noel Grandin <n...@peralex.com>
Date:   Thu May 7 15:25:20 2015 +0200

    convert COMMAND_ constants to scoped enum
    
    Change-Id: I88e67f89dbbab0646e8f106dfeb32c6ee1bb0b95
    Reviewed-on: https://gerrit.libreoffice.org/15671
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noelgran...@gmail.com>

diff --git a/basctl/source/basicide/baside2b.cxx 
b/basctl/source/basicide/baside2b.cxx
index e4ae127..8d84a28 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -459,12 +459,12 @@ void EditorWindow::Command( const CommandEvent& rCEvt )
     if ( pEditView )
     {
         pEditView->Command( rCEvt );
-        if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) ||
-             ( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) ||
-             ( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
+        if ( ( rCEvt.GetCommand() == CommandEventId::Wheel ) ||
+             ( rCEvt.GetCommand() == CommandEventId::StartAutoScroll ) ||
+             ( rCEvt.GetCommand() == CommandEventId::AutoScroll ) )
         {
             HandleScrollCommand( rCEvt, rModulWindow.GetHScrollBar(), 
&rModulWindow.GetEditVScrollBar() );
-        } else if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) {
+        } else if ( rCEvt.GetCommand() == CommandEventId::ContextMenu ) {
             SfxDispatcher* pDispatcher = GetDispatcher();
             if ( pDispatcher )
             {
@@ -1497,7 +1497,7 @@ void BreakPointWindow::MouseButtonDown( const MouseEvent& 
rMEvt )
 
 void BreakPointWindow::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         Point aPos( rCEvt.IsMouseEvent() ? rCEvt.GetMousePosPixel() : 
Point(1,1) );
         Point aEventPos( PixelToLogic( aPos ) );
diff --git a/basctl/source/basicide/baside3.cxx 
b/basctl/source/basicide/baside3.cxx
index 1575aa6..8dc391e4 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -195,13 +195,13 @@ void DialogWindow::KeyInput( const KeyEvent& rKEvt )
 
 void DialogWindow::Command( const CommandEvent& rCEvt )
 {
-    if ( ( rCEvt.GetCommand() == COMMAND_WHEEL           ) ||
-         ( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) ||
-         ( rCEvt.GetCommand() == COMMAND_AUTOSCROLL      ) )
+    if ( ( rCEvt.GetCommand() == CommandEventId::Wheel           ) ||
+         ( rCEvt.GetCommand() == CommandEventId::StartAutoScroll ) ||
+         ( rCEvt.GetCommand() == CommandEventId::AutoScroll      ) )
     {
         HandleScrollCommand( rCEvt, GetHScrollBar(), GetVScrollBar() );
     }
-    else if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    else if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         if (SfxDispatcher* pDispatcher = GetDispatcher())
         {
diff --git a/basctl/source/basicide/bastypes.cxx 
b/basctl/source/basicide/bastypes.cxx
index 8f9fd17..5fc8268 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -487,7 +487,7 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
 
 void TabBar::Command( const CommandEvent& rCEvt )
 {
-    if ( ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) && !IsInEditMode() )
+    if ( ( rCEvt.GetCommand() == CommandEventId::ContextMenu ) && 
!IsInEditMode() )
     {
         Point aPos( rCEvt.IsMouseEvent() ? rCEvt.GetMousePosPixel() : 
Point(1,1) );
         if ( rCEvt.IsMouseEvent() )     // select right tab
diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index 9d0f94a..1e28f3f 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -969,7 +969,7 @@ void ChartController::execute_Command( const CommandEvent& 
rCEvt )
     }
 
     // pop-up menu
-    if(rCEvt.GetCommand() == COMMAND_CONTEXTMENU && !bIsAction)
+    if(rCEvt.GetCommand() == CommandEventId::ContextMenu && !bIsAction)
     {
         {
             SolarMutexGuard aGuard;
@@ -1259,10 +1259,10 @@ void ChartController::execute_Command( const 
CommandEvent& rCEvt )
             }
         }
     }
-    else if( ( rCEvt.GetCommand() == COMMAND_STARTEXTTEXTINPUT ) ||
-             ( rCEvt.GetCommand() == COMMAND_EXTTEXTINPUT ) ||
-             ( rCEvt.GetCommand() == COMMAND_ENDEXTTEXTINPUT ) ||
-             ( rCEvt.GetCommand() == COMMAND_INPUTCONTEXTCHANGE ) )
+    else if( ( rCEvt.GetCommand() == CommandEventId::StartExtTextInput ) ||
+             ( rCEvt.GetCommand() == CommandEventId::ExtTextInput ) ||
+             ( rCEvt.GetCommand() == CommandEventId::EndExtTextInput ) ||
+             ( rCEvt.GetCommand() == CommandEventId::InputContextChange ) )
     {
         //#i84417# enable editing with IME
         SolarMutexGuard aGuard;
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 506ca09..65064c3 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -951,8 +951,7 @@ bool ColorConfigCtrl_Impl::PreNotify( NotifyEvent& rNEvt )
     if(rNEvt.GetType() == MouseNotifyEvent::COMMAND)
     {
         const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
-        sal_uInt16 nCmd = pCEvt->GetCommand();
-        if( COMMAND_WHEEL == nCmd )
+        if( pCEvt->GetCommand() == CommandEventId::Wheel )
         {
             Command(*pCEvt);
             return true;
@@ -966,9 +965,9 @@ void ColorConfigCtrl_Impl::Command( const CommandEvent& 
rCEvt )
     switch ( rCEvt.GetCommand() )
     {
 
-        case COMMAND_WHEEL:
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::Wheel:
+        case CommandEventId::StartAutoScroll:
+        case CommandEventId::AutoScroll:
         {
             const CommandWheelData* pWheelData = rCEvt.GetWheelData();
             if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM 
!= pWheelData->GetMode())
diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx 
b/dbaccess/source/ui/misc/WTypeSelect.cxx
index fad658b..dcde972 100644
--- a/dbaccess/source/ui/misc/WTypeSelect.cxx
+++ b/dbaccess/source/ui/misc/WTypeSelect.cxx
@@ -422,7 +422,7 @@ bool OWizTypeSelectList::PreNotify( NotifyEvent& rEvt )
                 break;
 
             const CommandEvent* pComEvt = rEvt.GetCommandEvent();
-            if(pComEvt->GetCommand() != COMMAND_CONTEXTMENU)
+            if(pComEvt->GetCommand() != CommandEventId::ContextMenu)
                 break;
             // the place, at which was clicked
             Point ptWhere(0,0);
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx 
b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index bcd5d47..f3ef5af 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1149,7 +1149,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt)
 
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             if( m_vTableConnection.empty() )
                 return;
@@ -1186,6 +1186,8 @@ void OJoinTableView::Command(const CommandEvent& rEvt)
             }
             bHandled = true;
         }
+        break;
+        default: break;
     }
     if (!bHandled)
         Window::Command(rEvt);
@@ -1251,7 +1253,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
         case MouseNotifyEvent::COMMAND:
         {
             const CommandEvent* pCommand = rNEvt.GetCommandEvent();
-            if (pCommand->GetCommand() == COMMAND_WHEEL)
+            if (pCommand->GetCommand() == CommandEventId::Wheel)
             {
                 const CommandWheelData* pData = 
rNEvt.GetCommandEvent()->GetWheelData();
                 if (pData->GetMode() == CommandWheelMode::SCROLL)
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx 
b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 4f556d2..3bf8774 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -1917,7 +1917,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& 
rEvt)
 {
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             Point aMenuPos( rEvt.GetMousePosPixel() );
 
diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx 
b/dbaccess/source/ui/querydesign/TableWindow.cxx
index 31697a3..52dcde3 100644
--- a/dbaccess/source/ui/querydesign/TableWindow.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindow.cxx
@@ -583,7 +583,7 @@ void OTableWindow::Command(const CommandEvent& rEvt)
 {
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             OJoinController& rController = getDesignView()->getController();
             if(!rController.isReadOnly() && rController.isConnected())
diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx 
b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
index f0408d9..4db24a6 100644
--- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx
@@ -359,7 +359,7 @@ void OTableWindowListBox::Command(const CommandEvent& rEvt)
 {
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             static_cast<OTableWindow*>(Window::GetParent())->Command(rEvt);
             break;
diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx 
b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
index 0c5ca6a..2cb3efe 100644
--- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx
@@ -106,16 +106,13 @@ void OTableWindowTitle::RequestHelp( const HelpEvent& 
rHEvt )
 
 void OTableWindowTitle::Command( const CommandEvent& rEvt )
 {
-    switch( rEvt.GetCommand() )
+    if ( rEvt.GetCommand() == CommandEventId::ContextMenu )
     {
-        case COMMAND_CONTEXTMENU:
-        {
-            GrabFocus();
-            if ( m_pTabWin )
-                m_pTabWin->Command( rEvt );
-            else
-                Control::Command(rEvt);
-        }
+        GrabFocus();
+        if ( m_pTabWin )
+            m_pTabWin->Command( rEvt );
+        else
+            Control::Command(rEvt);
     }
 }
 
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx 
b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 2033410..9074ac9 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -1344,7 +1344,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt)
 {
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             Point aMenuPos( rEvt.GetMousePosPixel() );
             if (!rEvt.IsMouseEvent())
diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx 
b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
index 81dfc57..5aced5b 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
@@ -104,7 +104,7 @@ void OTableRowView::Command(const CommandEvent& rEvt)
 
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             if (!rEvt.IsMouseEvent())
             {
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx 
b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 77e926f..26b577e 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -888,7 +888,7 @@ bool ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
     if ( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
     {
         if ( m_bHasScrollBar &&
-             ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
+             ( rNEvt.GetCommandEvent()->GetCommand() == CommandEventId::Wheel 
) )
         {
             const CommandWheelData* pData = 
rNEvt.GetCommandEvent()->GetWheelData();
             if ( pData->GetMode() == CommandWheelMode::SCROLL )
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index d74bb8b..bfded82 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -347,7 +347,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
 {
     GetSelEngine().SetCurView( pView );
     SetActiveView( pView );
-    if ( rCEvt.GetCommand() == COMMAND_STARTEXTTEXTINPUT )
+    if ( rCEvt.GetCommand() == CommandEventId::StartExtTextInput )
     {
         pView->DeleteSelected();
         delete mpIMEInfos;
@@ -360,9 +360,9 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
         mpIMEInfos->bWasCursorOverwrite = !pView->IsInsertMode();
         UndoActionStart( EDITUNDO_INSERT );
     }
-    else if ( rCEvt.GetCommand() == COMMAND_ENDEXTTEXTINPUT )
+    else if ( rCEvt.GetCommand() == CommandEventId::EndExtTextInput )
     {
-        OSL_ENSURE( mpIMEInfos, "COMMAND_ENDEXTTEXTINPUT => Kein Start ?" );
+        OSL_ENSURE( mpIMEInfos, "CommandEventId::EndExtTextInput => Kein Start 
?" );
         if( mpIMEInfos )
         {
             // #102812# convert quotes in IME text
@@ -400,9 +400,9 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
         }
         UndoActionEnd( EDITUNDO_INSERT );
     }
-    else if ( rCEvt.GetCommand() == COMMAND_EXTTEXTINPUT )
+    else if ( rCEvt.GetCommand() == CommandEventId::ExtTextInput )
     {
-        OSL_ENSURE( mpIMEInfos, "COMMAND_EXTTEXTINPUT => No Start ?" );
+        OSL_ENSURE( mpIMEInfos, "CommandEventId::ExtTextInput => No Start ?" );
         if( mpIMEInfos )
         {
             const CommandExtTextInputData* pData = rCEvt.GetExtTextInputData();
@@ -469,10 +469,10 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
                 pView->HideCursor();
         }
     }
-    else if ( rCEvt.GetCommand() == COMMAND_INPUTCONTEXTCHANGE )
+    else if ( rCEvt.GetCommand() == CommandEventId::InputContextChange )
     {
     }
-    else if ( rCEvt.GetCommand() == COMMAND_CURSORPOS )
+    else if ( rCEvt.GetCommand() == CommandEventId::CursorPos )
     {
         if ( mpIMEInfos && mpIMEInfos->nLen )
         {
@@ -498,7 +498,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
             pView->GetWindow()->SetCursorRect();
         }
     }
-    else if ( rCEvt.GetCommand() == COMMAND_SELECTIONCHANGE )
+    else if ( rCEvt.GetCommand() == CommandEventId::SelectionChange )
     {
         const CommandSelectionChangeData *pData = 
rCEvt.GetSelectionChangeData();
 
@@ -518,7 +518,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
         }
         pView->SetSelection( aSelection );
     }
-    else if ( rCEvt.GetCommand() == COMMAND_PREPARERECONVERSION )
+    else if ( rCEvt.GetCommand() == CommandEventId::PrepareReconversion )
     {
         if ( pView->HasSelection() )
         {
@@ -534,7 +534,7 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, 
EditView* pView )
             }
         }
     }
-    else if ( rCEvt.GetCommand() == COMMAND_QUERYCHARPOSITION )
+    else if ( rCEvt.GetCommand() == CommandEventId::QueryCharPosition )
     {
         if ( mpIMEInfos && mpIMEInfos->nLen )
         {
diff --git a/extensions/source/propctrlr/browserlistbox.cxx 
b/extensions/source/propctrlr/browserlistbox.cxx
index 13b2df8..dca5033 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -1272,9 +1272,9 @@ namespace pcr
         if ( _rNEvt.GetType() == MouseNotifyEvent::COMMAND)
         {
             const CommandEvent* pCommand = _rNEvt.GetCommandEvent();
-            if  (   ( COMMAND_WHEEL == pCommand->GetCommand() )
-                ||  ( COMMAND_STARTAUTOSCROLL == pCommand->GetCommand() )
-                ||  ( COMMAND_AUTOSCROLL == pCommand->GetCommand() )
+            if  (   ( CommandEventId::Wheel == pCommand->GetCommand() )
+                ||  ( CommandEventId::StartAutoScroll == 
pCommand->GetCommand() )
+                ||  ( CommandEventId::AutoScroll == pCommand->GetCommand() )
                 )
             {
                 // interested in scroll events if we have a scrollbar
diff --git a/forms/source/richtext/richtextimplcontrol.cxx 
b/forms/source/richtext/richtextimplcontrol.cxx
index 0d67724..bc4a629 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -557,9 +557,9 @@ namespace frm
 
     long RichTextControlImpl::HandleCommand( const CommandEvent& _rEvent )
     {
-        if (  ( _rEvent.GetCommand() == COMMAND_WHEEL )
-           || ( _rEvent.GetCommand() == COMMAND_STARTAUTOSCROLL )
-           || ( _rEvent.GetCommand() == COMMAND_AUTOSCROLL )
+        if (  ( _rEvent.GetCommand() == CommandEventId::Wheel )
+           || ( _rEvent.GetCommand() == CommandEventId::StartAutoScroll )
+           || ( _rEvent.GetCommand() == CommandEventId::AutoScroll )
            )
         {
             m_pAntiImpl->HandleScrollCommand( _rEvent, m_pHScroll, m_pVScroll 
);
diff --git a/framework/source/dispatch/windowcommanddispatch.cxx 
b/framework/source/dispatch/windowcommanddispatch.cxx
index 6920549..dcdc465 100644
--- a/framework/source/dispatch/windowcommanddispatch.cxx
+++ b/framework/source/dispatch/windowcommanddispatch.cxx
@@ -107,7 +107,7 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, void*, 
pParam)
         return 0L;
 
     const CommandEvent* pCommand = 
static_cast<CommandEvent*>(pEvent->GetData());
-    if (pCommand->GetCommand() != COMMAND_SHOWDIALOG)
+    if (pCommand->GetCommand() != CommandEventId::ShowDialog)
         return 0L;
 
     const CommandDialogData* pData = pCommand->GetDialogData();
diff --git a/framework/source/uielement/statusbarmanager.cxx 
b/framework/source/uielement/statusbarmanager.cxx
index f6bfb7e..80e81c0 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -599,7 +599,7 @@ void StatusBarManager::Command( const CommandEvent& rEvt )
     if ( m_bDisposed )
         return;
 
-    if ( rEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         sal_uInt16 nId = m_pStatusBar->GetItemId( rEvt.GetMousePosPixel() );
         StatusBarControllerMap::const_iterator it = m_aControllerMap.find( nId 
);
diff --git a/framework/source/uielement/toolbarmanager.cxx 
b/framework/source/uielement/toolbarmanager.cxx
index 46d04d9..3e12b5e 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1777,7 +1777,7 @@ IMPL_LINK_TYPED( ToolBarManager, Command, CommandEvent 
const *, pCmdEvt, void )
 
     if ( m_bDisposed )
         return;
-    if ( pCmdEvt->GetCommand() != COMMAND_CONTEXTMENU )
+    if ( pCmdEvt->GetCommand() != CommandEventId::ContextMenu )
         return;
 
     ::PopupMenu * pMenu = GetToolBarCustomMenu(m_pToolBar);
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx
index 3216468..9a7d650 100644
--- a/include/vcl/cmdevt.hxx
+++ b/include/vcl/cmdevt.hxx
@@ -382,42 +382,46 @@ public:
 
 
 // - CommandEvent -
-#define COMMAND_CONTEXTMENU             ((sal_uInt16)1)
-#define COMMAND_STARTDRAG               ((sal_uInt16)2)
-#define COMMAND_WHEEL                   ((sal_uInt16)3)
-#define COMMAND_STARTAUTOSCROLL         ((sal_uInt16)4)
-#define COMMAND_AUTOSCROLL              ((sal_uInt16)5)
-#define COMMAND_STARTEXTTEXTINPUT       ((sal_uInt16)7)
-#define COMMAND_EXTTEXTINPUT            ((sal_uInt16)8)
-#define COMMAND_ENDEXTTEXTINPUT         ((sal_uInt16)9)
-#define COMMAND_INPUTCONTEXTCHANGE      ((sal_uInt16)10)
-#define COMMAND_CURSORPOS               ((sal_uInt16)11)
-#define COMMAND_PASTESELECTION          ((sal_uInt16)12)
-#define COMMAND_MODKEYCHANGE            ((sal_uInt16)13)
-#define COMMAND_HANGUL_HANJA_CONVERSION ((sal_uInt16)14)
-#define COMMAND_INPUTLANGUAGECHANGE     ((sal_uInt16)15)
-#define COMMAND_SHOWDIALOG              ((sal_uInt16)16)
-#define COMMAND_MEDIA                   ((sal_uInt16)17)
-#define COMMAND_SELECTIONCHANGE         ((sal_uInt16)18)
-#define COMMAND_PREPARERECONVERSION     ((sal_uInt16)19)
-#define COMMAND_QUERYCHARPOSITION       ((sal_uInt16)20)
-#define COMMAND_SWIPE                   ((sal_uInt16)21)
-#define COMMAND_LONGPRESS               ((sal_uInt16)22)
+enum class CommandEventId
+{
+    NONE                    = 0,
+    ContextMenu             = 1,
+    StartDrag               = 2,
+    Wheel                   = 3,
+    StartAutoScroll         = 4,
+    AutoScroll              = 5,
+    StartExtTextInput       = 7,
+    ExtTextInput            = 8,
+    EndExtTextInput         = 9,
+    InputContextChange      = 10,
+    CursorPos               = 11,
+    PasteSelection          = 12,
+    ModKeyChange            = 13,
+    HangulHanjaConversion   = 14,
+    InputLanguageChange     = 15,
+    ShowDialog              = 16,
+    Media                   = 17,
+    SelectionChange         = 18,
+    PrepareReconversion     = 19,
+    QueryCharPosition       = 20,
+    Swipe                   = 21,
+    LongPress               = 22,
+};
 
 class VCL_DLLPUBLIC CommandEvent
 {
 private:
     Point                               maPos;
     void*                               mpData;
-    sal_uInt16                          mnCommand;
+    CommandEventId                      mnCommand;
     bool                                mbMouseEvent;
 
 public:
                                         CommandEvent();
-                                        CommandEvent( const Point& rMousePos, 
sal_uInt16 nCmd,
+                                        CommandEvent( const Point& rMousePos, 
CommandEventId nCmd,
                                                       bool bMEvt = false, 
const void* pCmdData = NULL );
 
-    sal_uInt16                          GetCommand() const { return mnCommand; 
}
+    CommandEventId                      GetCommand() const { return mnCommand; 
}
     const Point&                        GetMousePosPixel() const { return 
maPos; }
     bool                                IsMouseEvent() const { return 
mbMouseEvent; }
     void*                               GetEventData() const { return mpData; }
@@ -437,12 +441,12 @@ public:
 inline CommandEvent::CommandEvent()
 {
     mpData          = NULL;
-    mnCommand       = 0;
+    mnCommand       = CommandEventId::NONE;
     mbMouseEvent    = false;
 }
 
 inline CommandEvent::CommandEvent( const Point& rMousePos,
-                                   sal_uInt16 nCmd, bool bMEvt, const void* 
pCmdData ) :
+                                   CommandEventId nCmd, bool bMEvt, const 
void* pCmdData ) :
             maPos( rMousePos )
 {
     mpData          = const_cast<void*>(pCmdData);
@@ -452,7 +456,7 @@ inline CommandEvent::CommandEvent( const Point& rMousePos,
 
 inline const CommandExtTextInputData* CommandEvent::GetExtTextInputData() const
 {
-    if ( mnCommand == COMMAND_EXTTEXTINPUT )
+    if ( mnCommand == CommandEventId::ExtTextInput )
         return static_cast<const CommandExtTextInputData*>(mpData);
     else
         return NULL;
@@ -460,7 +464,7 @@ inline const CommandExtTextInputData* 
CommandEvent::GetExtTextInputData() const
 
 inline const CommandInputContextData* 
CommandEvent::GetInputContextChangeData() const
 {
-    if ( mnCommand == COMMAND_INPUTCONTEXTCHANGE )
+    if ( mnCommand == CommandEventId::InputContextChange )
         return static_cast<const CommandInputContextData*>(mpData);
     else
         return NULL;
@@ -468,7 +472,7 @@ inline const CommandInputContextData* 
CommandEvent::GetInputContextChangeData()
 
 inline const CommandWheelData* CommandEvent::GetWheelData() const
 {
-    if ( mnCommand == COMMAND_WHEEL )
+    if ( mnCommand == CommandEventId::Wheel )
         return static_cast<const CommandWheelData*>(mpData);
     else
         return NULL;
@@ -476,7 +480,7 @@ inline const CommandWheelData* CommandEvent::GetWheelData() 
const
 
 inline const CommandScrollData* CommandEvent::GetAutoScrollData() const
 {
-    if ( mnCommand == COMMAND_AUTOSCROLL )
+    if ( mnCommand == CommandEventId::AutoScroll )
         return static_cast<const CommandScrollData*>(mpData);
     else
         return NULL;
@@ -484,7 +488,7 @@ inline const CommandScrollData* 
CommandEvent::GetAutoScrollData() const
 
 inline const CommandModKeyData* CommandEvent::GetModKeyData() const
 {
-    if( mnCommand == COMMAND_MODKEYCHANGE )
+    if( mnCommand == CommandEventId::ModKeyChange )
         return static_cast<const CommandModKeyData*>(mpData);
     else
         return NULL;
@@ -492,7 +496,7 @@ inline const CommandModKeyData* 
CommandEvent::GetModKeyData() const
 
 inline const CommandDialogData* CommandEvent::GetDialogData() const
 {
-    if( mnCommand == COMMAND_SHOWDIALOG )
+    if( mnCommand == CommandEventId::ShowDialog )
         return static_cast<const CommandDialogData*>(mpData);
     else
         return NULL;
@@ -500,7 +504,7 @@ inline const CommandDialogData* 
CommandEvent::GetDialogData() const
 
 inline CommandMediaData* CommandEvent::GetMediaData() const
 {
-    if( mnCommand == COMMAND_MEDIA )
+    if( mnCommand == CommandEventId::Media )
         return static_cast<CommandMediaData*>(mpData);
     else
         return NULL;
@@ -508,7 +512,7 @@ inline CommandMediaData* CommandEvent::GetMediaData() const
 
 inline const CommandSelectionChangeData* 
CommandEvent::GetSelectionChangeData() const
 {
-    if( mnCommand == COMMAND_SELECTIONCHANGE )
+    if( mnCommand == CommandEventId::SelectionChange )
     return static_cast<const CommandSelectionChangeData*>(mpData);
     else
     return NULL;
@@ -516,7 +520,7 @@ inline const CommandSelectionChangeData* 
CommandEvent::GetSelectionChangeData()
 
 inline const CommandSwipeData* CommandEvent::GetSwipeData() const
 {
-    if( mnCommand == COMMAND_SWIPE )
+    if( mnCommand == CommandEventId::Swipe )
         return static_cast<const CommandSwipeData*>(mpData);
     else
         return NULL;
@@ -524,7 +528,7 @@ inline const CommandSwipeData* CommandEvent::GetSwipeData() 
const
 
 inline const CommandLongPressData* CommandEvent::GetLongPressData() const
 {
-    if( mnCommand == COMMAND_LONGPRESS )
+    if( mnCommand == CommandEventId::LongPress )
         return static_cast<const CommandLongPressData*>(mpData);
     else
         return NULL;
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx 
b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 839fa91..ff786a5 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 13c4e5a..f65a642 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 d8e97db..ae97c8e 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;
     }
 }
 
diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx 
b/reportdesign/source/ui/report/ScrollHelper.cxx
index ba789bc..938fd45 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;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index fdfe240..d15a661 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3268,9 +3268,9 @@ bool ScInputHandler::InputCommand( const CommandEvent& 
rCEvt, bool bForce )
 {
     bool bUsed = false;
 
-    if ( rCEvt.GetCommand() == COMMAND_CURSORPOS )
+    if ( rCEvt.GetCommand() == CommandEventId::CursorPos )
     {
-        // For COMMAND_CURSORPOS, do as little as possible, because
+        // For CommandEventId::CursorPos, do as little as possible, because
         // with remote VCL, even a ShowCursor will generate another event.
         if ( eMode != SC_INPUT_NONE )
         {
@@ -3285,7 +3285,7 @@ bool ScInputHandler::InputCommand( const CommandEvent& 
rCEvt, bool bForce )
             }
         }
     }
-    else if ( rCEvt.GetCommand() == COMMAND_QUERYCHARPOSITION )
+    else if ( rCEvt.GetCommand() == CommandEventId::QueryCharPosition )
     {
         if ( eMode != SC_INPUT_NONE )
         {
@@ -3358,7 +3358,7 @@ bool ScInputHandler::InputCommand( const CommandEvent& 
rCEvt, bool bForce )
 
                     bUsed = true;
 
-                    if ( rCEvt.GetCommand() == COMMAND_ENDEXTTEXTINPUT )
+                    if ( rCEvt.GetCommand() == CommandEventId::EndExtTextInput 
)
                     {
                         //  AutoInput after ext text input
 
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 7f57d98..8b84cc6 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1595,8 +1595,8 @@ void ScTextWnd::MouseButtonUp( const MouseEvent& rMEvt )
 void ScTextWnd::Command( const CommandEvent& rCEvt )
 {
     bInputMode = true;
-    sal_uInt16 nCommand = rCEvt.GetCommand();
-    if ( pEditView /* && nCommand == COMMAND_STARTDRAG */ )
+    CommandEventId nCommand = rCEvt.GetCommand();
+    if ( pEditView /* && nCommand == CommandEventId::StartDrag */ )
     {
         ScModule* pScMod = SC_MOD();
         ScTabViewShell* pStartViewSh = ScTabViewShell::GetActiveViewShell();
@@ -1609,11 +1609,11 @@ void ScTextWnd::Command( const CommandEvent& rCEvt )
         pEditView->Command( rCEvt );
         pScMod->SetInEditCommand( false );
 
-        //  COMMAND_STARTDRAG does not mean by far that the content was 
actually changed,
+        //  CommandEventId::StartDrag does not mean by far that the content 
was actually changed,
         //  so don't trigger an InputChanged.
         //! Detect if dragged with Move or forbid Drag&Move somehow
 
-        if ( nCommand == COMMAND_STARTDRAG )
+        if ( nCommand == CommandEventId::StartDrag )
         {
             // Is dragged onto another View?
             ScTabViewShell* pEndViewSh = ScTabViewShell::GetActiveViewShell();
@@ -1628,11 +1628,11 @@ void ScTextWnd::Command( const CommandEvent& rCEvt )
                 }
             }
         }
-        else if ( nCommand == COMMAND_CURSORPOS )
+        else if ( nCommand == CommandEventId::CursorPos )
         {
-            //  don't call InputChanged for COMMAND_CURSORPOS
+            //  don't call InputChanged for CommandEventId::CursorPos
         }
-        else if ( nCommand == COMMAND_INPUTLANGUAGECHANGE )
+        else if ( nCommand == CommandEventId::InputLanguageChange )
         {
             // #i55929# Font and font size state depends on input language if 
nothing is selected,
             // so the slots have to be invalidated when the input language is 
changed.
@@ -1645,9 +1645,9 @@ void ScTextWnd::Command( const CommandEvent& rCEvt )
                 rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT );
             }
         }
-        else if ( nCommand == COMMAND_WHEEL )
+        else if ( nCommand == CommandEventId::Wheel )
         {
-            //don't call InputChanged for COMMAND_WHEEL
+            //don't call InputChanged for CommandEventId::Wheel
         }
         else
             SC_MOD()->InputChanged( pEditView );
@@ -1662,7 +1662,7 @@ void ScTextWnd::StartDrag( sal_Int8 /* nAction */, const 
Point& rPosPixel )
 {
     if ( pEditView )
     {
-        CommandEvent aDragEvent( rPosPixel, COMMAND_STARTDRAG, true );
+        CommandEvent aDragEvent( rPosPixel, CommandEventId::StartDrag, true );
         pEditView->Command( aDragEvent );
 
         //  handling of d&d to different view (CancelHandler) can't be done 
here,
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 766ab71..8d29dc1 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -949,7 +949,7 @@ void ScCsvGrid::Command( const CommandEvent& rCEvt )
 {
     switch( rCEvt.GetCommand() )
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             if( rCEvt.IsMouseEvent() )
             {
@@ -973,7 +973,7 @@ void ScCsvGrid::Command( const CommandEvent& rCEvt )
             }
         }
         break;
-        case COMMAND_WHEEL:
+        case CommandEventId::Wheel:
         {
             Point aPoint;
             Rectangle aRect( aPoint, maWinSize );
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 7f1a01b..b9e4eae 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -177,7 +177,7 @@ bool FuPoor::KeyInput(const KeyEvent& /* rKEvt */)
 
 sal_uInt8 FuPoor::Command(const CommandEvent& rCEvt)
 {
-    if ( COMMAND_STARTDRAG == rCEvt.GetCommand() )
+    if ( CommandEventId::StartDrag == rCEvt.GetCommand() )
     {
         //!!! sollte Joe eigentlich machen:
         // nur, wenn im Outliner was selektiert ist, darf
diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/source/ui/miscdlgs/acredlin.cxx
index d7854dd..32bcda4 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1697,7 +1697,7 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl)
 
     const CommandEvent aCEvt(pTheView->GetCommandEvent());
 
-    if(aCEvt.GetCommand()==COMMAND_CONTEXTMENU)
+    if(aCEvt.GetCommand()==CommandEventId::ContextMenu)
     {
         ScPopupMenu aPopup(ScResId(RID_POPUP_CHANGES));
 
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 2e131c8..30ebd41 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -567,7 +567,7 @@ void ScContentTree::Command( const CommandEvent& rCEvt )
 
     switch ( rCEvt.GetCommand() )
     {
-        case COMMAND_STARTDRAG:
+        case CommandEventId::StartDrag:
             //  Aus dem ExecuteDrag heraus kann der Navigator geloescht werden
             //  (beim Umschalten auf einen anderen Dokument-Typ), das wuerde 
aber
             //  den StarView MouseMove-Handler, der Command() aufruft, 
umbringen.
@@ -578,7 +578,7 @@ void ScContentTree::Command( const CommandEvent& rCEvt )
             bDone = true;
             break;
 
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
             {
                 //  Drag-Drop Modus
 
@@ -648,6 +648,7 @@ void ScContentTree::Command( const CommandEvent& rCEvt )
                 }
             }
             break;
+            default: break;
     }
 
     if (!bDone)
diff --git a/sc/source/ui/navipi/scenwnd.cxx b/sc/source/ui/navipi/scenwnd.cxx
index 70ca0bd..22ebb99 100644
--- a/sc/source/ui/navipi/scenwnd.cxx
+++ b/sc/source/ui/navipi/scenwnd.cxx
@@ -129,7 +129,7 @@ bool ScScenarioListBox::Notify( NotifyEvent& rNEvt )
     else if ( rNEvt.GetType() == MouseNotifyEvent::COMMAND && 
GetSelectEntryCount() )
     {
         const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
-        if ( pCEvt && pCEvt->GetCommand() == COMMAND_CONTEXTMENU )
+        if ( pCEvt && pCEvt->GetCommand() == CommandEventId::ContextMenu )
         {
             if( const ScenarioEntry* pEntry = GetSelectedEntry() )
             {
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index be2ff5e..e59acb9 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -2918,7 +2918,7 @@ void ScGridWindow::StartDrag( sal_Int8 /* nAction */, 
const Point& rPosPixel )
 
     HideNoteMarker();
 
-    CommandEvent aDragEvent( rPosPixel, COMMAND_STARTDRAG, true );
+    CommandEvent aDragEvent( rPosPixel, CommandEventId::StartDrag, true );
 
     if (bEEMouse && pViewData->HasEditView( eWhich ))
     {
@@ -2969,25 +2969,25 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
     // menu from an inplace client is closed. Now we have the chance to
     // deactivate the inplace client without any problem regarding parent
     // windows and code on the stack.
-    sal_uInt16 nCmd = rCEvt.GetCommand();
+    CommandEventId nCmd = rCEvt.GetCommand();
     ScTabViewShell* pTabViewSh = pViewData->GetViewShell();
     SfxInPlaceClient* pClient = pTabViewSh->GetIPClient();
     if ( pClient &&
          pClient->IsObjectInPlaceActive() &&
-         nCmd == COMMAND_CONTEXTMENU )
+         nCmd == CommandEventId::ContextMenu )
     {
         pTabViewSh->DeactivateOle();
         return;
     }
 
     ScModule* pScMod = SC_MOD();
-    OSL_ENSURE( nCmd != COMMAND_STARTDRAG, "ScGridWindow::Command called with 
COMMAND_STARTDRAG" );
+    OSL_ENSURE( nCmd != CommandEventId::StartDrag, "ScGridWindow::Command 
called with CommandEventId::StartDrag" );
 
-    if ( nCmd == COMMAND_STARTEXTTEXTINPUT ||
-         nCmd == COMMAND_ENDEXTTEXTINPUT ||
-         nCmd == COMMAND_EXTTEXTINPUT ||
-         nCmd == COMMAND_CURSORPOS ||
-         nCmd == COMMAND_QUERYCHARPOSITION )
+    if ( nCmd == CommandEventId::StartExtTextInput ||
+         nCmd == CommandEventId::EndExtTextInput ||
+         nCmd == CommandEventId::ExtTextInput ||
+         nCmd == CommandEventId::CursorPos ||
+         nCmd == CommandEventId::QueryCharPosition )
     {
         bool bEditView = pViewData->HasEditView( eWhich );
         if (!bEditView)
@@ -3005,7 +3005,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
             }
         }
 
-        if ( nCmd == COMMAND_CURSORPOS && !bEditView )
+        if ( nCmd == CommandEventId::CursorPos && !bEditView )
         {
             //  CURSORPOS may be called without following text input,
             //  to set the input method window position
@@ -3027,7 +3027,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
         return;
     }
 
-    if ( nCmd == COMMAND_PASTESELECTION )
+    if ( nCmd == CommandEventId::PasteSelection )
     {
         if ( bEEMouse )
         {
@@ -3041,7 +3041,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
         return;
     }
 
-    if ( nCmd == COMMAND_INPUTLANGUAGECHANGE )
+    if ( nCmd == CommandEventId::InputLanguageChange )
     {
         // #i55929# Font and font size state depends on input language if 
nothing is selected,
         // so the slots have to be invalidated when the input language is 
changed.
@@ -3052,7 +3052,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
         return;
     }
 
-    if ( nCmd == COMMAND_WHEEL || nCmd == COMMAND_STARTAUTOSCROLL || nCmd == 
COMMAND_AUTOSCROLL )
+    if ( nCmd == CommandEventId::Wheel || nCmd == 
CommandEventId::StartAutoScroll || nCmd == CommandEventId::AutoScroll )
     {
         bool bDone = pViewData->GetView()->ScrollCommand( rCEvt, eWhich );
         if (!bDone)
@@ -3065,7 +3065,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt )
     if (bDisable)
         return;
 
-    if ( nCmd == COMMAND_CONTEXTMENU && !SC_MOD()->GetIsWaterCan() )
+    if ( nCmd == CommandEventId::ContextMenu && !SC_MOD()->GetIsWaterCan() )
     {
         bool bMouse = rCEvt.IsMouseEvent();
         if ( bMouse && nMouseStatus == SC_GM_IGNORE )
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 77e1ce1..15407ea 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -811,8 +811,8 @@ void ScHeaderControl::Tracking( const TrackingEvent& rTEvt )
 
 void ScHeaderControl::Command( const CommandEvent& rCEvt )
 {
-    sal_uInt16 nCmd = rCEvt.GetCommand();
-    if ( nCmd == COMMAND_CONTEXTMENU )
+    CommandEventId nCmd = rCEvt.GetCommand();
+    if ( nCmd == CommandEventId::ContextMenu )
     {
         StopMarking();      // finish selection / dragging
 
@@ -861,7 +861,7 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
             pViewSh->GetDispatcher()->ExecutePopup( aResId );
         }
     }
-    else if ( nCmd == COMMAND_STARTDRAG )
+    else if ( nCmd == CommandEventId::StartDrag )
     {
         pSelEngine->Command( rCEvt );
     }
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index b5448cb..0feb97d 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -639,14 +639,14 @@ void ScPreview::Paint( vcl::RenderContext& 
/*rRenderContext*/, const Rectangle&
 
 void ScPreview::Command( const CommandEvent& rCEvt )
 {
-    sal_uInt16 nCmd = rCEvt.GetCommand();
-    if ( nCmd == COMMAND_WHEEL || nCmd == COMMAND_STARTAUTOSCROLL || nCmd == 
COMMAND_AUTOSCROLL )
+    CommandEventId nCmd = rCEvt.GetCommand();
+    if ( nCmd == CommandEventId::Wheel || nCmd == 
CommandEventId::StartAutoScroll || nCmd == CommandEventId::AutoScroll )
     {
         bool bDone = pViewShell->ScrollCommand( rCEvt );
         if (!bDone)
             Window::Command(rCEvt);
     }
-    else if ( nCmd == COMMAND_CONTEXTMENU )
+    else if ( nCmd == CommandEventId::ContextMenu )
         SfxDispatcher::ExecutePopup();
     else
         Window::Command( rCEvt );
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 98156a8..7801b71 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -425,24 +425,20 @@ void ScTabControl::Command( const CommandEvent& rCEvt )
     // ViewFrame erstmal aktivieren (Bug 19493):
     pViewSh->SetActive();
 
-    sal_uInt16 nCmd = rCEvt.GetCommand();
-    if ( nCmd == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu && !bDisable)
     {
-        if (!bDisable)
-        {
-            // #i18735# select the page that is under the mouse cursor
-            // if multiple tables are selected and the one under the cursor
-            // is not part of them then unselect them
-            sal_uInt16 nId = GetPageId( rCEvt.GetMousePosPixel() );
-            SwitchToPageId(nId);
-
-            // #i52073# OLE inplace editing has to be stopped before showing 
the sheet tab context menu
-            pViewSh->DeactivateOle();
-
-            //  Popup-Menu:
-            //  get Dispatcher from ViewData (ViewFrame) instead of Shell 
(Frame), so it can't be null
-            pViewData->GetDispatcher().ExecutePopup( ScResId(RID_POPUP_TAB) );
-        }
+        // #i18735# select the page that is under the mouse cursor
+        // if multiple tables are selected and the one under the cursor
+        // is not part of them then unselect them
+        sal_uInt16 nId = GetPageId( rCEvt.GetMousePosPixel() );
+        SwitchToPageId(nId);
+
+        // #i52073# OLE inplace editing has to be stopped before showing the 
sheet tab context menu
+        pViewSh->DeactivateOle();
+
+        //  Popup-Menu:
+        //  get Dispatcher from ViewData (ViewFrame) instead of Shell (Frame), 
so it can't be null
+        pViewData->GetDispatcher().ExecutePopup( ScResId(RID_POPUP_TAB) );
     }
 }
 
@@ -454,7 +450,7 @@ void ScTabControl::StartDrag( sal_Int8 /* nAction */, const 
Point& rPosPixel )
     if (!bDisable)
     {
         vcl::Region aRegion( Rectangle(0,0,0,0) );
-        CommandEvent aCEvt( rPosPixel, COMMAND_STARTDRAG, true );   // needed 
for StartDrag
+        CommandEvent aCEvt( rPosPixel, CommandEventId::StartDrag, true );   // 
needed for StartDrag
         if (TabBar::StartDrag( aCEvt, aRegion ))
             DoDrag( aRegion );
     }
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx 
b/sd/source/ui/animations/CustomAnimationList.cxx
index d840f0a..0f88370 100644
--- a/sd/source/ui/animations/CustomAnimationList.cxx
+++ b/sd/source/ui/animations/CustomAnimationList.cxx
@@ -473,7 +473,7 @@ void CustomAnimationList::KeyInput( const KeyEvent& rKEvt )
         case KEY_SPACE:
             {
                 const Point aPos;
-                const CommandEvent aCEvt( aPos, COMMAND_CONTEXTMENU );
+                const CommandEvent aCEvt( aPos, CommandEventId::ContextMenu );
                 Command( aCEvt );
                 return;
             }
diff --git a/sd/source/ui/annotations/annotationtag.cxx 
b/sd/source/ui/annotations/annotationtag.cxx
index 440c7bf..9a0c861 100644
--- a/sd/source/ui/annotations/annotationtag.cxx
+++ b/sd/source/ui/annotations/annotationtag.cxx
@@ -350,7 +350,7 @@ bool AnnotationTag::RequestHelp( const HelpEvent& /*rHEvt*/ 
)
 /** returns true if the SmartTag consumes this event. */
 bool AnnotationTag::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         vcl::Window* pWindow = mrView.GetViewShell()->GetActiveWindow();
         if( pWindow )
diff --git a/sd/source/ui/annotations/annotationwindow.cxx 
b/sd/source/ui/annotations/annotationwindow.cxx
index 6ed8eb3..1b08e48 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -215,7 +215,7 @@ void AnnotationTextWindow::MouseButtonUp( const MouseEvent& 
rMEvt )
 
 void AnnotationTextWindow::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
            mpAnnotationWindow->Command(rCEvt);
     }
@@ -738,7 +738,7 @@ void AnnotationWindow::MouseButtonDown( const MouseEvent& 
rMEvt )
 
 void AnnotationWindow::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         if( mpMeta->IsVisible() &&(mpMeta->GetPosPixel().Y() < 
rCEvt.GetMousePosPixel().Y()) )
             return;
diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx
index 79d10ba..47a6bc0 100644
--- a/sd/source/ui/app/sdmod1.cxx
+++ b/sd/source/ui/app/sdmod1.cxx
@@ -422,7 +422,7 @@ IMPL_STATIC_LINK( SdModule, EventListenerHdl, 
VclSimpleEvent*, pEvent )
     {
         const CommandEvent& rEvent = *static_cast<const 
CommandEvent*>(static_cast<VclWindowEvent*>(pEvent)->GetData());
 
-        if( rEvent.GetCommand() == COMMAND_MEDIA )
+        if( rEvent.GetCommand() == CommandEventId::Media )
         {
             CommandMediaData* pMediaData = rEvent.GetMediaData();
             pMediaData->SetPassThroughToOS(false);
diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx
index 494cd21..4e3ca33 100644
--- a/sd/source/ui/app/tmplctrl.cxx
+++ b/sd/source/ui/app/tmplctrl.cxx
@@ -92,7 +92,7 @@ void SdTemplateControl::Paint( const UserDrawEvent&  )
 
 void SdTemplateControl::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && 
!GetStatusBar().GetItemText( GetId() ).isEmpty() )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu && 
!GetStatusBar().GetItemText( GetId() ).isEmpty() )
     {
         SfxViewFrame* pViewFrame = SfxViewFrame::Current();
 
diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx
index 934c5bb..500d78c 100644
--- a/sd/source/ui/dlg/LayerTabBar.cxx
+++ b/sd/source/ui/dlg/LayerTabBar.cxx
@@ -151,7 +151,7 @@ sal_Int8 LayerTabBar::ExecuteDrop( const ExecuteDropEvent& 
rEvt )
 
 void  LayerTabBar::Command(const CommandEvent& rCEvt)
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         SfxDispatcher* pDispatcher = 
pDrViewSh->GetViewFrame()->GetDispatcher();
         pDispatcher->ExecutePopup(SdResId(RID_LAYERTAB_POPUP));
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx 
b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index 8c74a76..4c8bcf9 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -614,7 +614,7 @@ bool ClientBox::Notify( NotifyEvent& rNEvt )
     if ( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
     {
         if ( m_bHasScrollBar &&
-             ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
+             ( rNEvt.GetCommandEvent()->GetCommand() == CommandEventId::Wheel 
) )
         {
             const CommandWheelData* pData = 
rNEvt.GetCommandEvent()->GetWheelData();
             if ( pData->GetMode() == CommandWheelMode::SCROLL )
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx 
b/sd/source/ui/sidebar/LayoutMenu.cxx
index 31abab12..4c2ba8b 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -590,7 +590,7 @@ void LayoutMenu::Command (const CommandEvent& rEvent)
 {
     switch (rEvent.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
             if ( ! SD_MOD()->GetWaterCan())
             {
                 // Determine the position where to show the menu.
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx 
b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 055c28e..2c522c1 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -206,7 +206,7 @@ void MasterPagesSelector::Command (const CommandEvent& 
rEvent)
 {
     switch (rEvent.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             // Use the currently selected item and show the popup menu in its
             // center.
@@ -237,8 +237,9 @@ void MasterPagesSelector::Command (const CommandEvent& 
rEvent)
                 // Show the menu.
                 pMenu->Execute(this, Rectangle(aPosition,Size(1,1)), 
POPUPMENU_EXECUTE_DOWN);
             }
-            break;
         }
+        break;
+        default: break;
     }
 }
 
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx 
b/sd/source/ui/slideshow/slideshowimpl.cxx
index 4018cb1..de631df 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -2013,7 +2013,7 @@ IMPL_LINK( SlideshowImpl, EventListenerHdl, 
VclSimpleEvent*, pEvent )
     {
         const CommandEvent& rEvent = *static_cast<const 
CommandEvent*>(static_cast<VclWindowEvent*>(pEvent)->GetData());
 
-        if( rEvent.GetCommand() == COMMAND_MEDIA )
+        if( rEvent.GetCommand() == CommandEventId::Media )
         {
             CommandMediaData* pMediaData = rEvent.GetMediaData();
             pMediaData->SetPassThroughToOS(false);
diff --git a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx 
b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
index 81fe35a..a841277 100644
--- a/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
+++ b/sd/source/ui/slidesorter/controller/SlideSorterController.cxx
@@ -314,7 +314,7 @@ bool SlideSorterController::Command (
 
     switch (rEvent.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             SdPage* pPage = NULL;
             sal_uInt16 nPopupId;
@@ -426,7 +426,7 @@ bool SlideSorterController::Command (
         }
         break;
 
-        case COMMAND_WHEEL:
+        case CommandEventId::Wheel:
         {
             const CommandWheelData* pData = rEvent.GetWheelData();
             if (pData == NULL)
@@ -459,6 +459,8 @@ bool SlideSorterController::Command (
             bEventHasBeenHandled = true;
         }
         break;
+
+        default: break;
     }
 
     return bEventHasBeenHandled;
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index dc7a8fe..8e157e0 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -460,7 +460,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
     // windows and code on the stack.
     SfxInPlaceClient* pIPClient = GetViewShell()->GetIPClient();
     bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
-    if ( bIsOleActive && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ))
+    if ( bIsOleActive && ( rCEvt.GetCommand() == CommandEventId::ContextMenu ))
     {
         // Deactivate OLE object
         mpDrawView->UnmarkAll();
@@ -475,7 +475,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
 
         const bool bNativeShow (SlideShow::IsRunning(GetViewShellBase()));
 
-        if( rCEvt.GetCommand() == COMMAND_PASTESELECTION && !bNativeShow )
+        if( rCEvt.GetCommand() == CommandEventId::PasteSelection && 
!bNativeShow )
         {
             TransferableDataHelper aDataHelper( 
TransferableDataHelper::CreateFromSelection( GetActiveWindow() ) );
 
@@ -503,7 +503,7 @@ void DrawViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
                 }
             }
         }
-        else if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && !bNativeShow &&
+        else if( rCEvt.GetCommand() == CommandEventId::ContextMenu && 
!bNativeShow &&
                  pWin != NULL && !mpDrawView->IsAction() && 
!SD_MOD()->GetWaterCan() )
         {
             sal_uInt16 nSdResId = 0;          // ResourceID for popup menu
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 59ada27..c3382c8 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -1368,7 +1368,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet)
 
 void OutlineViewShell::Command( const CommandEvent& rCEvt, ::sd::Window* pWin )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         GetActiveWindow()->ReleaseMouse();
 
diff --git a/sd/source/ui/view/sdruler.cxx b/sd/source/ui/view/sdruler.cxx
index 95d4c6c..8c3c9b7 100644
--- a/sd/source/ui/view/sdruler.cxx
+++ b/sd/source/ui/view/sdruler.cxx
@@ -142,7 +142,7 @@ void Ruler::SetNullOffset(const Point& rOffset)
 
 void Ruler::Command(const CommandEvent& rCEvt)
 {
-    if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU &&
+    if( rCEvt.GetCommand() == CommandEventId::ContextMenu &&
         !pDrViewShell->GetView()->IsTextEdit() )
     {
         SvxRuler::Command( rCEvt );
diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx
index 908e3e5..d66f319 100644
--- a/sd/source/ui/view/tabcontr.cxx
+++ b/sd/source/ui/view/tabcontr.cxx
@@ -278,9 +278,7 @@ sal_Int8 TabControl::ExecuteDrop( const ExecuteDropEvent& 
rEvt )
 
 void TabControl::Command(const CommandEvent& rCEvt)
 {
-    sal_uInt16 nCmd = rCEvt.GetCommand();
-
-    if ( nCmd == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         bool bGraphicShell = pDrViewSh->ISA(GraphicViewShell);
         sal_uInt16 nResId = bGraphicShell ? RID_GRAPHIC_PAGETAB_POPUP :
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index f5168b5..b7b0694 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -641,7 +641,7 @@ void ViewShell::Command(const CommandEvent& rCEvt, 
::sd::Window* pWin)
 
     if( !bDone )
     {
-        if( rCEvt.GetCommand() == COMMAND_INPUTLANGUAGECHANGE )
+        if( rCEvt.GetCommand() == CommandEventId::InputLanguageChange )
         {
             //#i42732# update state of fontname if input language changes
             GetViewFrame()->GetBindings().Invalidate( SID_ATTR_CHAR_FONT );
@@ -682,7 +682,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& 
rCEvt, ::sd::Window* pWi
 
     switch( rCEvt.GetCommand() )
     {
-        case COMMAND_SWIPE:
+        case CommandEventId::Swipe:
             {
                 rtl::Reference< SlideShow > xSlideShow( 
SlideShow::GetSlideShow( GetViewShellBase() ) );
                 if (xSlideShow.is())
@@ -692,7 +692,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& 
rCEvt, ::sd::Window* pWi
                 }
             }
             break;
-        case COMMAND_LONGPRESS:
+        case CommandEventId::LongPress:
             {
                 rtl::Reference< SlideShow > xSlideShow( 
SlideShow::GetSlideShow( GetViewShellBase() ) );
                 if (xSlideShow.is())
@@ -703,7 +703,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& 
rCEvt, ::sd::Window* pWi
             }
             break;
 
-        case COMMAND_WHEEL:
+        case CommandEventId::Wheel:
             {
                 Reference< XSlideShowController > xSlideShowController( 
SlideShow::GetSlideShowController(GetViewShellBase() ) );
                 if( xSlideShowController.is() )
@@ -726,8 +726,8 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& 
rCEvt, ::sd::Window* pWi
                 }
             }
             // fall through when not running slideshow
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::StartAutoScroll:
+        case CommandEventId::AutoScroll:
         {
             const CommandWheelData* pData = rCEvt.GetWheelData();
 
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 7adaaf1..3b26172 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1278,7 +1278,7 @@ bool BookmarksBox_Impl::Notify( NotifyEvent& rNEvt )
     else if ( MouseNotifyEvent::COMMAND == nType )
     {
         const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
-        if ( pCEvt->GetCommand() == COMMAND_CONTEXTMENU )
+        if ( pCEvt->GetCommand() == CommandEventId::ContextMenu )
         {
             PopupMenu aMenu( SfxResId( MENU_HELP_BOOKMARKS ) );
             sal_uInt16 nId = aMenu.Execute( this, pCEvt->GetMousePosPixel() );
@@ -2394,7 +2394,7 @@ bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& 
rNEvt )
         const CommandEvent* pCmdEvt = rNEvt.GetCommandEvent();
         vcl::Window* pCmdWin = rNEvt.GetWindow();
 
-        if ( pCmdEvt->GetCommand() == COMMAND_CONTEXTMENU && pCmdWin != this 
&& pCmdWin != aToolBox.get() )
+        if ( pCmdEvt->GetCommand() == CommandEventId::ContextMenu && pCmdWin 
!= this && pCmdWin != aToolBox.get() )
         {
             Point aPos;
             if ( pCmdEvt->IsMouseEvent() )
diff --git a/sfx2/source/control/thumbnailview.cxx 
b/sfx2/source/control/thumbnailview.cxx
index 25f63c4..6fbd97d 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -847,9 +847,9 @@ void ThumbnailView::MouseButtonUp( const MouseEvent& rMEvt )
 
 void ThumbnailView::Command( const CommandEvent& rCEvt )
 {
-    if ( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
-         (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
-         (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) )
+    if ( (rCEvt.GetCommand() == CommandEventId::Wheel) ||
+         (rCEvt.GetCommand() == CommandEventId::StartAutoScroll) ||
+         (rCEvt.GetCommand() == CommandEventId::AutoScroll) )
     {
         if ( HandleScrollCommand( rCEvt, NULL, mpScrBar ) )
             return;
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index ae6ba6d..4b2893e 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -168,7 +168,7 @@ bool Deck::Notify (NotifyEvent& rEvent)
         if (pCommandEvent != NULL)
             switch (pCommandEvent->GetCommand())
             {
-                case COMMAND_WHEEL:
+                case CommandEventId::Wheel:
                     return ProcessWheelEvent(pCommandEvent);
 
                 default:
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 3ebd819..c0ded64 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -377,7 +377,7 @@ throw (::com::sun::star::uno::RuntimeException, 
std::exception)
 {
     SolarMutexGuard aGuard;
     ::Point aPos( rPos.X, rPos.Y );
-    CommandEvent aCmdEvent( aPos, (sal_uInt16)nCommand, true, NULL );
+    CommandEvent aCmdEvent( aPos, static_cast<CommandEventId>(nCommand), true, 
NULL );
 
     Command( aCmdEvent );
 }
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index ce8471f..3213a34 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -341,7 +341,7 @@ void SmEditWindow::MouseButtonDown(const MouseEvent &rEvt)
 void SmEditWindow::Command(const CommandEvent& rCEvt)
 {
     bool bForwardEvt = true;
-    if (rCEvt.GetCommand() == COMMAND_CONTEXTMENU)
+    if (rCEvt.GetCommand() == CommandEventId::ContextMenu)
     {
         GetParent()->ToTop();
 
@@ -368,7 +368,7 @@ void SmEditWindow::Command(const CommandEvent& rCEvt)
         xPopupMenu->Execute( this, aPoint );
         bForwardEvt = false;
     }
-    else if (rCEvt.GetCommand() == COMMAND_WHEEL)
+    else if (rCEvt.GetCommand() == CommandEventId::Wheel)
         bForwardEvt = !HandleWheelCommands( rCEvt );
 
     if (bForwardEvt)
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index 57e3ad9..f8937e3 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -564,7 +564,7 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt)
     {
         switch ( rCEvt.GetCommand() )
         {
-            case COMMAND_CONTEXTMENU:
+            case CommandEventId::ContextMenu:
             {
                 GetParent()->ToTop();
                 SmResId aResId( RID_VIEWMENU );
@@ -583,7 +583,7 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt)
             }
             break;
 
-            case COMMAND_WHEEL:
+            case CommandEventId::Wheel:
             {
                 const CommandWheelData* pWData = rCEvt.GetWheelData();
                 if  ( pWData && CommandWheelMode::ZOOM == pWData->GetMode() )
@@ -598,6 +598,8 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt)
                 }
             }
             break;
+
+            default: break;
         }
     }
     if ( bCallBase )
diff --git a/svtools/source/brwbox/brwbox2.cxx 
b/svtools/source/brwbox/brwbox2.cxx
index e115d7b..dc1e921 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -1443,7 +1443,7 @@ void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
     // event occurred out of data area
     if ( rEvt.IsRight() )
         pDataWin->Command(
-            CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, true ) );
+            CommandEvent( Point( 1, LONG_MAX ), CommandEventId::ContextMenu, 
true ) );
     else
         SetNoSelection();
 }
diff --git a/svtools/source/brwbox/brwhead.cxx 
b/svtools/source/brwbox/brwhead.cxx
index 0c723a3..c0b99ef 100644
--- a/svtools/source/brwbox/brwhead.cxx
+++ b/svtools/source/brwbox/brwhead.cxx
@@ -51,14 +51,14 @@ void BrowserHeader::dispose()
 
 void BrowserHeader::Command( const CommandEvent& rCEvt )
 {
-    if ( !GetCurItemId() && COMMAND_CONTEXTMENU == rCEvt.GetCommand() )
+    if ( !GetCurItemId() && CommandEventId::ContextMenu == rCEvt.GetCommand() )
     {
         Point aPos( rCEvt.GetMousePosPixel() );
         if ( _pBrowseBox->IsFrozen(0) )
             aPos.X() += _pBrowseBox->GetColumnWidth(0);
         _pBrowseBox->GetDataWindow().Command( CommandEvent(
                 Point( aPos.X(), aPos.Y() - GetSizePixel().Height() ),
-                COMMAND_CONTEXTMENU, rCEvt.IsMouseEvent() ) );
+                CommandEventId::ContextMenu, rCEvt.IsMouseEvent() ) );
     }
 }
 
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 6dd64ed..e3dfa38 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -416,16 +416,16 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
 {
     // scroll mouse event?
     BrowseBox *pBox = GetParent();
-    if ( ( (rEvt.GetCommand() == COMMAND_WHEEL) ||
-           (rEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
-           (rEvt.GetCommand() == COMMAND_AUTOSCROLL) ) &&
+    if ( ( (rEvt.GetCommand() == CommandEventId::Wheel) ||
+           (rEvt.GetCommand() == CommandEventId::StartAutoScroll) ||
+           (rEvt.GetCommand() == CommandEventId::AutoScroll) ) &&
          ( HandleScrollCommand( rEvt, pBox->aHScroll.get(), pBox->pVScroll ) ) 
)
       return;
 
     Point aEventPos( rEvt.GetMousePosPixel() );
     long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), false);
     MouseEvent aMouseEvt( aEventPos, 1, MouseEventModifiers::SELECT, 
MOUSE_LEFT );
-    if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
+    if ( CommandEventId::ContextMenu == rEvt.GetCommand() && 
rEvt.IsMouseEvent() &&
          nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
     {
         bInCommand = true;
@@ -447,7 +447,7 @@ void BrowserDataWin::Command( const CommandEvent& rEvt )
         return;
     bInCommand = false;
 
-    if ( COMMAND_STARTDRAG == rEvt.GetCommand() )
+    if ( CommandEventId::StartDrag == rEvt.GetCommand() )
         MouseButtonUp( aMouseEvt );
 
     Control::Command( rEvt );
diff --git a/svtools/source/contnr/imivctl1.cxx 
b/svtools/source/contnr/imivctl1.cxx
index b5d9ca5..d28af60 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2149,7 +2149,7 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const 
CommandEvent& rCmd )
 
     switch( rCmd.GetCommand() )
     {
-        case COMMAND_STARTAUTOSCROLL:
+        case CommandEventId::StartAutoScroll:
         {
             pView->EndTracking();
             sal_uInt16 nScrollFlags = 0;
@@ -2165,7 +2165,7 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const 
CommandEvent& rCmd )
         }
         break;
 
-        case COMMAND_WHEEL:
+        case CommandEventId::Wheel:
         {
             const CommandWheelData* pData = rCmd.GetWheelData();
             if( pData && (CommandWheelMode::SCROLL == pData->GetMode()) && 
!pData->IsHorz() )
@@ -2186,7 +2186,7 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const 
CommandEvent& rCmd )
         }
         break;
 
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::AutoScroll:
         {
             const CommandScrollData* pData = rCmd.GetAutoScrollData();
             if( pData )
@@ -2196,6 +2196,8 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const 
CommandEvent& rCmd )
             }
         }
         break;
+
+        default: break;
     }
 
     if( nScrollDX || nScrollDY )
@@ -2214,9 +2216,9 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const 
CommandEvent& rCmd )
 void SvxIconChoiceCtrl_Impl::Command( const CommandEvent& rCEvt )
 {
     // scroll mouse event?
-    if( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
-        (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
-        (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) )
+    if( (rCEvt.GetCommand() == CommandEventId::Wheel) ||
+        (rCEvt.GetCommand() == CommandEventId::StartAutoScroll) ||
+        (rCEvt.GetCommand() == CommandEventId::AutoScroll) )
     {
         if( HandleScrollCommand( rCEvt ) )
             return;
diff --git a/svtools/source/contnr/svimpbox.cxx 
b/svtools/source/contnr/svimpbox.cxx
index 78ec65c..b50efab 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -2965,17 +2965,17 @@ static void lcl_DeleteSubPopups(PopupMenu* pPopup)
 
 void SvImpLBox::Command( const CommandEvent& rCEvt )
 {
-    sal_uInt16              nCommand = rCEvt.GetCommand();
+    CommandEventId   nCommand = rCEvt.GetCommand();
 
-    if( nCommand == COMMAND_CONTEXTMENU )
+    if( nCommand == CommandEventId::ContextMenu )
         aEditIdle.Stop();
 
     // scroll mouse event?
-    if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == 
COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) )
+    if( ( ( nCommand == CommandEventId::Wheel ) || ( nCommand == 
CommandEventId::StartAutoScroll ) || ( nCommand == CommandEventId::AutoScroll ) 
)
         && pView->HandleScrollCommand( rCEvt, aHorSBar.get(), aVerSBar.get() ) 
)
             return;
 
-    if( bContextMenuHandling && nCommand == COMMAND_CONTEXTMENU )
+    if( bContextMenuHandling && nCommand == CommandEventId::ContextMenu )
     {
         Point   aPopupPos;
         bool    bClickedIsFreePlace = false;
diff --git a/svtools/source/control/calendar.cxx 
b/svtools/source/control/calendar.cxx
index 647bd11..e88fc0e 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -1638,7 +1638,7 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt )
 
 void Calendar::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         if ( !mbSelection && rCEvt.IsMouseEvent() )
         {
@@ -1651,7 +1651,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
             }
         }
     }
-    else if ( rCEvt.GetCommand() == COMMAND_WHEEL )
+    else if ( rCEvt.GetCommand() == CommandEventId::Wheel )
     {
         const CommandWheelData* pData = rCEvt.GetWheelData();
         if ( pData->GetMode() == CommandWheelMode::SCROLL )
diff --git a/svtools/source/control/fmtfield.cxx 
b/svtools/source/control/fmtfield.cxx
index 3ba6477..0b09fb3 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -777,7 +777,7 @@ bool FormattedField::Notify(NotifyEvent& rNEvt)
     if ((rNEvt.GetType() == MouseNotifyEvent::COMMAND) && !IsReadOnly())
     {
         const CommandEvent* pCommand = rNEvt.GetCommandEvent();
-        if (pCommand->GetCommand() == COMMAND_WHEEL)
+        if (pCommand->GetCommand() == CommandEventId::Wheel)
         {
             const CommandWheelData* pData = 
rNEvt.GetCommandEvent()->GetWheelData();
             if ((pData->GetMode() == CommandWheelMode::SCROLL) && 
ImplGetFormatter()->IsTextFormat(m_nFormatKey))
diff --git a/svtools/source/control/headbar.cxx 
b/svtools/source/control/headbar.cxx
index 90f0781..6d4be8b 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -1018,7 +1018,7 @@ void HeaderBar::Resize()
 
 void HeaderBar::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.IsMouseEvent() && (rCEvt.GetCommand() == COMMAND_STARTDRAG) && 
!mbDrag )
+    if ( rCEvt.IsMouseEvent() && (rCEvt.GetCommand() == 
CommandEventId::StartDrag) && !mbDrag )
     {
         ImplStartDrag( rCEvt.GetMousePosPixel(), true );
         return;
diff --git a/svtools/source/control/scrwin.cxx 
b/svtools/source/control/scrwin.cxx
index 9bac310..3f716b0 100644
--- a/svtools/source/control/scrwin.cxx
+++ b/svtools/source/control/scrwin.cxx
@@ -67,9 +67,9 @@ void ScrollableWindow::dispose()
 
 void ScrollableWindow::Command( const CommandEvent& rCEvt )
 {
-    if ( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
-         (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
-         (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) )
+    if ( (rCEvt.GetCommand() == CommandEventId::Wheel) ||
+         (rCEvt.GetCommand() == CommandEventId::StartAutoScroll) ||
+         (rCEvt.GetCommand() == CommandEventId::AutoScroll) )
     {
         ScrollBar* pHScrBar;
         ScrollBar* pVScrBar;
diff --git a/svtools/source/control/tabbar.cxx 
b/svtools/source/control/tabbar.cxx
index ae62dc1..f65b725 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -303,8 +303,7 @@ void ImplTabButton::MouseButtonUp(const MouseEvent& 
rMouseEvent)
 
 void ImplTabButton::Command(const CommandEvent& rCommandEvent)
 {
-    sal_uInt16 nCommand = rCommandEvent.GetCommand();
-    if (nCommand == COMMAND_CONTEXTMENU)
+    if (rCommandEvent.GetCommand() == CommandEventId::ContextMenu)
     {
         TabBar* pParent = GetParent();
         pParent->maScrollAreaContextHdl.Call((void*)&rCommandEvent);
@@ -1417,7 +1416,7 @@ bool TabBar::PreNotify( NotifyEvent& rNEvt )
 {
     if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
     {
-        if (rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL)
+        if (rNEvt.GetCommandEvent()->GetCommand() == CommandEventId::Wheel)
         {
             const CommandWheelData* pData = 
rNEvt.GetCommandEvent()->GetWheelData();
             sal_uInt16 nNewPos = mnFirstPos;
@@ -2344,7 +2343,7 @@ OString TabBar::GetHelpId( sal_uInt16 nPageId ) const
 
 bool TabBar::StartDrag( const CommandEvent& rCEvt, vcl::Region& rRegion )
 {
-    if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) )
+    if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != 
CommandEventId::StartDrag) )
         return false;
 
     // Check if the clicked page was selected. If this is not the case
diff --git a/svtools/source/control/toolbarmenu.cxx 
b/svtools/source/control/toolbarmenu.cxx
index 4e20373..adc60bb 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -1535,7 +1535,7 @@ void ToolbarMenu::DataChanged( const DataChangedEvent& 
rDCEvt )
 
 void ToolbarMenu::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_WHEEL )
+    if ( rCEvt.GetCommand() == CommandEventId::Wheel )
     {
         const CommandWheelData* pData = rCEvt.GetWheelData();
         if( !pData->GetModifier() && ( pData->GetMode() == 
CommandWheelMode::SCROLL ) )
diff --git a/svtools/source/control/valueset.cxx 
b/svtools/source/control/valueset.cxx
index 8d36028..28bee35 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -1410,9 +1410,9 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent )
 
 void ValueSet::Command( const CommandEvent& rCommandEvent )
 {
-    if ( rCommandEvent.GetCommand() == COMMAND_WHEEL ||
-         rCommandEvent.GetCommand() == COMMAND_STARTAUTOSCROLL ||
-         rCommandEvent.GetCommand() == COMMAND_AUTOSCROLL )
+    if ( rCommandEvent.GetCommand() == CommandEventId::Wheel ||
+         rCommandEvent.GetCommand() == CommandEventId::StartAutoScroll ||
+         rCommandEvent.GetCommand() == CommandEventId::AutoScroll )
     {
         if ( HandleScrollCommand( rCommandEvent, NULL, mxScrollBar.get() ) )
             return;
@@ -2119,7 +2119,7 @@ void ValueSet::SetFormat(bool bFormat)
 
 bool ValueSet::StartDrag( const CommandEvent& rEvent, vcl::Region& rRegion )
 {
-    if ( rEvent.GetCommand() != COMMAND_STARTDRAG )
+    if ( rEvent.GetCommand() != CommandEventId::StartDrag )
         return false;
 
     // if necessary abort an existing action
diff --git a/svtools/source/table/tabledatawindow.cxx 
b/svtools/source/table/tabledatawindow.cxx
index 8691b32..5170993 100644
--- a/svtools/source/table/tabledatawindow.cxx
+++ b/svtools/source/table/tabledatawindow.cxx
@@ -201,7 +201,7 @@ namespace svt { namespace table
         if ( rNEvt.GetType() == MouseNotifyEvent::COMMAND )
         {
             const CommandEvent& rCEvt = *rNEvt.GetCommandEvent();
-            if ( rCEvt.GetCommand() == COMMAND_WHEEL )
+            if ( rCEvt.GetCommand() == CommandEventId::Wheel )
             {
                 const CommandWheelData* pData = rCEvt.GetWheelData();
                 if( !pData->GetModifier() && ( pData->GetMode() == 
CommandWheelMode::SCROLL ) )
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index 3ae8137..43304c4 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -474,7 +474,7 @@ void IMapWindow::Command(const CommandEvent& rCEvt)
 {
     vcl::Region  aRegion;
 
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         PopupMenu           aMenu( SVX_RES( RID_SVXMN_IMAP ) );
         const SdrMarkList&  rMarkList = pView->GetMarkedObjectList();
diff --git a/svx/source/dialog/svxruler.cxx b/svx/source/dialog/svxruler.cxx
index 87aa43c..5f3f1b4 100644
--- a/svx/source/dialog/svxruler.cxx
+++ b/svx/source/dialog/svxruler.cxx
@@ -3453,7 +3453,7 @@ IMPL_LINK( SvxRuler, TabMenuSelect, Menu *, pMenu )
 void SvxRuler::Command( const CommandEvent& rCommandEvent )
 {
     /* Mouse context menu for switching the unit of measurement */
-    if ( COMMAND_CONTEXTMENU == rCommandEvent.GetCommand() )
+    if ( CommandEventId::ContextMenu == rCommandEvent.GetCommand() )
     {
         CancelDrag();
         bool bRTL = mxRulerImpl->pTextRTLItem && 
mxRulerImpl->pTextRTLItem->GetValue();
diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx
index 0565829..71290f0 100644
--- a/svx/source/fmcomp/fmgridcl.cxx
+++ b/svx/source/fmcomp/fmgridcl.cxx
@@ -993,7 +993,7 @@ void FmGridHeader::Command(const CommandEvent& rEvt)
 {
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             if (!rEvt.IsMouseEvent())
                 return;
@@ -1023,7 +1023,7 @@ FmGridControl::FmGridControl(
 
 void FmGridControl::Command(const CommandEvent& _rEvt)
 {
-    if ( COMMAND_CONTEXTMENU == _rEvt.GetCommand() )
+    if ( CommandEventId::ContextMenu == _rEvt.GetCommand() )
     {
         FmGridHeader* pMyHeader = static_cast< FmGridHeader* >( GetHeaderBar() 
);
         if ( pMyHeader && !_rEvt.IsMouseEvent() )
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index da23bfd..7c9b026 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2794,7 +2794,7 @@ void DbGridControl::Command(const CommandEvent& rEvt)
 {
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             if ( !m_pSeekCursor )
             {
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 906a6ff..405cae0 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -1614,7 +1614,7 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt 
)
     bool bHandled = false;
     switch (rEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             // die Stelle, an der geklickt wurde
             Point aWhere;
@@ -1704,7 +1704,9 @@ void FmFilterNavigator::Command( const CommandEvent& rEvt 
)
                 }   break;
             }
             bHandled = true;
-        } break;
+        }
+        break;
+        default: break;
     }
 
     if (!bHandled)
diff --git a/svx/source/form/navigatortree.cxx 
b/svx/source/form/navigatortree.cxx
index 7da8943..9003b25 100644
--- a/svx/source/form/navigatortree.cxx
+++ b/svx/source/form/navigatortree.cxx
@@ -312,7 +312,7 @@ namespace svxform
         bool bHandled = false;
         switch( rEvt.GetCommand() )
         {
-            case COMMAND_CONTEXTMENU:
+            case CommandEventId::ContextMenu:
             {
                 // Position of click
                 ::Point ptWhere;
@@ -526,7 +526,9 @@ namespace svxform
                     }
                 }
                 bHandled = true;
-            } break;
+            }
+            break;
+            default: break;
         }
 
         if (!bHandled)
diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx
index d3c9e30..854ce84 100644
--- a/svx/source/gallery2/galbrws1.cxx
+++ b/svx/source/gallery2/galbrws1.cxx
@@ -88,7 +88,7 @@ bool GalleryThemeListBox::PreNotify( NotifyEvent& rNEvt )
     {
         const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
 
-        if( pCEvt && pCEvt->GetCommand() == COMMAND_CONTEXTMENU )
+        if( pCEvt && pCEvt->GetCommand() == CommandEventId::ContextMenu )
             static_cast< GalleryBrowser1* >( GetParent() )->ShowContextMenu();
     }
     else if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx
index a9bc302..90e0f1a 100644
--- a/svx/source/gallery2/galctrl.cxx
+++ b/svx/source/gallery2/galctrl.cxx
@@ -157,7 +157,7 @@ void GalleryPreview::Command(const CommandEvent& rCEvt )
 {
     Window::Command( rCEvt );
 
-    if( mpTheme && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ) )
+    if( mpTheme && ( rCEvt.GetCommand() == CommandEventId::ContextMenu ) )
         static_cast<GalleryBrowser2*>( GetParent() )->ShowContextMenu( this,
             ( rCEvt.IsMouseEvent() ? &rCEvt.GetMousePosPixel() : NULL ) );
 }
@@ -378,7 +378,7 @@ void GalleryIconView::Command( const CommandEvent& rCEvt )
 {
     ValueSet::Command( rCEvt );
 
-    if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         static_cast<GalleryBrowser2*>( GetParent() )->ShowContextMenu( this,
             ( rCEvt.IsMouseEvent() ? &rCEvt.GetMousePosPixel() : NULL ) );
@@ -403,7 +403,7 @@ sal_Int8 GalleryIconView::ExecuteDrop( const 
ExecuteDropEvent& rEvt )
 
 void GalleryIconView::StartDrag( sal_Int8, const Point& )
 {
-    const CommandEvent  aEvt( GetPointerPosPixel(), COMMAND_STARTDRAG, true );
+    const CommandEvent  aEvt( GetPointerPosPixel(), CommandEventId::StartDrag, 
true );
     vcl::Region              aRegion;
 
     // call this to initiate dragging for ValueSet
@@ -558,7 +558,7 @@ void GalleryListView::Command( const CommandEvent& rCEvt )
 {
     BrowseBox::Command( rCEvt );
 
-    if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         const Point* pPos = NULL;
 
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index e102a7f..d4acca7 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -310,7 +310,7 @@ void SvxPosSizeStatusBarControl::StateChanged( sal_uInt16 
nSID, SfxItemState eSt
 
 void SvxPosSizeStatusBarControl::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU && pImp->bHasMenu )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu && pImp->bHasMenu )
     {
         sal_uInt16 nSelect = pImp->nFunction;
         if (!nSelect)
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx 
b/svx/source/stbctrls/xmlsecctrl.cxx
index 8ae7cb8..325bb00 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -119,7 +119,7 @@ void XmlSecStatusBarControl::StateChanged( sal_uInt16, 
SfxItemState eState, cons
 
 void XmlSecStatusBarControl::Command( const CommandEvent& rCEvt )
 {
-    if( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         PopupMenu aPopupMenu( ResId( RID_SVXMNU_XMLSECSTATBAR, DIALOG_MGR() ) 
);
         if( aPopupMenu.Execute( &GetStatusBar(), rCEvt.GetMousePosPixel() ) )
diff --git a/svx/source/stbctrls/zoomctrl.cxx b/svx/source/stbctrls/zoomctrl.cxx
index d5b9ad3..bbec902 100644
--- a/svx/source/stbctrls/zoomctrl.cxx
+++ b/svx/source/stbctrls/zoomctrl.cxx
@@ -142,7 +142,7 @@ void SvxZoomStatusBarControl::Paint( const UserDrawEvent& )
 
 void SvxZoomStatusBarControl::Command( const CommandEvent& rCEvt )
 {
-    if ( COMMAND_CONTEXTMENU & rCEvt.GetCommand() && bool(nValueSet) )
+    if ( CommandEventId::ContextMenu == rCEvt.GetCommand() && bool(nValueSet) )
     {
         ZoomPopup_Impl aPop( nZoom, nValueSet );
         StatusBar& rStatusbar = GetStatusBar();
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 6c116cf..b271261 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1317,10 +1317,10 @@ bool SdrObjEditView::MouseMove(const MouseEvent& rMEvt, 
vcl::Window* pWin)
 
 bool SdrObjEditView::Command(const CommandEvent& rCEvt, vcl::Window* pWin)
 {
-    // as long as OutlinerView returns a sal_Bool, it only gets 
COMMAND_STARTDRAG
+    // as long as OutlinerView returns a sal_Bool, it only gets 
CommandEventId::StartDrag
     if (pTextEditOutlinerView!=NULL)
     {
-        if (rCEvt.GetCommand()==COMMAND_STARTDRAG) {
+        if (rCEvt.GetCommand()==CommandEventId::StartDrag) {
             bool bPostIt=pTextEditOutliner->IsInSelectionMode() || 
!rCEvt.IsMouseEvent();
             if (!bPostIt && rCEvt.IsMouseEvent()) {
                 Point aPt(rCEvt.GetMousePosPixel());
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx 
b/sw/source/ui/dbui/createaddresslistdialog.cxx
index ff9455e..193e55b 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -329,9 +329,9 @@ void SwAddressControl_Impl::Command( const CommandEvent& 
rCEvt )
 {
     switch ( rCEvt.GetCommand() )
     {
-        case COMMAND_WHEEL:
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::Wheel:
+        case CommandEventId::StartAutoScroll:
+        case CommandEventId::AutoScroll:
         {
             const CommandWheelData* pWheelData = rCEvt.GetWheelData();
             if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM 
!= pWheelData->GetMode())
@@ -350,8 +350,7 @@ bool SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt )
     if(rNEvt.GetType() == MouseNotifyEvent::COMMAND)
     {
         const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
-        const sal_uInt16 nCmd = pCEvt->GetCommand();
-        if( COMMAND_WHEEL == nCmd )
+        if( pCEvt->GetCommand() == CommandEventId::Wheel )
         {
             Command(*pCEvt);
             return true;
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx 
b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 152df21..35214f5 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1052,9 +1052,9 @@ void SwAssignFieldsControl::Command( const CommandEvent& 
rCEvt )
 {
     switch ( rCEvt.GetCommand() )
     {
-        case COMMAND_WHEEL:
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::Wheel:
+        case CommandEventId::StartAutoScroll:
+        case CommandEventId::AutoScroll:
         {
             const CommandWheelData* pWheelData = rCEvt.GetWheelData();
             if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM 
!= pWheelData->GetMode())
@@ -1073,8 +1073,7 @@ bool SwAssignFieldsControl::PreNotify( NotifyEvent& rNEvt 
)
     if(rNEvt.GetType() == MouseNotifyEvent::COMMAND)
     {
         const CommandEvent* pCEvt = rNEvt.GetCommandEvent();
-        const sal_uInt16 nCmd = pCEvt->GetCommand();
-        if( COMMAND_WHEEL == nCmd )
+        if( pCEvt->GetCommand() == CommandEventId::Wheel )
         {
             Command(*pCEvt);
             return true;
diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx 
b/sw/source/uibase/docvw/SidebarTxtControl.cxx
index 96ccdfe..5807f27 100644
--- a/sw/source/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx
@@ -342,7 +342,7 @@ IMPL_LINK( SidebarTxtControl, Select, Menu*, pSelMenu )
 
 void SidebarTxtControl::Command( const CommandEvent& rCEvt )
 {
-    if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+    if ( rCEvt.GetCommand() == CommandEventId::ContextMenu )
     {
         if ( !mrSidebarWin.IsProtected() &&
              GetTextView() &&
@@ -380,7 +380,7 @@ void SidebarTxtControl::Command( const CommandEvent& rCEvt )
         }
     }
     else
-    if (rCEvt.GetCommand() == COMMAND_WHEEL)
+    if (rCEvt.GetCommand() == CommandEventId::Wheel)
     {
         if (mrSidebarWin.IsScrollbarVisible())
         {
diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx
index 72dea94..e0dd4aa 100644
--- a/sw/source/uibase/docvw/edtdd.cxx
+++ b/sw/source/uibase/docvw/edtdd.cxx
@@ -71,7 +71,7 @@ void SwEditWin::StartDrag( sal_Int8 /*nAction*/, const Point& 
rPosPixel )
     SwWrtShell &rSh = m_rView.GetWrtShell();
     if( rSh.GetDrawView() )
     {
-        CommandEvent aDragEvent( rPosPixel, COMMAND_STARTDRAG, true );
+        CommandEvent aDragEvent( rPosPixel, CommandEventId::StartDrag, true );
         if( rSh.GetDrawView()->Command( aDragEvent, this ) )
         {
             m_rView.GetViewFrame()->GetBindings().InvalidateAll(false);
diff --git a/sw/source/uibase/docvw/edtwin.cxx 
b/sw/source/uibase/docvw/edtwin.cxx
index ed45693..a0475d6 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -5109,7 +5109,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
     // windows and code on the stack.
     SfxInPlaceClient* pIPClient = rSh.GetSfxViewShell()->GetIPClient();
     bool bIsOleActive = ( pIPClient && pIPClient->IsObjectInPlaceActive() );
-    if ( bIsOleActive && ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU ))
+    if ( bIsOleActive && ( rCEvt.GetCommand() == CommandEventId::ContextMenu ))
     {
         rSh.FinishOLEObj();
         return;
@@ -5119,8 +5119,8 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
 
     switch ( rCEvt.GetCommand() )
     {
-        case COMMAND_CONTEXTMENU:
-        {
+    case CommandEventId::ContextMenu:
+    {
             const sal_uInt16 nId = SwInputChild::GetChildWindowId();
             SwInputChild* pChildWin = 
static_cast<SwInputChild*>(GetView().GetViewFrame()->
                                                 GetChildWindow( nId ));
@@ -5193,18 +5193,18 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
                     rSh.Do(SwWrtShell::UNDO);
                 bCallBase = false;
             }
-        }
-        break;
+    }
+    break;
 
-        case COMMAND_WHEEL:
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+    case CommandEventId::Wheel:
+    case CommandEventId::StartAutoScroll:
+    case CommandEventId::AutoScroll:
             if( m_pShadCrsr )
                 delete m_pShadCrsr, m_pShadCrsr = 0;
             bCallBase = !m_rView.HandleWheelCommands( rCEvt );
             break;
 
-    case COMMAND_STARTEXTTEXTINPUT:
+    case CommandEventId::StartExtTextInput:
     {
         bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly() &&
                               rSh.IsCrsrReadonly();
@@ -5227,7 +5227,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
         }
         break;
     }
-    case COMMAND_ENDEXTTEXTINPUT:
+    case CommandEventId::EndExtTextInput:
     {
         bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly() &&
                               rSh.IsCrsrReadonly();
@@ -5278,7 +5278,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
         }
     }
     break;
-    case COMMAND_EXTTEXTINPUT:
+    case CommandEventId::ExtTextInput:
     {
         bool bIsDocReadOnly = m_rView.GetDocShell()->IsReadOnly() &&
                               rSh.IsCrsrReadonly();
@@ -5323,11 +5323,11 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
         }
     }
     break;
-    case COMMAND_CURSORPOS:
+    case CommandEventId::CursorPos:
         // will be handled by the base class
         break;
 
-    case COMMAND_PASTESELECTION:
+    case CommandEventId::PasteSelection:
         if( !m_rView.GetDocShell()->IsReadOnly() )
         {
             TransferableDataHelper aDataHelper(
@@ -5357,7 +5357,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
             }
         }
         break;
-        case COMMAND_MODKEYCHANGE :
+        case CommandEventId::ModKeyChange :
         {
             const CommandModKeyData* pCommandData = rCEvt.GetModKeyData();
             if (pCommandData->IsMod1() && !pCommandData->IsMod2())
@@ -5372,15 +5372,15 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
             }
         }
         break;
-        case COMMAND_HANGUL_HANJA_CONVERSION :
+        case CommandEventId::HangulHanjaConversion :
             
GetView().GetViewFrame()->GetDispatcher()->Execute(SID_HANGUL_HANJA_CONVERSION);
         break;
-        case COMMAND_INPUTLANGUAGECHANGE :
+        case CommandEventId::InputLanguageChange :
             // i#42732 - update state of fontname if input language changes
             g_bInputLanguageSwitched = true;
             SetUseInputLanguage( true );
         break;
-        case COMMAND_SELECTIONCHANGE:
+        case CommandEventId::SelectionChange:
         {
             const CommandSelectionChangeData *pData = 
rCEvt.GetSelectionChangeData();
             rSh.SttCrsrMove();
@@ -5391,7 +5391,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
             rSh.EndCrsrMove( true );
         }
         break;
-        case COMMAND_PREPARERECONVERSION:
+        case CommandEventId::PrepareReconversion:
         if( rSh.HasSelection() )
         {
             SwPaM *pCrsr = rSh.GetCrsr();
@@ -5450,7 +5450,7 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
             }
         }
         break;
-        case COMMAND_QUERYCHARPOSITION:
+        case CommandEventId::QueryCharPosition:
         {
             bool bVertical = rSh.IsInVerticalText();
             const SwPosition& rPos = *rSh.GetCrsr()->GetPoint();
@@ -5492,10 +5492,11 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
             bCallBase = false;
         }
         break;
-#if OSL_DEBUG_LEVEL > 0
         default:
+#if OSL_DEBUG_LEVEL > 0
             OSL_ENSURE( false, "unknown command." );
 #endif
+        break;
     }
     if (bCallBase)
         Window::Command(rCEvt);
diff --git a/sw/source/uibase/docvw/srcedtw.cxx 
b/sw/source/uibase/docvw/srcedtw.cxx
index 695019e..12fe31c 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -417,12 +417,12 @@ void  TextViewOutWin::Command( const CommandEvent& rCEvt )
 {
     switch(rCEvt.GetCommand())
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
             SfxDispatcher::ExecutePopup();
         break;
-        case COMMAND_WHEEL:
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::Wheel:
+        case CommandEventId::StartAutoScroll:
+        case CommandEventId::AutoScroll:
         {
             const CommandWheelData* pWData = rCEvt.GetWheelData();
             if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
@@ -763,9 +763,9 @@ void SwSrcEditWindow::Command( const CommandEvent& rCEvt )
 {
     switch(rCEvt.GetCommand())
     {
-        case COMMAND_WHEEL:
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::Wheel:
+        case CommandEventId::StartAutoScroll:
+        case CommandEventId::AutoScroll:
         {
             const CommandWheelData* pWData = rCEvt.GetWheelData();
             if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
diff --git a/sw/source/uibase/misc/redlndlg.cxx 
b/sw/source/uibase/misc/redlndlg.cxx
index b8cac8b..fcefbb9 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -1026,7 +1026,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl)
 
     switch ( aCEvt.GetCommand() )
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
         {
             SwWrtShell* pSh = ::GetActiveView()->GetWrtShellPtr();
             SvTreeListEntry* pEntry = pTable->FirstSelected();
@@ -1183,6 +1183,7 @@ IMPL_LINK_NOARG(SwRedlineAcceptDlg, CommandHdl)
             }
         }
         break;
+        default: break;
     }
 
     return 0;
diff --git a/sw/source/uibase/uiview/pview.cxx 
b/sw/source/uibase/uiview/pview.cxx
index 3730260..04d43c4 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -458,14 +458,14 @@ void SwPagePreviewWin::Command( const CommandEvent& rCEvt 
)
     bool bCallBase = true;
     switch( rCEvt.GetCommand() )
     {
-        case COMMAND_CONTEXTMENU:
+        case CommandEventId::ContextMenu:
             SfxDispatcher::ExecutePopup();
             bCallBase = false;
         break;
 
-        case COMMAND_WHEEL:
-        case COMMAND_STARTAUTOSCROLL:
-        case COMMAND_AUTOSCROLL:
+        case CommandEventId::Wheel:
+        case CommandEventId::StartAutoScroll:
+        case CommandEventId::AutoScroll:
         {
             const CommandWheelData* pData = rCEvt.GetWheelData();
             if( pData )
diff --git a/sw/source/uibase/uiview/viewport.cxx 
b/sw/source/uibase/uiview/viewport.cxx
index d803103..1fa6a17 100644

... etc. - the rest is truncated
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to