summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-26 15:22:10 +0200
committerNoel Grandin <noel@peralex.com>2015-05-27 11:14:26 +0200
commit9e3b1236b68069016d646b5682ce541335b5340c (patch)
tree5554d6d0baba0cc3c55ab5e1a9fba04104b0ae74
parentedc69a55c30ac6cc12de0bf18bddb7dc3f210be4 (diff)
convert WINDOW_DLGCTRL flags to scoped enum
Change-Id: I6c3a95cdcb15e5b1d4adb13908a751b06a302e20
-rw-r--r--include/vcl/window.hxx20
-rw-r--r--sc/source/ui/view/gridwin.cxx2
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorter.cxx2
-rw-r--r--sd/source/ui/view/sdwindow.cxx2
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx2
-rw-r--r--vcl/inc/window.h3
-rw-r--r--vcl/source/edit/vclmedit.cxx4
-rw-r--r--vcl/source/window/dlgctrl.cxx10
-rw-r--r--vcl/source/window/event.cxx2
-rw-r--r--vcl/source/window/floatwin.cxx2
-rw-r--r--vcl/source/window/mouse.cxx6
-rw-r--r--vcl/source/window/window.cxx4
-rw-r--r--vcl/source/window/window2.cxx4
13 files changed, 36 insertions, 27 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 9b9ebd27d3e3..ec12c25b496b 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -349,10 +349,18 @@ enum class StateChangedType : sal_uInt16
#define WINDOW_DRAW_ROLLOVER ((sal_uLong)0x00000100)
// DialogControl-Flags
-#define WINDOW_DLGCTRL_RETURN ((sal_uInt16)0x0001)
-#define WINDOW_DLGCTRL_WANTFOCUS ((sal_uInt16)0x0002)
-#define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004)
-#define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008)
+enum class DialogControlFlags
+{
+ NONE = 0x0000,
+ Return = 0x0001,
+ WantFocus = 0x0002,
+ Mod1Tab = 0x0004,
+ FloatWinPopupModeEndCancel = 0x0008,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<DialogControlFlags> : is_typed_flags<DialogControlFlags, 0x000f> {};
+}
// EndExtTextInput() Flags
enum class EndExtTextInputFlags
@@ -900,8 +908,8 @@ public:
bool IsPaintTransparent() const;
void SetDialogControlStart( bool bStart );
bool IsDialogControlStart() const;
- void SetDialogControlFlags( sal_uInt16 nFlags );
- sal_uInt16 GetDialogControlFlags() const;
+ void SetDialogControlFlags( DialogControlFlags nFlags );
+ DialogControlFlags GetDialogControlFlags() const;
struct PointerState
{
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index af8018483884..38d4560fa794 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -528,7 +528,7 @@ ScGridWindow::ScGridWindow( vcl::Window* pParent, ScViewData* pData, ScSplitPos
SetMapMode(pViewData->GetLogicMode(eWhich));
EnableChildTransparentMode();
- SetDialogControlFlags( WINDOW_DLGCTRL_RETURN | WINDOW_DLGCTRL_WANTFOCUS );
+ SetDialogControlFlags( DialogControlFlags::Return | DialogControlFlags::WantFocus );
SetHelpId( HID_SC_WIN_GRIDWIN );
SetUniqueId( HID_SC_WIN_GRIDWIN );
diff --git a/sd/source/ui/slidesorter/shell/SlideSorter.cxx b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
index a97135c718a2..fd45631f4a08 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorter.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorter.cxx
@@ -442,7 +442,7 @@ ContentWindow::ContentWindow(
mrSlideSorter(rSlideSorter),
mpCurrentFunction()
{
- SetDialogControlFlags(GetDialogControlFlags() & ~WINDOW_DLGCTRL_WANTFOCUS);
+ SetDialogControlFlags(GetDialogControlFlags() & ~DialogControlFlags::WantFocus);
SetStyle(GetStyle() | WB_NOPOINTERFOCUS);
}
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 2b936a039561..a4fdbd28a687 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -69,7 +69,7 @@ Window::Window(vcl::Window* pParent)
mpViewShell(NULL),
mbUseDropScroll (true)
{
- SetDialogControlFlags( WINDOW_DLGCTRL_RETURN | WINDOW_DLGCTRL_WANTFOCUS );
+ SetDialogControlFlags( DialogControlFlags::Return | DialogControlFlags::WantFocus );
MapMode aMap(GetMapMode());
aMap.SetMapUnit(MAP_100TH_MM);
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 3921852714f0..0d714731149c 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -4937,7 +4937,7 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView):
{
SetHelpId(HID_EDIT_WIN);
EnableChildTransparentMode();
- SetDialogControlFlags( WINDOW_DLGCTRL_RETURN | WINDOW_DLGCTRL_WANTFOCUS );
+ SetDialogControlFlags( DialogControlFlags::Return | DialogControlFlags::WantFocus );
m_bMBPressed = m_bInsDraw = m_bInsFrm =
m_bIsInDrag = m_bOldIdle = m_bOldIdleSet = m_bChainMode = m_bWasShdwCrsr = false;
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index b5216e07f952..bcb6f062d42c 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -59,6 +59,7 @@ class SalObject;
enum class MouseEventModifiers;
enum class MouseNotifyEvent;
enum class ActivateModeFlags;
+enum class DialogControlFlags;
namespace com { namespace sun { namespace star {
@@ -276,7 +277,7 @@ public:
sal_uInt16 mnGetFocusFlags;
sal_uInt16 mnParentClipMode;
ActivateModeFlags mnActivateMode;
- sal_uInt16 mnDlgCtrlFlags;
+ DialogControlFlags mnDlgCtrlFlags;
sal_uInt16 mnLockCount;
AlwaysInputMode meAlwaysInputMode;
VclAlign meHalign;
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx
index 00a721fd1335..a21c360799cd 100644
--- a/vcl/source/edit/vclmedit.cxx
+++ b/vcl/source/edit/vclmedit.cxx
@@ -250,7 +250,7 @@ void ImpVclMEdit::InitFromStyle( WinBits nWinStyle )
mpTextWindow->SetIgnoreTab( false );
// #103667# VclMultiLineEdit has the flag, but focusable window also needs this flag
WinBits nStyle = mpTextWindow->GetStyle();
- nStyle |= WINDOW_DLGCTRL_MOD1TAB;
+ nStyle |= WB_NODIALOGCONTROL;
mpTextWindow->SetStyle( nStyle );
}
}
@@ -971,7 +971,7 @@ WinBits VclMultiLineEdit::ImplInitStyle( WinBits nStyle )
nStyle |= WB_GROUP;
if ( !(nStyle & WB_IGNORETAB ))
- nStyle |= WINDOW_DLGCTRL_MOD1TAB;
+ nStyle |= WB_NODIALOGCONTROL;
return nStyle;
}
diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx
index 243be072e018..ece10d9c145f 100644
--- a/vcl/source/window/dlgctrl.cxx
+++ b/vcl/source/window/dlgctrl.cxx
@@ -596,7 +596,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
sal_uInt16 nIndex;
sal_uInt16 nFormStart;
sal_uInt16 nFormEnd;
- sal_uInt16 nDlgCtrlFlags;
+ DialogControlFlags nDlgCtrlFlags;
// we cannot take over control without Focus-window
vcl::Window* pFocusWindow = Application::GetFocusWindow();
@@ -610,7 +610,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
return false;
i = nIndex;
- nDlgCtrlFlags = 0;
+ nDlgCtrlFlags = DialogControlFlags::NONE;
pTempWindow = pSWindow;
do
{
@@ -639,7 +639,7 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
pButtonWindow = NULL;
}
- if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & WINDOW_DLGCTRL_RETURN) )
+ if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & DialogControlFlags::Return) )
{
GetDlgWindowType nType;
sal_uInt16 nGetFocusFlags = GETFOCUS_TAB;
@@ -801,8 +801,8 @@ bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, bool bKeyInput )
{
// Only use Ctrl-TAB if it was allowed for the whole
// dialog or for the current control (#103667#)
- if ( !aKeyCode.IsMod1() || (nDlgCtrlFlags & WINDOW_DLGCTRL_MOD1TAB) ||
- ( pSWindow->GetStyle() & WINDOW_DLGCTRL_MOD1TAB) )
+ if ( !aKeyCode.IsMod1() || (nDlgCtrlFlags & DialogControlFlags::Mod1Tab) ||
+ ( pSWindow->GetStyle() & WB_NODIALOGCONTROL) )
{
if ( aKeyCode.IsShift() )
{
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 3cc2c7c19c43..eda79c040bbd 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -180,7 +180,7 @@ bool Window::Notify( NotifyEvent& rNEvt )
{
ImplDlgCtrlFocusChanged( rNEvt.GetWindow(), rNEvt.GetType() == MouseNotifyEvent::GETFOCUS );
if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == MouseNotifyEvent::GETFOCUS) &&
- !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) )
+ !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
{
sal_uInt16 n = 0;
vcl::Window* pFirstChild = ImplGetDlgWindow( n, GetDlgWindowType::First );
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 468d8ccc0536..78dcefdd3a93 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -216,7 +216,7 @@ void FloatingWindow::dispose()
if( mbPopupModeCanceled )
// indicates that ESC key was pressed
// will be handled in Window::ImplGrabFocus()
- SetDialogControlFlags( GetDialogControlFlags() | WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL );
+ SetDialogControlFlags( GetDialogControlFlags() | DialogControlFlags::FloatWinPopupModeEndCancel );
if ( IsInPopupMode() )
EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll | FloatWinPopupEndFlags::DontCallHdl );
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index e250c6b38f3e..1167ac4ef2d7 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -216,7 +216,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
// ensure that dialogs on close pass the focus back to
// the correct window
if ( mpWindowImpl->mpLastFocusWindow && (mpWindowImpl->mpLastFocusWindow.get() != this) &&
- !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) &&
+ !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) &&
mpWindowImpl->mpLastFocusWindow->IsEnabled() &&
mpWindowImpl->mpLastFocusWindow->IsInputEnabled() &&
! mpWindowImpl->mpLastFocusWindow->IsInModalMode()
@@ -232,7 +232,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
// ensure that dialogs on close pass the focus back to
// the correct window
if ( mpWindowImpl->mpLastFocusWindow && (mpWindowImpl->mpLastFocusWindow.get() != this) &&
- !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) &&
+ !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) &&
mpWindowImpl->mpLastFocusWindow->IsEnabled() &&
mpWindowImpl->mpLastFocusWindow->IsInputEnabled() &&
! mpWindowImpl->mpLastFocusWindow->IsInModalMode()
@@ -380,7 +380,7 @@ void Window::ImplGrabFocus( sal_uInt16 nFlags )
// eg, toolboxes can select their recent active item
if( pOldFocusWindow &&
! aOldFocusDel.IsDead() &&
- ( pOldFocusWindow->GetDialogControlFlags() & WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ) )
+ ( pOldFocusWindow->GetDialogControlFlags() & DialogControlFlags::FloatWinPopupModeEndCancel ) )
mpWindowImpl->mnGetFocusFlags |= GETFOCUS_FLOATWIN_POPUPMODEEND_CANCEL;
NotifyEvent aNEvt( MouseNotifyEvent::GETFOCUS, this );
if ( !ImplCallPreNotify( aNEvt ) && !aDogTag.IsDead() )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index c2d8bd9f4c7f..6bb652f51129 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -648,7 +648,7 @@ WindowImpl::WindowImpl( WindowType nType )
mnPaintFlags = 0; // Flags for ImplCallPaint
mnParentClipMode = 0; // Flags for Parent-ClipChildren-Mode
mnActivateMode = ActivateModeFlags::NONE; // Will be converted in System/Overlap-Windows
- mnDlgCtrlFlags = 0; // DialogControl-Flags
+ mnDlgCtrlFlags = DialogControlFlags::NONE; // DialogControl-Flags
mnLockCount = 0; // LockCount
meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
meHalign = VCL_ALIGN_FILL;
@@ -1927,7 +1927,7 @@ void Window::Deactivate() {}
void Window::GetFocus()
{
- if ( HasFocus() && mpWindowImpl->mpLastFocusWindow && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) )
+ if ( HasFocus() && mpWindowImpl->mpLastFocusWindow && !(mpWindowImpl->mnDlgCtrlFlags & DialogControlFlags::WantFocus) )
{
ImplDelData aDogtag( this );
mpWindowImpl->mpLastFocusWindow->GrabFocus();
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 17cc082cac1d..99fd9ce19e09 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1199,12 +1199,12 @@ bool Window::IsDialogControlStart() const
return mpWindowImpl && mpWindowImpl->mbDlgCtrlStart;
}
-void Window::SetDialogControlFlags( sal_uInt16 nFlags )
+void Window::SetDialogControlFlags( DialogControlFlags nFlags )
{
mpWindowImpl->mnDlgCtrlFlags = nFlags;
}
-sal_uInt16 Window::GetDialogControlFlags() const
+DialogControlFlags Window::GetDialogControlFlags() const
{
return mpWindowImpl->mnDlgCtrlFlags;
}