summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-10-31 07:26:39 +0200
committerNoel Grandin <noel@peralex.com>2014-10-31 07:28:06 +0200
commit72ce1368b504804529bbcdc14484e9abb2ffa398 (patch)
tree36381873f229041592c11ec8564edc60e0fc3ec3
parent7eb519e92b4b50546f222e8d0219b21af8e6ea18 (diff)
convert COMMAND_WHEEL constants to an enum
Change-Id: I413d821a984ab556bd19c52704c04de6d828f699
-rw-r--r--cui/source/options/optcolor.cxx2
-rw-r--r--dbaccess/source/ui/querydesign/JoinTableView.cxx2
-rw-r--r--desktop/source/deployment/gui/dp_gui_extlistbox.cxx2
-rw-r--r--include/vcl/cmdevt.hxx41
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx2
-rw-r--r--sc/source/ui/view/prevwsh.cxx2
-rw-r--r--sc/source/ui/view/tabview.cxx6
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.cxx2
-rw-r--r--sd/source/ui/view/viewshel.cxx2
-rw-r--r--sfx2/source/sidebar/Deck.cxx2
-rw-r--r--starmath/source/edit.cxx2
-rw-r--r--starmath/source/view.cxx2
-rw-r--r--svtools/source/contnr/imivctl1.cxx2
-rw-r--r--svtools/source/control/calendar.cxx2
-rw-r--r--svtools/source/control/fmtfield.cxx2
-rw-r--r--svtools/source/control/toolbarmenu.cxx2
-rw-r--r--svtools/source/table/tabledatawindow.cxx2
-rw-r--r--sw/source/ui/dbui/createaddresslistdialog.cxx2
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx2
-rw-r--r--sw/source/uibase/docvw/srcedtw.cxx4
-rw-r--r--sw/source/uibase/uiview/pview.cxx2
-rw-r--r--sw/source/uibase/uiview/viewport.cxx10
-rw-r--r--vcl/osx/salframeview.mm4
-rw-r--r--vcl/source/control/ilstbox.cxx4
-rw-r--r--vcl/source/control/spinfld.cxx2
-rw-r--r--vcl/source/window/layout.cxx2
-rw-r--r--vcl/source/window/menufloatingwindow.cxx2
-rw-r--r--vcl/source/window/openglwin.cxx2
-rw-r--r--vcl/source/window/toolbox.cxx2
-rw-r--r--vcl/source/window/window2.cxx2
-rw-r--r--vcl/source/window/winproc.cxx10
31 files changed, 66 insertions, 61 deletions
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index f7ca32156f85..67d0890aafce 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -958,7 +958,7 @@ void ColorConfigCtrl_Impl::Command( const CommandEvent& rCEvt )
case COMMAND_AUTOSCROLL:
{
const CommandWheelData* pWheelData = rCEvt.GetWheelData();
- if(pWheelData && !pWheelData->IsHorz() && COMMAND_WHEEL_ZOOM != pWheelData->GetMode())
+ if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM != pWheelData->GetMode())
{
HandleScrollCommand(rCEvt, 0, m_pVScroll);
}
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 46f0ddb961b6..2944efcb97a5 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1242,7 +1242,7 @@ bool OJoinTableView::PreNotify(NotifyEvent& rNEvt)
if (pCommand->GetCommand() == COMMAND_WHEEL)
{
const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if (pData->GetMode() == COMMAND_WHEEL_SCROLL)
+ if (pData->GetMode() == CommandWheelMode::SCROLL)
{
if (pData->GetDelta() > 0)
ScrollPane(-10 * pData->GetScrollLines(), pData->IsHorz(), true);
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index 4894fabecb82..e9732ee90462 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -897,7 +897,7 @@ bool ExtensionBox_Impl::Notify( NotifyEvent& rNEvt )
( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
{
const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ if ( pData->GetMode() == CommandWheelMode::SCROLL )
{
long nThumbPos = m_pScrollBar->GetThumbPos();
if ( pData->GetDelta() < 0 )
diff --git a/include/vcl/cmdevt.hxx b/include/vcl/cmdevt.hxx
index 95fbaa6db0ea..439e9692d9e4 100644
--- a/include/vcl/cmdevt.hxx
+++ b/include/vcl/cmdevt.hxx
@@ -108,40 +108,45 @@ inline CommandInputContextData::CommandInputContextData( LanguageType eLang )
// - CommandWheelData -
-#define COMMAND_WHEEL_SCROLL ((sal_uInt16)0x0001)
-#define COMMAND_WHEEL_ZOOM ((sal_uInt16)0x0002)
-#define COMMAND_WHEEL_ZOOM_SCALE ((sal_uInt16)0x0003)
-#define COMMAND_WHEEL_DATAZOOM ((sal_uInt16)0x0004)
+enum class CommandWheelMode
+{
+ NONE = 0,
+ SCROLL = 1,
+ ZOOM = 2,
+ ZOOM_SCALE = 3,
+ DATAZOOM = 4
+};
+// Magic value used in mnLines field in CommandWheelData
#define COMMAND_WHEEL_PAGESCROLL ((sal_uLong)0xFFFFFFFF)
class VCL_DLLPUBLIC CommandWheelData
{
private:
- long mnDelta;
- long mnNotchDelta;
- sal_uLong mnLines;
- sal_uInt16 mnMode;
- sal_uInt16 mnCode;
- bool mbHorz;
- bool mbDeltaIsPixel;
+ long mnDelta;
+ long mnNotchDelta;
+ sal_uLong mnLines;
+ CommandWheelMode mnWheelMode;
+ sal_uInt16 mnCode;
+ bool mbHorz;
+ bool mbDeltaIsPixel;
public:
CommandWheelData();
CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
sal_uLong nScrollLines,
- sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ CommandWheelMode nWheelMode, sal_uInt16 nKeyModifier,
bool bHorz = false, bool bDeltaIsPixel = false );
long GetDelta() const { return mnDelta; }
long GetNotchDelta() const { return mnNotchDelta; }
- sal_uLong GetScrollLines() const { return mnLines; }
+ sal_uLong GetScrollLines() const { return mnLines; }
bool IsHorz() const { return mbHorz; }
bool IsDeltaPixel() const { return mbDeltaIsPixel; }
- sal_uInt16 GetMode() const { return mnMode; }
+ CommandWheelMode GetMode() const { return mnWheelMode; }
- sal_uInt16 GetModifier() const
+ sal_uInt16 GetModifier() const
{ return (mnCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2)); }
bool IsShift() const
{ return ((mnCode & KEY_SHIFT) != 0); }
@@ -158,7 +163,7 @@ inline CommandWheelData::CommandWheelData()
mnDelta = 0;
mnNotchDelta = 0;
mnLines = 0;
- mnMode = 0;
+ mnWheelMode = CommandWheelMode::NONE;
mnCode = 0;
mbHorz = false;
mbDeltaIsPixel = false;
@@ -166,13 +171,13 @@ inline CommandWheelData::CommandWheelData()
inline CommandWheelData::CommandWheelData( long nWheelDelta, long nWheelNotchDelta,
sal_uLong nScrollLines,
- sal_uInt16 nWheelMode, sal_uInt16 nKeyModifier,
+ CommandWheelMode nWheelMode, sal_uInt16 nKeyModifier,
bool bHorz, bool bDeltaIsPixel )
{
mnDelta = nWheelDelta;
mnNotchDelta = nWheelNotchDelta;
mnLines = nScrollLines;
- mnMode = nWheelMode;
+ mnWheelMode = nWheelMode;
mnCode = nKeyModifier;
mbHorz = bHorz;
mbDeltaIsPixel = bDeltaIsPixel;
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index b478f679049c..37a8f1e20ef4 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -970,7 +970,7 @@ void ScCsvGrid::Command( const CommandEvent& rCEvt )
if( aRect.IsInside( rCEvt.GetMousePosPixel() ) )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( pData && (pData->GetMode() == COMMAND_WHEEL_SCROLL) && !pData->IsHorz() )
+ if( pData && (pData->GetMode() == CommandWheelMode::SCROLL) && !pData->IsHorz() )
Execute( CSVCMD_SETLINEOFFSET, GetFirstVisLine() - pData->GetNotchDelta() );
}
}
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 12ec7d032f8e..babb226712e9 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -496,7 +496,7 @@ bool ScPreviewShell::ScrollCommand( const CommandEvent& rCEvt )
{
bool bDone = false;
const CommandWheelData* pData = rCEvt.GetWheelData();
- if ( pData && pData->GetMode() == COMMAND_WHEEL_ZOOM )
+ if ( pData && pData->GetMode() == CommandWheelMode::ZOOM )
{
long nOld = pPreview->GetZoom();
long nNew = nOld;
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 9150af64bee9..fe56acdbef19 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -916,8 +916,8 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
bool bDone = false;
const CommandWheelData* pData = rCEvt.GetWheelData();
- if ( pData && (pData->GetMode() == COMMAND_WHEEL_ZOOM ||
- pData->GetMode() == COMMAND_WHEEL_ZOOM_SCALE ) )
+ if ( pData && (pData->GetMode() == CommandWheelMode::ZOOM ||
+ pData->GetMode() == CommandWheelMode::ZOOM_SCALE ) )
{
if ( !aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace() )
{
@@ -927,7 +927,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos )
const Fraction& rOldY = aViewData.GetZoomY();
long nOld = (long)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator());
long nNew = nOld;
- if ( pData->GetMode() == COMMAND_WHEEL_ZOOM_SCALE )
+ if ( pData->GetMode() == CommandWheelMode::ZOOM_SCALE )
{
nNew = 100 * (long) ((nOld / 100.0) * (pData->GetDelta() / 100.0));
} else
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index 2585668bb4b1..cd99a249a879 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -613,7 +613,7 @@ bool ClientBox::Notify( NotifyEvent& rNEvt )
( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
{
const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ if ( pData->GetMode() == CommandWheelMode::SCROLL )
{
long nThumbPos = m_aScrollBar.GetThumbPos();
if ( pData->GetDelta() < 0 )
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index 52bff55c0f5a..bdc695907dfe 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -619,7 +619,7 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi
{
// We ignore zooming with control+mouse wheel.
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( pData && !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) && !pData->IsHorz() )
+ if( pData && !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) && !pData->IsHorz() )
{
long nDelta = pData->GetDelta();
if( nDelta > 0 )
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index f294a1a1644b..6e2f3919ffc1 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -219,7 +219,7 @@ bool Deck::ProcessWheelEvent(CommandEvent* pCommandEvent)
const CommandWheelData* pData = pCommandEvent->GetWheelData();
if (pData==NULL
|| pData->GetModifier()
- || pData->GetMode() != COMMAND_WHEEL_SCROLL
+ || pData->GetMode() != CommandWheelMode::SCROLL
|| pData->IsHorz())
return false;
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index f7a751a7b743..672a7757eca5 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -382,7 +382,7 @@ bool SmEditWindow::HandleWheelCommands( const CommandEvent &rCEvt )
const CommandWheelData* pWData = rCEvt.GetWheelData();
if (pWData)
{
- if (COMMAND_WHEEL_ZOOM == pWData->GetMode())
+ if (CommandWheelMode::ZOOM == pWData->GetMode())
bCommandHandled = true; // no zooming in Command window
else
bCommandHandled = HandleScrollCommand( rCEvt, pHScrollBar, pVScrollBar);
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx
index e77f20933cc1..5cdc2103e237 100644
--- a/starmath/source/view.cxx
+++ b/starmath/source/view.cxx
@@ -581,7 +581,7 @@ void SmGraphicWindow::Command(const CommandEvent& rCEvt)
case COMMAND_WHEEL:
{
const CommandWheelData* pWData = rCEvt.GetWheelData();
- if ( pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode() )
+ if ( pWData && CommandWheelMode::ZOOM == pWData->GetMode() )
{
sal_uInt16 nTmpZoom = GetZoom();
if( 0L > pWData->GetDelta() )
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index 671fc676243a..bee601135c16 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -2294,7 +2294,7 @@ bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd )
case COMMAND_WHEEL:
{
const CommandWheelData* pData = rCmd.GetWheelData();
- if( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) && !pData->IsHorz() )
+ if( pData && (CommandWheelMode::SCROLL == pData->GetMode()) && !pData->IsHorz() )
{
sal_uLong nScrollLines = pData->GetScrollLines();
if( nScrollLines == COMMAND_WHEEL_PAGESCROLL )
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index 348f9d741289..acb7b0299ed7 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -1726,7 +1726,7 @@ void Calendar::Command( const CommandEvent& rCEvt )
else if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ if ( pData->GetMode() == CommandWheelMode::SCROLL )
{
long nNotchDelta = pData->GetNotchDelta();
if ( nNotchDelta < 0 )
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
index edb8ad31aac5..c000833db7a1 100644
--- a/svtools/source/control/fmtfield.cxx
+++ b/svtools/source/control/fmtfield.cxx
@@ -788,7 +788,7 @@ bool FormattedField::Notify(NotifyEvent& rNEvt)
if (pCommand->GetCommand() == COMMAND_WHEEL)
{
const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if ((pData->GetMode() == COMMAND_WHEEL_SCROLL) && ImplGetFormatter()->IsTextFormat(m_nFormatKey))
+ if ((pData->GetMode() == CommandWheelMode::SCROLL) && ImplGetFormatter()->IsTextFormat(m_nFormatKey))
{
// same as above : prevent the base class from doing Up/Down-calls
// (normally I should put this test into the Up/Down methods itself, shouldn't I ?)
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index d59603a4a959..6e9daefb22b1 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -1542,7 +1542,7 @@ void ToolbarMenu::Command( const CommandEvent& rCEvt )
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
+ if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{
implCursorUpDown( pData->GetDelta() > 0L, false );
}
diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx
index 2d6e8373cf6d..5bb9fb1fe2b2 100644
--- a/svtools/source/table/tabledatawindow.cxx
+++ b/svtools/source/table/tabledatawindow.cxx
@@ -219,7 +219,7 @@ namespace svt { namespace table
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
+ if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{
nDone = HandleScrollCommand( rCEvt, m_rTableControl.getHorzScrollbar(), m_rTableControl.getVertScrollbar() );
}
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx
index 9b72fd4ef8d1..86aba605789b 100644
--- a/sw/source/ui/dbui/createaddresslistdialog.cxx
+++ b/sw/source/ui/dbui/createaddresslistdialog.cxx
@@ -330,7 +330,7 @@ void SwAddressControl_Impl::Command( const CommandEvent& rCEvt )
case COMMAND_AUTOSCROLL:
{
const CommandWheelData* pWheelData = rCEvt.GetWheelData();
- if(pWheelData && !pWheelData->IsHorz() && COMMAND_WHEEL_ZOOM != pWheelData->GetMode())
+ if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM != pWheelData->GetMode())
{
HandleScrollCommand( rCEvt, 0, m_pScrollBar );
}
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 0da4e9694aa9..42530be1dea5 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -986,7 +986,7 @@ void SwAssignFieldsControl::Command( const CommandEvent& rCEvt )
case COMMAND_AUTOSCROLL:
{
const CommandWheelData* pWheelData = rCEvt.GetWheelData();
- if(pWheelData && !pWheelData->IsHorz() && COMMAND_WHEEL_ZOOM != pWheelData->GetMode())
+ if(pWheelData && !pWheelData->IsHorz() && CommandWheelMode::ZOOM != pWheelData->GetMode())
{
HandleScrollCommand( rCEvt, 0, &m_aVScroll );
}
diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx
index fc2a2daef1ad..39e51cce24de 100644
--- a/sw/source/uibase/docvw/srcedtw.cxx
+++ b/sw/source/uibase/docvw/srcedtw.cxx
@@ -419,7 +419,7 @@ void TextViewOutWin::Command( const CommandEvent& rCEvt )
case COMMAND_AUTOSCROLL:
{
const CommandWheelData* pWData = rCEvt.GetWheelData();
- if( !pWData || COMMAND_WHEEL_ZOOM != pWData->GetMode() )
+ if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
{
((SwSrcEditWindow*)GetParent())->HandleWheelCommand( rCEvt );
}
@@ -766,7 +766,7 @@ void SwSrcEditWindow::Command( const CommandEvent& rCEvt )
case COMMAND_AUTOSCROLL:
{
const CommandWheelData* pWData = rCEvt.GetWheelData();
- if( !pWData || COMMAND_WHEEL_ZOOM != pWData->GetMode() )
+ if( !pWData || CommandWheelMode::ZOOM != pWData->GetMode() )
HandleScrollCommand( rCEvt, pHScrollbar, pVScrollbar );
}
break;
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx
index 476307952304..9375cb18763c 100644
--- a/sw/source/uibase/uiview/pview.cxx
+++ b/sw/source/uibase/uiview/pview.cxx
@@ -1780,7 +1780,7 @@ bool SwPagePreview::HandleWheelCommands( const CommandEvent& rCEvt )
{
bool bOk = false;
const CommandWheelData* pWData = rCEvt.GetWheelData();
- if( pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode() )
+ if( pWData && CommandWheelMode::ZOOM == pWData->GetMode() )
{
//only the Preference shouldn't control the Zoom, it is better to detect AT tools running. So the bridge can be used here
if (!Application::GetSettings().GetMiscSettings().GetEnableATToolSupport())
diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx
index 3528c8315592..c7509b926a67 100644
--- a/sw/source/uibase/uiview/viewport.cxx
+++ b/sw/source/uibase/uiview/viewport.cxx
@@ -1194,7 +1194,7 @@ bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
{
bool bOk = false;
const CommandWheelData* pWData = rCEvt.GetWheelData();
- if (pWData && COMMAND_WHEEL_ZOOM == pWData->GetMode())
+ if (pWData && CommandWheelMode::ZOOM == pWData->GetMode())
{
long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
if( 0L > pWData->GetDelta() )
@@ -1205,7 +1205,7 @@ bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
SetZoom( SVX_ZOOM_PERCENT, nFact );
bOk = true;
}
- else if (pWData && COMMAND_WHEEL_ZOOM_SCALE == pWData->GetMode())
+ else if (pWData && CommandWheelMode::ZOOM_SCALE == pWData->GetMode())
{
// mobile touch zoom (pinch) section
// remember the center location to reach in logic
@@ -1240,7 +1240,7 @@ bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
// scrolling the deltaX deltaY
Point deltaPoint( deltaX, deltaY );
- CommandWheelData cmd( 0, 0, 0, COMMAND_WHEEL_SCROLL, 0, false, true);
+ CommandWheelData cmd( 0, 0, 0, CommandWheelMode::SCROLL, 0, false, true);
CommandEvent event(deltaPoint , COMMAND_WHEEL, true, &cmd );
m_pEditWin->HandleScrollCommand(event, m_pHScrollbar, m_pVScrollbar);
}
@@ -1249,13 +1249,13 @@ bool SwView::HandleWheelCommands( const CommandEvent& rCEvt )
}
else
{
- if (pWData && pWData->GetMode()==COMMAND_WHEEL_SCROLL)
+ if (pWData && pWData->GetMode()==CommandWheelMode::SCROLL)
{
// This influences whether quick help is shown
m_bWheelScrollInProgress=true;
}
- if (pWData && (COMMAND_WHEEL_SCROLL==pWData->GetMode()) &&
+ if (pWData && (CommandWheelMode::SCROLL==pWData->GetMode()) &&
(COMMAND_WHEEL_PAGESCROLL == pWData->GetScrollLines()))
{
if (pWData->GetDelta()<0)
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 74404365eb67..98f3dadf1d80 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -758,14 +758,14 @@ private:
mfMagnifyDeltaSum += [pEvent magnification];
mfLastMagnifyTime = [pEvent timestamp];
-// TODO: change to 0.1 when COMMAND_WHEEL_ZOOM handlers allow finer zooming control
+// TODO: change to 0.1 when CommandWheelMode::ZOOM handlers allow finer zooming control
static const float fMagnifyFactor = 0.25*500; // steps are 500 times smaller for -magnification
static const float fMinMagnifyStep = 15.0 / fMagnifyFactor;
if( fabs(mfMagnifyDeltaSum) <= fMinMagnifyStep )
return;
// adapt NSEvent-sensitivity to application expectations
- // TODO: rather make COMMAND_WHEEL_ZOOM handlers smarter
+ // TODO: rather make CommandWheelMode::ZOOM handlers smarter
const float fDeltaZ = mfMagnifyDeltaSum * fMagnifyFactor;
int nDeltaZ = FRound( fDeltaZ );
if( !nDeltaZ )
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 228d3b6b0e88..5dea2fdf416d 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2500,7 +2500,7 @@ bool ImplListBox::Notify( NotifyEvent& rNEvt )
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
+ if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{
nDone = HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar );
}
@@ -2521,7 +2521,7 @@ bool ImplListBox::HandleWheelAsCursorTravel( const CommandEvent& rCEvt )
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
+ if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{
sal_uInt16 nKey = ( pData->GetDelta() < 0 ) ? KEY_DOWN : KEY_UP;
KeyEvent aKeyEvent( 0, vcl::KeyCode( nKey ) );
diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx
index 8bbdbb9e14d7..97e6633a7dbf 100644
--- a/vcl/source/control/spinfld.cxx
+++ b/vcl/source/control/spinfld.cxx
@@ -563,7 +563,7 @@ bool SpinField::Notify( NotifyEvent& rNEvt )
)
{
const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
- if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ if ( pData->GetMode() == CommandWheelMode::SCROLL )
{
if ( pData->GetDelta() < 0L )
Down();
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 9d4b1672cd83..590525fe3b4d 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1809,7 +1809,7 @@ bool VclScrolledWindow::Notify(NotifyEvent& rNEvt)
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
+ if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{
nDone = HandleScrollCommand(rCEvt, m_pHScroll.get(), m_pVScroll.get());
}
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index e3a7c13c7d7c..5b0ed083d23e 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -1185,7 +1185,7 @@ void MenuFloatingWindow::Command( const CommandEvent& rCEvt )
if ( rCEvt.GetCommand() == COMMAND_WHEEL )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if( !pData->GetModifier() && ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) )
+ if( !pData->GetModifier() && ( pData->GetMode() == CommandWheelMode::SCROLL ) )
{
// ImplCursorUpDown( pData->GetDelta() > 0L );
ImplScroll( pData->GetDelta() > 0L );
diff --git a/vcl/source/window/openglwin.cxx b/vcl/source/window/openglwin.cxx
index b205df61d1ef..d132469c63ed 100644
--- a/vcl/source/window/openglwin.cxx
+++ b/vcl/source/window/openglwin.cxx
@@ -86,7 +86,7 @@ void OpenGLWindow::Command( const CommandEvent& rCEvt )
if(rCEvt.GetCommand() == COMMAND_WHEEL)
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if(pData->GetMode() == COMMAND_WHEEL_SCROLL)
+ if(pData->GetMode() == CommandWheelMode::SCROLL)
{
long nDelta = pData->GetDelta();
mpRenderer->scroll(nDelta);
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index c701e33befa0..227840fe0c61 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4396,7 +4396,7 @@ void ToolBox::Command( const CommandEvent& rCEvt )
if ( (mnCurLine > 1) || (mnCurLine+mnVisLines-1 < mnCurLines) )
{
const CommandWheelData* pData = rCEvt.GetWheelData();
- if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ if ( pData->GetMode() == CommandWheelMode::SCROLL )
{
if ( (mnCurLine > 1) && (pData->GetDelta() > 0) )
ShowLine( false );
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index fec025132a36..5f6c8a66e32b 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -787,7 +787,7 @@ bool Window::HandleScrollCommand( const CommandEvent& rCmd,
{
const CommandWheelData* pData = rCmd.GetWheelData();
- if ( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) )
+ if ( pData && (CommandWheelMode::SCROLL == pData->GetMode()) )
{
if (!pData->IsDeltaPixel())
{
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index a677af194432..be88ec3ec4bc 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1385,19 +1385,19 @@ static bool ImplHandleWheelEvent( vcl::Window* pWindow, const SalWheelMouseEvent
if( aDogTag.IsDead() )
return false;
- sal_uInt16 nMode;
+ CommandWheelMode nMode;
sal_uInt16 nCode = rEvt.mnCode;
bool bHorz = rEvt.mbHorz;
bool bPixel = rEvt.mbDeltaIsPixel;
if ( scaleDirectly )
- nMode = COMMAND_WHEEL_ZOOM_SCALE;
+ nMode = CommandWheelMode::ZOOM_SCALE;
else if ( nCode & KEY_MOD1 )
- nMode = COMMAND_WHEEL_ZOOM;
+ nMode = CommandWheelMode::ZOOM;
else if ( nCode & KEY_MOD2 )
- nMode = COMMAND_WHEEL_DATAZOOM;
+ nMode = CommandWheelMode::DATAZOOM;
else
{
- nMode = COMMAND_WHEEL_SCROLL;
+ nMode = CommandWheelMode::SCROLL;
// #i85450# interpret shift-wheel as horizontal wheel action
if( (nCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3)) == KEY_SHIFT )
bHorz = true;