diff options
-rw-r--r-- | include/vcl/window.hxx | 10 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 34 | ||||
-rw-r--r-- | vcl/source/window/event.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 2 |
6 files changed, 27 insertions, 25 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 34f0baca282e..32f3ea80e2c1 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -375,9 +375,11 @@ enum class StateChangedType : sal_uInt16 #define IMPL_MSGBOX_OFFSET_EXTRA_Y 2 #define IMPL_SEP_MSGBOX_IMAGE 8 -#define DLGWINDOW_PREV 0 -#define DLGWINDOW_NEXT 1 -#define DLGWINDOW_FIRST 2 +// ImplGetDlgWindow() +enum class GetDlgWindowType +{ + Prev, Next, First +}; // - Window - @@ -520,7 +522,7 @@ public: SAL_DLLPRIVATE vcl::Window* ImplGetWindow(); SAL_DLLPRIVATE ImplWinData* ImplGetWinData() const; SAL_DLLPRIVATE vcl::Window* ImplGetClientWindow() const; - SAL_DLLPRIVATE vcl::Window* ImplGetDlgWindow( sal_uInt16 n, sal_uInt16 nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = NULL ); + SAL_DLLPRIVATE vcl::Window* ImplGetDlgWindow( sal_uInt16 n, GetDlgWindowType nType, sal_uInt16 nStart = 0, sal_uInt16 nEnd = 0xFFFF, sal_uInt16* pIndex = NULL ); SAL_DLLPRIVATE vcl::Window* ImplGetParent() const; SAL_DLLPRIVATE vcl::Window* ImplFindWindow( const Point& rFramePos ); diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 98aa909b7cba..fc3cad5cb4e6 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -644,7 +644,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) if ( pOldPage && pOldPage->HasChildPathFocus() ) { sal_uInt16 n = 0; - vcl::Window* pFirstChild = pPage->ImplGetDlgWindow( n, DLGWINDOW_FIRST ); + vcl::Window* pFirstChild = pPage->ImplGetDlgWindow( n, GetDlgWindowType::First ); if ( pFirstChild ) pFirstChild->ImplControlFocus( GETFOCUS_INIT ); else diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 9cf90b560856..2a0bf5d38228 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1081,7 +1081,7 @@ void Dialog::GrabFocusToFirstControl() !isEnabledInLayout(pFocusControl) || !pFocusControl->IsInputEnabled() ) { sal_uInt16 n = 0; - pFocusControl = ImplGetDlgWindow( n, DLGWINDOW_FIRST ); + pFocusControl = ImplGetDlgWindow( n, GetDlgWindowType::First ); } if ( pFocusControl ) pFocusControl->ImplControlFocus( GETFOCUS_INIT ); diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index ef47cd059059..243be072e018 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -182,7 +182,7 @@ static vcl::Window* ImplGetNextWindow( vcl::Window* pParent, sal_uInt16 n, sal_u namespace vcl { -vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType, +vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, GetDlgWindowType nType, sal_uInt16 nFormStart, sal_uInt16 nFormEnd, sal_uInt16* pIndex ) { @@ -194,7 +194,7 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType, sal_uInt16 nTemp; sal_uInt16 nStartIndex; - if ( nType == DLGWINDOW_PREV ) + if ( nType == GetDlgWindowType::Prev ) { i = nIndex; do @@ -214,12 +214,12 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType, else { i = nIndex; - pWindow = ImplGetChildWindow( this, i, i, (nType == DLGWINDOW_FIRST) ); + pWindow = ImplGetChildWindow( this, i, i, (nType == GetDlgWindowType::First) ); if ( pWindow ) { nStartIndex = i; - if ( nType == DLGWINDOW_NEXT ) + if ( nType == GetDlgWindowType::Next ) { if ( i < nFormEnd ) { @@ -260,13 +260,13 @@ vcl::Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType, } } - if ( nType == DLGWINDOW_FIRST ) + if ( nType == GetDlgWindowType::First ) { if ( pWindow ) { if ( pWindow->GetType() == WINDOW_TABCONTROL ) { - vcl::Window* pNextWindow = ImplGetDlgWindow( i, DLGWINDOW_NEXT ); + vcl::Window* pNextWindow = ImplGetDlgWindow( i, GetDlgWindowType::Next ); if ( pNextWindow ) { if ( pWindow->IsChild( pNextWindow ) ) @@ -429,7 +429,7 @@ vcl::Window* ImplFindAccelWindow( vcl::Window* pParent, sal_uInt16& rIndex, sal_ if ( (pWindow->GetType() == WINDOW_FIXEDTEXT) || (pWindow->GetType() == WINDOW_FIXEDLINE) || (pWindow->GetType() == WINDOW_GROUPBOX) ) - pWindow = pParent->ImplGetDlgWindow( i, DLGWINDOW_NEXT ); + pWindow = pParent->ImplGetDlgWindow( i, GetDlgWindowType::Next ); rIndex = i; return pWindow; } @@ -641,18 +641,18 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & WINDOW_DLGCTRL_RETURN) ) { - sal_uInt16 nType; + GetDlgWindowType nType; sal_uInt16 nGetFocusFlags = GETFOCUS_TAB; sal_uInt16 nNewIndex; sal_uInt16 iStart; if ( aKeyCode.IsShift() ) { - nType = DLGWINDOW_PREV; + nType = GetDlgWindowType::Prev; nGetFocusFlags |= GETFOCUS_BACKWARD; } else { - nType = DLGWINDOW_NEXT; + nType = GetDlgWindowType::Next; nGetFocusFlags |= GETFOCUS_FORWARD; } iStart = i; @@ -662,7 +662,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) if ( !pTempWindow->mpWindowImpl->mbPushButton ) { // get Around-Flag - if ( nType == DLGWINDOW_PREV ) + if ( nType == GetDlgWindowType::Prev ) { if ( nNewIndex > iStart ) nGetFocusFlags |= GETFOCUS_AROUND; @@ -731,7 +731,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) // do not skip Alt key, for MS Windows if ( !aKeyCode.IsMod2() ) { - sal_uInt16 nType; + GetDlgWindowType nType; sal_uInt16 nGetFocusFlags = GETFOCUS_TAB; sal_uInt16 nNewIndex; bool bFormular = false; @@ -787,7 +787,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) nFoundFormStart, nFoundFormEnd ) ) { nTempIndex = nFoundFormStart; - pFormularFirstWindow = ImplGetDlgWindow( nTempIndex, DLGWINDOW_FIRST, nFoundFormStart, nFoundFormEnd ); + pFormularFirstWindow = ImplGetDlgWindow( nTempIndex, GetDlgWindowType::First, nFoundFormStart, nFoundFormEnd ); if ( pFormularFirstWindow ) { pFormularFirstWindow->ImplControlFocus(); @@ -806,12 +806,12 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) { if ( aKeyCode.IsShift() ) { - nType = DLGWINDOW_PREV; + nType = GetDlgWindowType::Prev; nGetFocusFlags |= GETFOCUS_BACKWARD; } else { - nType = DLGWINDOW_NEXT; + nType = GetDlgWindowType::Next; nGetFocusFlags |= GETFOCUS_FORWARD; } vcl::Window* pWindow = ImplGetDlgWindow( i, nType, nFormStart, nFormEnd, &nNewIndex ); @@ -832,7 +832,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput ) else if ( pWindow ) { // get Around-Flag - if ( nType == DLGWINDOW_PREV ) + if ( nType == GetDlgWindowType::Prev ) { if ( nNewIndex > i ) nGetFocusFlags |= GETFOCUS_AROUND; @@ -994,7 +994,7 @@ if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->G if ( !pSWindow ) return; - vcl::Window* pWindow = pDlgCtrlParent->ImplGetDlgWindow( nIndex, DLGWINDOW_NEXT, nFormStart, nFormEnd ); + vcl::Window* pWindow = pDlgCtrlParent->ImplGetDlgWindow( nIndex, GetDlgWindowType::Next, nFormStart, nFormEnd ); if ( pWindow && (pWindow != pSWindow) ) pWindow->ImplControlFocus(); } diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx index c5dfc892a727..3cc2c7c19c43 100644 --- a/vcl/source/window/event.cxx +++ b/vcl/source/window/event.cxx @@ -183,7 +183,7 @@ bool Window::Notify( NotifyEvent& rNEvt ) !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) ) { sal_uInt16 n = 0; - vcl::Window* pFirstChild = ImplGetDlgWindow( n, DLGWINDOW_FIRST ); + vcl::Window* pFirstChild = ImplGetDlgWindow( n, GetDlgWindowType::First ); if ( pFirstChild ) pFirstChild->ImplControlFocus(); } diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 172898c35514..59bf3473775b 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -5273,7 +5273,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) if (HasFocus() && mpData->mbKeyInputDisabled && bParentIsContainer) { sal_uInt16 n = 0; - vcl::Window *pFocusControl = pParent->ImplGetDlgWindow( n, DLGWINDOW_FIRST ); + vcl::Window *pFocusControl = pParent->ImplGetDlgWindow( n, GetDlgWindowType::First ); if ( pFocusControl && pFocusControl != this ) pFocusControl->ImplControlFocus( GETFOCUS_INIT ); } |