diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-07 15:25:20 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-05-11 12:17:42 +0000 |
commit | 82d68f9cbce4073a727c43b4a8e81d39871b71eb (patch) | |
tree | 64b3a9e1092586afee46899adfd00070821613b8 /sd | |
parent | 19ea033f380aa196c9c868a3cdb43e967eb42abe (diff) |
convert COMMAND_ constants to scoped enum
Change-Id: I88e67f89dbbab0646e8f106dfeb32c6ee1bb0b95
Reviewed-on: https://gerrit.libreoffice.org/15671
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationList.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationtag.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/annotations/annotationwindow.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/tmplctrl.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/LayerTabBar.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/RemoteDialogClientBox.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/sidebar/LayoutMenu.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/sidebar/MasterPagesSelector.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlideSorterController.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/drviews4.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdruler.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/tabcontr.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 12 |
16 files changed, 29 insertions, 28 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index d840f0ab4db1..0f883707ac0e 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 440c7bf940fb..9a0c861f84ca 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 6ed8eb39dbf4..1b08e48aecd4 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 79d10ba494c4..47a6bc004336 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 494cd21d9d64..4e3ca3394fc2 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 934c5bbf89f9..500d78cbcfd0 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 8c74a7673499..4c8bcf9df530 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 31abab125e46..4c2ba8bb638e 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 055c28e5f292..2c522c16a4ab 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 4018cb143b3b..de631df21e24 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 81fe35a6ab9a..a8412772b79b 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 dc7a8fe99354..8e157e0ed122 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 59ada2769de4..c3382c85967a 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 95d4c6ca52a6..8c3c9b78fba7 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 908e3e570905..d66f3198575e 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 f5168b5f7b0b..b7b0694dc69a 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(); |