[Libreoffice-commits] core.git: 4 commits - cui/source dbaccess/source desktop/source extensions/source framework/source include/sfx2 include/vcl sc/source sd/source sfx2/source svtools/source sw/source toolkit/source vcl/inc vcl/README.lifecycle vcl/source vcl/unx vcl/workben
Noel Grandin
noel at peralex.com
Mon May 25 01:33:11 PDT 2015
cui/source/customize/macropg.cxx | 2
cui/source/inc/headertablistbox.hxx | 2
dbaccess/source/ui/app/AppDetailPageHelper.cxx | 2
dbaccess/source/ui/control/FieldDescControl.cxx | 10 +-
dbaccess/source/ui/querydesign/JoinTableView.cxx | 4
dbaccess/source/ui/relationdesign/RelationTableView.cxx | 2
desktop/source/deployment/gui/dp_gui_service.cxx | 4
desktop/source/deployment/gui/dp_gui_theextmgr.cxx | 4
desktop/source/deployment/gui/dp_gui_theextmgr.hxx | 2
extensions/source/propctrlr/browserline.cxx | 8 -
extensions/source/propctrlr/browserline.hxx | 2
extensions/source/propctrlr/browserlistbox.cxx | 4
extensions/source/update/ui/updatecheckui.cxx | 4
framework/source/classes/menumanager.cxx | 2
framework/source/helper/statusindicatorfactory.cxx | 2
framework/source/layoutmanager/layoutmanager.cxx | 2
framework/source/layoutmanager/toolbarlayoutmanager.cxx | 12 +-
framework/source/loadenv/loadenv.cxx | 2
framework/source/tabwin/tabwindow.cxx | 4
framework/source/uielement/menubarmanager.cxx | 2
framework/source/uielement/progressbarwrapper.cxx | 2
include/sfx2/childwin.hxx | 2
include/vcl/window.hxx | 74 +++++++++++-----
sc/source/ui/inc/reffact.hxx | 2
sd/source/ui/animations/CustomAnimationDialog.cxx | 2
sd/source/ui/presenter/PresenterHelper.cxx | 2
sfx2/source/appl/childwin.cxx | 2
sfx2/source/appl/workwin.cxx | 8 -
sfx2/source/dialog/dockwin.cxx | 4
sfx2/source/inet/inettbc.cxx | 2
sfx2/source/menu/virtmenu.cxx | 2
sfx2/source/toolbox/tbxitem.cxx | 2
svtools/source/toolpanel/drawerlayouter.cxx | 4
sw/source/uibase/docvw/HeaderFooterWin.cxx | 2
toolkit/source/awt/vclxcontainer.cxx | 4
toolkit/source/awt/vclxtopwindow.cxx | 2
vcl/README.lifecycle | 2
vcl/inc/window.h | 3
vcl/source/app/help.cxx | 2
vcl/source/window/brdwin.cxx | 2
vcl/source/window/btndlg.cxx | 2
vcl/source/window/dialog.cxx | 2
vcl/source/window/dockmgr.cxx | 16 +--
vcl/source/window/dockwin.cxx | 10 +-
vcl/source/window/event.cxx | 8 -
vcl/source/window/floatwin.cxx | 8 -
vcl/source/window/menufloatingwindow.cxx | 2
vcl/source/window/stacking.cxx | 40 ++++----
vcl/source/window/syschild.cxx | 4
vcl/source/window/syswin.cxx | 2
vcl/source/window/window.cxx | 20 ++--
vcl/source/window/window2.cxx | 2
vcl/source/window/winproc.cxx | 6 -
vcl/source/window/wrkwin.cxx | 2
vcl/unx/generic/app/i18n_status.cxx | 4
vcl/workben/vcldemo.cxx | 2
56 files changed, 182 insertions(+), 149 deletions(-)
New commits:
commit c7efb51e31a4eea48ffed291e5c7fb907b1811e4
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 25 10:30:37 2015 +0200
convert TOTOP constants to scoped enum
Change-Id: I85ba631ba298f1034dc5b6a04a5ff3d509c41bcb
diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx
index f07042d..3e720b5 100644
--- a/desktop/source/deployment/gui/dp_gui_service.cxx
+++ b/desktop/source/deployment/gui/dp_gui_service.cxx
@@ -270,12 +270,12 @@ void ServiceImpl::startExecuteModal(
if ( bCloseDialog )
myExtMgr->Close();
else
- myExtMgr->ToTop( TOTOP_RESTOREWHENMIN );
+ myExtMgr->ToTop( ToTopFlags::RestoreWhenMin );
}
else
{
myExtMgr->Show();
- myExtMgr->ToTop( TOTOP_RESTOREWHENMIN );
+ myExtMgr->ToTop( ToTopFlags::RestoreWhenMin );
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index ccf0b54..d04c356 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -148,7 +148,7 @@ void TheExtensionManager::SetText( const OUString &rTitle )
}
-void TheExtensionManager::ToTop( sal_uInt16 nFlags )
+void TheExtensionManager::ToTop( ToTopFlags nFlags )
{
const SolarMutexGuard guard;
@@ -442,7 +442,7 @@ void TheExtensionManager::queryTermination( ::lang::EventObject const & )
if ( m_pExecuteCmdQueue->isBusy() || ( pDialogHelper && pDialogHelper->isBusy() ) )
{
- ToTop( TOTOP_RESTOREWHENMIN );
+ ToTop( ToTopFlags::RestoreWhenMin );
throw frame::TerminationVetoException(
"The office cannot be closed while the Extension Manager is running",
static_cast<frame::XTerminateListener*>(this));
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
index 2341a5a..cde3202 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx
@@ -87,7 +87,7 @@ public:
void SetText( const OUString &rTitle );
void Show();
- void ToTop( sal_uInt16 nFlags );
+ void ToTop( ToTopFlags nFlags );
bool Close();
bool isVisible();
diff --git a/framework/source/classes/menumanager.cxx b/framework/source/classes/menumanager.cxx
index 7cd0e7d..e6580b5 100644
--- a/framework/source/classes/menumanager.cxx
+++ b/framework/source/classes/menumanager.cxx
@@ -846,7 +846,7 @@ IMPL_LINK( MenuManager, Select, Menu *, pMenu )
{
vcl::Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
pWin->GrabFocus();
- pWin->ToTop( TOTOP_RESTOREWHENMIN );
+ pWin->ToTop( ToTopFlags::RestoreWhenMin );
break;
}
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index ad424fdc2..921a75b 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -985,7 +985,7 @@ IMPL_LINK( MenuBarManager, Select, Menu *, pMenu )
{
vcl::Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
pWin->GrabFocus();
- pWin->ToTop( TOTOP_RESTOREWHENMIN );
+ pWin->ToTop( ToTopFlags::RestoreWhenMin );
break;
}
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index eb2d6a8..c791dde 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -207,10 +207,18 @@ namespace o3tl
}
// ToTop-Flags
-#define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
-#define TOTOP_FOREGROUNDTASK ((sal_uInt16)0x0002)
-#define TOTOP_NOGRABFOCUS ((sal_uInt16)0x0004)
-#define TOTOP_GRABFOCUSONLY ((sal_uInt16)0x0008)
+enum class ToTopFlags
+{
+ NONE = 0x0000,
+ RestoreWhenMin = 0x0001,
+ ForegroundTask = 0x0002,
+ NoGrabFocus = 0x0004,
+ GrabFocusOnly = 0x0008,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ToTopFlags> : is_typed_flags<ToTopFlags, 0x000f> {};
+}
// Flags for Invalidate
#define INVALIDATE_CHILDREN ((sal_uInt16)0x0001)
@@ -671,9 +679,9 @@ private:
SAL_DLLPRIVATE void ImplToBottomChild();
SAL_DLLPRIVATE void ImplCalcToTop( ImplCalcToTopData* pPrevData );
- SAL_DLLPRIVATE void ImplToTop( sal_uInt16 nFlags );
- SAL_DLLPRIVATE void ImplStartToTop( sal_uInt16 nFlags );
- SAL_DLLPRIVATE void ImplFocusToTop( sal_uInt16 nFlags, bool bReallyVisible );
+ SAL_DLLPRIVATE void ImplToTop( ToTopFlags nFlags );
+ SAL_DLLPRIVATE void ImplStartToTop( ToTopFlags nFlags );
+ SAL_DLLPRIVATE void ImplFocusToTop( ToTopFlags nFlags, bool bReallyVisible );
SAL_DLLPRIVATE void ImplShowAllOverlaps();
SAL_DLLPRIVATE void ImplHideAllOverlaps();
@@ -1020,7 +1028,7 @@ public:
void SetActivateMode( ActivateModeFlags nMode );
ActivateModeFlags GetActivateMode() const;
- void ToTop( sal_uInt16 nFlags = 0 );
+ void ToTop( ToTopFlags nFlags = ToTopFlags::NONE );
void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
void EnableAlwaysOnTop( bool bEnable = true );
bool IsAlwaysOnTopEnabled() const;
diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx
index 04564cd..69017d5 100644
--- a/sfx2/source/inet/inettbc.cxx
+++ b/sfx2/source/inet/inettbc.cxx
@@ -184,7 +184,7 @@ IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, OpenHdl)
if ( pWin )
{
pWin->GrabFocus();
- pWin->ToTop( TOTOP_RESTOREWHENMIN );
+ pWin->ToTop( ToTopFlags::RestoreWhenMin );
}
}
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index e14bb24..2ca790e 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -953,7 +953,7 @@ IMPL_LINK( SfxVirtualMenu, Select, Menu *, pMenu )
{
vcl::Window* pWin = VCLUnoHelper::GetWindow( xFrame->getContainerWindow() );
pWin->GrabFocus();
- pWin->ToTop( TOTOP_RESTOREWHENMIN );
+ pWin->ToTop( ToTopFlags::RestoreWhenMin );
break;
}
diff --git a/toolkit/source/awt/vclxtopwindow.cxx b/toolkit/source/awt/vclxtopwindow.cxx
index 48b593e..06cba55 100644
--- a/toolkit/source/awt/vclxtopwindow.cxx
+++ b/toolkit/source/awt/vclxtopwindow.cxx
@@ -136,7 +136,7 @@ void VCLXTopWindow_Base::toFront( ) throw(::com::sun::star::uno::RuntimeExcepti
vcl::Window* pWindow = GetWindowImpl();
if ( pWindow )
- static_cast<WorkWindow*>(pWindow)->ToTop( TOTOP_RESTOREWHENMIN );
+ static_cast<WorkWindow*>(pWindow)->ToTop( ToTopFlags::RestoreWhenMin );
}
void VCLXTopWindow_Base::toBack( ) throw(::com::sun::star::uno::RuntimeException, std::exception)
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 0c201b9..c5dfc89 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -158,7 +158,7 @@ bool Window::Notify( NotifyEvent& rNEvt )
* would not notice any change since "this" already has the focus.
*/
if( pWrapper->IsFloatingMode() )
- ToTop( TOTOP_GRABFOCUSONLY );
+ ToTop( ToTopFlags::GrabFocusOnly );
return true;
}
}
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index 0093ba1..ad7bd0f 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -507,7 +507,7 @@ void MenuFloatingWindow::MouseButtonDown( const MouseEvent& rMEvt )
// should stay on top...
// due to focus change this would close all menus -> don't do it (#94123)
//if ( pActivePopup && pActivePopup->ImplGetWindow() && !pActivePopup->ImplGetFloatingWindow()->pActivePopup )
- // pActivePopup->ImplGetFloatingWindow()->ToTop( TOTOP_NOGRABFOCUS );
+ // pActivePopup->ImplGetFloatingWindow()->ToTop( ToTopFlags::NoGrabFocus );
ImplHighlightItem( rMEvt, true );
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 8c6c97b..96e27e4 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -236,7 +236,7 @@ void Window::ImplCalcToTop( ImplCalcToTopData* pPrevData )
}
}
-void Window::ImplToTop( sal_uInt16 nFlags )
+void Window::ImplToTop( ToTopFlags nFlags )
{
DBG_ASSERT( ImplIsOverlapWindow(), "Window::ImplToTop(): Is not a OverlapWindow" );
@@ -253,11 +253,11 @@ void Window::ImplToTop( sal_uInt16 nFlags )
if( !ImplGetClientWindow() || !(ImplGetClientWindow()->GetStyle() & WB_SYSTEMFLOATWIN) )
{
sal_uInt16 nSysFlags = 0;
- if ( nFlags & TOTOP_RESTOREWHENMIN )
+ if ( nFlags & ToTopFlags::RestoreWhenMin )
nSysFlags |= SAL_FRAME_TOTOP_RESTOREWHENMIN;
- if ( nFlags & TOTOP_FOREGROUNDTASK )
+ if ( nFlags & ToTopFlags::ForegroundTask )
nSysFlags |= SAL_FRAME_TOTOP_FOREGROUNDTASK;
- if ( nFlags & TOTOP_GRABFOCUSONLY )
+ if ( nFlags & ToTopFlags::GrabFocusOnly )
nSysFlags |= SAL_FRAME_TOTOP_GRABFOCUS_ONLY;
mpWindowImpl->mpFrame->ToTop( nSysFlags );
}
@@ -326,7 +326,7 @@ void Window::ImplToTop( sal_uInt16 nFlags )
}
}
-void Window::ImplStartToTop( sal_uInt16 nFlags )
+void Window::ImplStartToTop( ToTopFlags nFlags )
{
ImplCalcToTopData aStartData;
ImplCalcToTopData* pCurData;
@@ -379,10 +379,10 @@ void Window::ImplStartToTop( sal_uInt16 nFlags )
}
}
-void Window::ImplFocusToTop( sal_uInt16 nFlags, bool bReallyVisible )
+void Window::ImplFocusToTop( ToTopFlags nFlags, bool bReallyVisible )
{
// do we need to fetch the focus?
- if ( !(nFlags & TOTOP_NOGRABFOCUS) )
+ if ( !(nFlags & ToTopFlags::NoGrabFocus) )
{
// first window with GrabFocus-Activate gets the focus
vcl::Window* pFocusWindow = this;
@@ -436,7 +436,7 @@ void Window::ImplHideAllOverlaps()
}
}
-void Window::ToTop( sal_uInt16 nFlags )
+void Window::ToTop( ToTopFlags nFlags )
{
ImplStartToTop( nFlags );
diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx
index 25867d8..c02cfc6 100644
--- a/vcl/source/window/syschild.cxx
+++ b/vcl/source/window/syschild.cxx
@@ -64,7 +64,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
// that the frame does not steal it
pWindow->ImplGetFrameData()->mbSysObjFocus = true;
pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = true;
- pWindow->ToTop( TOTOP_NOGRABFOCUS );
+ pWindow->ToTop( ToTopFlags::NoGrabFocus );
if( aDogTag.IsDead() )
break;
pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = false;
@@ -89,7 +89,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */,
case SALOBJ_EVENT_TOTOP:
pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = true;
if ( !Application::GetFocusWindow() || pWindow->HasChildPathFocus() )
- pWindow->ToTop( TOTOP_NOGRABFOCUS );
+ pWindow->ToTop( ToTopFlags::NoGrabFocus );
else
pWindow->ToTop();
if( aDogTag.IsDead() )
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 8a5d7d8..be51862 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2407,8 +2407,8 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
// all other windows if needed.
if ( ImplIsOverlapWindow() && !(nFlags & ShowFlags::NoActivate) )
{
- ImplStartToTop(( nFlags & ShowFlags::ForegroundTask ) ? TOTOP_FOREGROUNDTASK : 0 );
- ImplFocusToTop( 0, false );
+ ImplStartToTop(( nFlags & ShowFlags::ForegroundTask ) ? ToTopFlags::ForegroundTask : ToTopFlags::NONE );
+ ImplFocusToTop( ToTopFlags::NONE, false );
}
// save background
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 4331a40..ff1252b 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -698,7 +698,7 @@ bool ImplHandleMouseEvent( vcl::Window* pWindow, MouseNotifyEvent nSVEvent, bool
// Auto-ToTop
if ( !pSVData->maWinData.mpCaptureWin &&
(pChild->GetSettings().GetMouseSettings().GetOptions() & MouseSettingsOptions::AutoFocus) )
- pChild->ToTop( TOTOP_NOGRABFOCUS );
+ pChild->ToTop( ToTopFlags::NoGrabFocus );
if( aDelData.IsDead() )
bCallHelpRequest = false;
@@ -1812,7 +1812,7 @@ IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl)
vcl::Window* pTopLevelWindow = ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplGetFirstOverlapWindow();
if ( ( ! pTopLevelWindow->IsInputEnabled() || pTopLevelWindow->IsInModalMode() )
&& pSVData->maWinData.mpLastExecuteDlg )
- pSVData->maWinData.mpLastExecuteDlg->ToTop( TOTOP_RESTOREWHENMIN | TOTOP_GRABFOCUSONLY);
+ pSVData->maWinData.mpLastExecuteDlg->ToTop( ToTopFlags::RestoreWhenMin | ToTopFlags::GrabFocusOnly);
else
pTopLevelWindow->GrabFocus();
}
commit 4de86ac0c62b446426136b620cfd65d088c51cd8
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 22 15:25:59 2015 +0200
convert ACTIVATE_MODE constants to scoped enum
Change-Id: Ica20e033d5cde8a0c18eff51c63c66e6a3845fd0
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index cc5c695..eb2d6a8 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -196,7 +196,15 @@ namespace o3tl
}
// Activate-Flags
-#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
+enum class ActivateModeFlags
+{
+ NONE = 0,
+ GrabFocus = 0x0001,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ActivateModeFlags> : is_typed_flags<ActivateModeFlags, 0x0001> {};
+}
// ToTop-Flags
#define TOTOP_RESTOREWHENMIN ((sal_uInt16)0x0001)
@@ -1009,8 +1017,8 @@ public:
*/
bool IsInModalMode() const;
- void SetActivateMode( sal_uInt16 nMode );
- sal_uInt16 GetActivateMode() const;
+ void SetActivateMode( ActivateModeFlags nMode );
+ ActivateModeFlags GetActivateMode() const;
void ToTop( sal_uInt16 nFlags = 0 );
void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 48fea9e..b5216e0 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -58,6 +58,7 @@ class SalFrame;
class SalObject;
enum class MouseEventModifiers;
enum class MouseNotifyEvent;
+enum class ActivateModeFlags;
namespace com { namespace sun { namespace star {
@@ -274,7 +275,7 @@ public:
sal_uInt16 mnPaintFlags;
sal_uInt16 mnGetFocusFlags;
sal_uInt16 mnParentClipMode;
- sal_uInt16 mnActivateMode;
+ ActivateModeFlags mnActivateMode;
sal_uInt16 mnDlgCtrlFlags;
sal_uInt16 mnLockCount;
AlwaysInputMode meAlwaysInputMode;
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 0d6ab4e..a614b3a 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1884,7 +1884,7 @@ void ImplBorderWindow::Deactivate()
{
// remove active windows from the ruler, also ignore the Deactivate
// if a menu becomes active
- if ( GetActivateMode() && !ImplGetSVData()->maWinData.mbNoDeactivate )
+ if ( GetActivateMode() != ActivateModeFlags::NONE && !ImplGetSVData()->maWinData.mbNoDeactivate )
SetDisplayActive( false );
Window::Deactivate();
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index c733089..063e96f 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -427,7 +427,7 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag )
mpWindowImpl->mpRealParent = pParent;
}
- SetActivateMode( ACTIVATE_MODE_GRABFOCUS );
+ SetActivateMode( ActivateModeFlags::GrabFocus );
ImplInitSettings();
}
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index 61c11ab..0c201b9 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -515,17 +515,17 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow,
pOldRealWindow = pOldOverlapWindow->ImplGetWindow();
pNewRealWindow = pNewOverlapWindow->ImplGetWindow();
if ( (pOldRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
- pOldRealWindow->GetActivateMode() )
+ pOldRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
{
if ( (pNewRealWindow->GetType() == WINDOW_FLOATINGWINDOW) &&
- !pNewRealWindow->GetActivateMode() )
+ pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
{
pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow;
bCallDeactivate = false;
}
}
else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) ||
- pNewRealWindow->GetActivateMode() )
+ pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
{
if ( pSVData->maWinData.mpLastDeacWin )
{
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 28a40d0..f9abdf6 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -119,7 +119,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle )
mpWindowImpl->mpRealParent = pParent;
}
}
- SetActivateMode( 0 );
+ SetActivateMode( ActivateModeFlags::NONE );
mpNextFloat = NULL;
mpFirstPopupModeWin = NULL;
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 596f49a..8c6c97b 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -392,12 +392,12 @@ void Window::ImplFocusToTop( sal_uInt16 nFlags, bool bReallyVisible )
// should always find the belonging BorderWindow
if ( !pFocusWindow->mpWindowImpl->mpBorderWindow )
{
- if ( pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS )
+ if ( pFocusWindow->mpWindowImpl->mnActivateMode & ActivateModeFlags::GrabFocus )
break;
}
pFocusWindow = pFocusWindow->ImplGetParent();
}
- if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS) &&
+ if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ActivateModeFlags::GrabFocus) &&
!pFocusWindow->HasChildPathFocus( true ) )
pFocusWindow->GrabFocus();
}
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index d348e2b..4e46c8a 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -69,7 +69,7 @@ void SystemWindow::Init()
{
mpImplData = new ImplData;
mpWindowImpl->mbSysWin = true;
- mpWindowImpl->mnActivateMode = ACTIVATE_MODE_GRABFOCUS;
+ mpWindowImpl->mnActivateMode = ActivateModeFlags::GrabFocus;
mpMenuBar = NULL;
mbPinned = false;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index a916bc6..8a5d7d8 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -655,7 +655,7 @@ WindowImpl::WindowImpl( WindowType nType )
mnWaitCount = 0; // Wait-Count (>1 == Warte-MousePointer)
mnPaintFlags = 0; // Flags for ImplCallPaint
mnParentClipMode = 0; // Flags for Parent-ClipChildren-Mode
- mnActivateMode = 0; // Will be converted in System/Overlap-Windows
+ mnActivateMode = ActivateModeFlags::NONE; // Will be converted in System/Overlap-Windows
mnDlgCtrlFlags = 0; // DialogControl-Flags
mnLockCount = 0; // LockCount
meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called
@@ -2798,7 +2798,7 @@ void Window::AlwaysDisableInput( bool bAlways, bool bChild )
}
}
-void Window::SetActivateMode( sal_uInt16 nMode )
+void Window::SetActivateMode( ActivateModeFlags nMode )
{
if ( mpWindowImpl->mpBorderWindow )
@@ -2809,7 +2809,7 @@ void Window::SetActivateMode( sal_uInt16 nMode )
mpWindowImpl->mnActivateMode = nMode;
// possibly trigger Decativate/Activate
- if ( mpWindowImpl->mnActivateMode )
+ if ( mpWindowImpl->mnActivateMode != ActivateModeFlags::NONE )
{
if ( (mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW)) &&
!HasChildPathFocus( true ) )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 5e8c8f8..17cc082 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1284,7 +1284,7 @@ bool Window::IsAlwaysEnableInput() const
return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled;
}
-sal_uInt16 Window::GetActivateMode() const
+ActivateModeFlags Window::GetActivateMode() const
{
return mpWindowImpl->mnActivateMode;
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index d3c43b03..4331a40 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -1760,7 +1760,7 @@ static void ImplActivateFloatingWindows( vcl::Window* pWindow, bool bActive )
vcl::Window* pTempWindow = pWindow->ImplGetWindowImpl()->mpFirstOverlap;
while ( pTempWindow )
{
- if ( !pTempWindow->GetActivateMode() )
+ if ( pTempWindow->GetActivateMode() == ActivateModeFlags::NONE )
{
if ( (pTempWindow->GetType() == WINDOW_BORDERWINDOW) &&
(pTempWindow->ImplGetWindow()->GetType() == WINDOW_FLOATINGWINDOW) )
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 136adc8..78d0b24 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -64,7 +64,7 @@ void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentDat
pSVData->maWinData.mpAppWin = this;
}
- SetActivateMode( ACTIVATE_MODE_GRABFOCUS );
+ SetActivateMode( ActivateModeFlags::GrabFocus );
}
void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, const ::com::sun::star::uno::Any& aSystemWorkWindowToken )
commit 65be8fd0f7f30eaca4fbc35e3fdc9cb7763cb44d
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 22 13:48:09 2015 +0200
convert WINDOW_ZORDER constants to scoped enum
Change-Id: I91a583fe7d4195ee6bc73b4854f757517b38408b
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index c3dc8ef..557e89e 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -582,7 +582,7 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon
);
pTreeView->notifyHiContrastChanged();
- m_aBorder->SetZOrder(pTreeView, WINDOW_ZORDER_BEHIND);
+ m_aBorder->SetZOrder(pTreeView, ZOrderFlags::Behind);
}
if ( !m_pLists[E_TABLE]->GetEntryCount() )
{
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index 3cce597..ca610b1 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -745,13 +745,13 @@ void OFieldDescControl::ArrangeAggregates()
SetPosSize(adAggregates[i].pctrlInputControl, nCurrentControlPos, adAggregates[i].nPosSizeArgument);
// Set the z-order in a way such that the Controls can be traversed in the same sequence in which they have been arranged here
- adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? WINDOW_ZORDER_BEHIND : WINDOW_ZORDER_FIRST);
- adAggregates[i].pctrlInputControl->SetZOrder(adAggregates[i].pctrlTextControl, WINDOW_ZORDER_BEHIND );
+ adAggregates[i].pctrlTextControl->SetZOrder(pZOrderPredecessor, pZOrderPredecessor ? ZOrderFlags::Behind : ZOrderFlags::First);
+ adAggregates[i].pctrlInputControl->SetZOrder(adAggregates[i].pctrlTextControl, ZOrderFlags::Behind );
pZOrderPredecessor = adAggregates[i].pctrlInputControl;
if (adAggregates[i].pctrlInputControl == pFormatSample)
{
- pFormat->SetZOrder(pZOrderPredecessor, WINDOW_ZORDER_BEHIND);
+ pFormat->SetZOrder(pZOrderPredecessor, ZOrderFlags::Behind);
pZOrderPredecessor = pFormat;
}
@@ -768,8 +768,8 @@ void OFieldDescControl::ArrangeAggregates()
}
// Finally, put the ScrollBars at the top of the z-order
- m_pVertScroll->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
- m_pHorzScroll->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ m_pVertScroll->SetZOrder(NULL, ZOrderFlags::First);
+ m_pHorzScroll->SetZOrder(NULL, ZOrderFlags::First);
}
void OFieldDescControl::ActivateAggregate( EControlType eType )
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 571067e..f5daa40 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -622,7 +622,7 @@ void OJoinTableView::BeginChildMove( OTableWindow* pTabWin, const Point& rMouseP
SetPointer(Pointer(PointerStyle::Move));
Point aMousePos = ScreenToOutputPixel( rMousePos );
m_aDragOffset = aMousePos - pTabWin->GetPosPixel();
- m_pDragWin->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ m_pDragWin->SetZOrder(NULL, ZOrderFlags::First);
m_bTrackingInitiallyMoved = false;
StartTracking();
}
@@ -752,7 +752,7 @@ void OJoinTableView::Tracking( const TrackingEvent& rTEvt )
// position window
EndTracking();
- m_pDragWin->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ m_pDragWin->SetZOrder(NULL, ZOrderFlags::First);
// check, if I really moved
// (this prevents setting the modified-Flag, when there actually was no change0
TTableWindowData::value_type pData = m_pDragWin->GetData();
diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
index 71efb09..a0c3c25 100644
--- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx
+++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx
@@ -288,7 +288,7 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin
if(aIter != GetTabWinMap().end())
{
- aIter->second->SetZOrder(NULL, WINDOW_ZORDER_FIRST);
+ aIter->second->SetZOrder(NULL, ZOrderFlags::First);
aIter->second->GrabFocus();
EnsureVisible(aIter->second);
// no new one
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index 80cbe92..207515f 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -135,17 +135,17 @@ namespace pcr
}
- void OBrowserLine::SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags )
+ void OBrowserLine::SetTabOrder(vcl::Window* pRefWindow, ZOrderFlags nFlags )
{
m_aFtTitle->SetZOrder(pRefWindow,nFlags);
if ( m_pControlWindow )
- m_pControlWindow->SetZOrder( m_aFtTitle.get(), WINDOW_ZORDER_BEHIND );
+ m_pControlWindow->SetZOrder( m_aFtTitle.get(), ZOrderFlags::Behind );
if ( m_pBrowseButton && m_pControlWindow )
- m_pBrowseButton->SetZOrder( m_pControlWindow, WINDOW_ZORDER_BEHIND );
+ m_pBrowseButton->SetZOrder( m_pControlWindow, ZOrderFlags::Behind );
if ( m_pAdditionalBrowseButton && m_pBrowseButton )
- m_pAdditionalBrowseButton->SetZOrder( m_pBrowseButton, WINDOW_ZORDER_BEHIND );
+ m_pAdditionalBrowseButton->SetZOrder( m_pBrowseButton, ZOrderFlags::Behind );
}
diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx
index 9f39ec6..35c2652 100644
--- a/extensions/source/propctrlr/browserline.hxx
+++ b/extensions/source/propctrlr/browserline.hxx
@@ -96,7 +96,7 @@ namespace pcr
bool IsVisible();
vcl::Window* GetRefWindow();
- void SetTabOrder(vcl::Window* pRefWindow, sal_uInt16 nFlags );
+ void SetTabOrder(vcl::Window* pRefWindow, ZOrderFlags nFlags );
bool GrabFocus();
void ShowBrowseButton( const OUString& _rImageURL, bool _bPrimary );
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index f5cfc3b..7f05d13 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -1162,9 +1162,9 @@ namespace pcr
rLine.pLine->IndentTitle( _rPropertyData.IndentLevel > 0 );
if ( nPos > 0 )
- rLine.pLine->SetTabOrder( pRefWindow, WINDOW_ZORDER_BEHIND );
+ rLine.pLine->SetTabOrder( pRefWindow, ZOrderFlags::Behind );
else
- rLine.pLine->SetTabOrder( pRefWindow, WINDOW_ZORDER_FIRST );
+ rLine.pLine->SetTabOrder( pRefWindow, ZOrderFlags::First );
m_aOutOfDateLines.insert( nPos );
rLine.pLine->SetComponentHelpIds(
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index fef38e5..cc5c695 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -182,10 +182,18 @@ namespace o3tl
}
// Flags for SetZOrder()
-#define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001)
-#define WINDOW_ZORDER_BEHIND ((sal_uInt16)0x0002)
-#define WINDOW_ZORDER_FIRST ((sal_uInt16)0x0004)
-#define WINDOW_ZORDER_LAST ((sal_uInt16)0x0008)
+enum class ZOrderFlags
+{
+ NONE = 0x0000,
+ Before = 0x0001,
+ Behind = 0x0002,
+ First = 0x0004,
+ Last = 0x0008,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ZOrderFlags> : is_typed_flags<ZOrderFlags, 0x000f> {};
+}
// Activate-Flags
#define ACTIVATE_MODE_GRABFOCUS ((sal_uInt16)0x0001)
@@ -1005,7 +1013,7 @@ public:
sal_uInt16 GetActivateMode() const;
void ToTop( sal_uInt16 nFlags = 0 );
- void SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags );
+ void SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags );
void EnableAlwaysOnTop( bool bEnable = true );
bool IsAlwaysOnTopEnabled() const;
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 461272e..633427e 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -2309,7 +2309,7 @@ void PropertyControl::setSubControl( PropertySubControl* pSubControl )
if( pControl )
{
pControl->SetPosSizePixel( GetPosPixel(), GetSizePixel() );
- pControl->SetZOrder( this, WINDOW_ZORDER_BEFOR );
+ pControl->SetZOrder( this, ZOrderFlags::Before );
pControl->Show();
Hide();
}
diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx
index 60b7bcb..3de26d6 100644
--- a/sd/source/ui/presenter/PresenterHelper.cxx
+++ b/sd/source/ui/presenter/PresenterHelper.cxx
@@ -183,7 +183,7 @@ void SAL_CALL PresenterHelper::toTop (
if (pWindow != NULL)
{
pWindow->ToTop();
- pWindow->SetZOrder(NULL, WINDOW_ZORDER_LAST);
+ pWindow->SetZOrder(NULL, ZOrderFlags::Last);
}
}
diff --git a/svtools/source/toolpanel/drawerlayouter.cxx b/svtools/source/toolpanel/drawerlayouter.cxx
index c044105..84edff1 100644
--- a/svtools/source/toolpanel/drawerlayouter.cxx
+++ b/svtools/source/toolpanel/drawerlayouter.cxx
@@ -156,12 +156,12 @@ namespace svt
// proper Z-Order
if ( i_nPosition == 0 )
{
- pDrawer->SetZOrder( NULL, WINDOW_ZORDER_FIRST );
+ pDrawer->SetZOrder( NULL, ZOrderFlags::First );
}
else
{
ToolPanelDrawer* pFirstDrawer( m_aDrawers[ i_nPosition - 1 ] );
- pDrawer->SetZOrder( pFirstDrawer, WINDOW_ZORDER_BEHIND );
+ pDrawer->SetZOrder( pFirstDrawer, ZOrderFlags::Behind );
}
pDrawer->Show();
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 548ae88..4884a08 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -143,7 +143,7 @@ SwHeaderFooterWin::SwHeaderFooterWin( SwEditWin* pEditWin, const SwPageFrm* pPag
// Create the line control
m_pLine = VclPtr<SwDashedLine>::Create(GetEditWin(), &SwViewOption::GetHeaderFooterMarkColor);
- m_pLine->SetZOrder(this, WINDOW_ZORDER_BEFOR);
+ m_pLine->SetZOrder(this, ZOrderFlags::Before);
// Create and set the PopupMenu
m_pPopupMenu = new PopupMenu(SW_RES(MN_HEADERFOOTER_BUTTON));
diff --git a/toolkit/source/awt/vclxcontainer.cxx b/toolkit/source/awt/vclxcontainer.cxx
index aff9623..448a09f 100644
--- a/toolkit/source/awt/vclxcontainer.cxx
+++ b/toolkit/source/awt/vclxcontainer.cxx
@@ -143,7 +143,7 @@ void VCLXContainer::setTabOrder( const ::com::sun::star::uno::Sequence< ::com::s
// Order windows before manipulating their style, because elements such as the
// RadioButton considers the PREV-window in StateChanged.
if ( pPrevWin )
- pWin->SetZOrder( pPrevWin, WINDOW_ZORDER_BEHIND );
+ pWin->SetZOrder( pPrevWin, ZOrderFlags::Behind );
WinBits nStyle = pWin->GetStyle();
nStyle &= ~(WB_TABSTOP|WB_NOTABSTOP|WB_GROUP);
@@ -198,7 +198,7 @@ void VCLXContainer::setGroup( const ::com::sun::star::uno::Sequence< ::com::sun:
// Z-Order
if ( pSortBehind )
- pWin->SetZOrder( pSortBehind, WINDOW_ZORDER_BEHIND );
+ pWin->SetZOrder( pSortBehind, ZOrderFlags::Behind );
WinBits nStyle = pWin->GetStyle();
if ( n == 0 )
diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx
index bb0f0a3..102f5ce 100644
--- a/vcl/source/window/btndlg.cxx
+++ b/vcl/source/window/btndlg.cxx
@@ -240,7 +240,7 @@ void ButtonDialog::StateChanged( StateChangedType nType )
for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it)
{
if ( it->mpPushButton && it->mbOwnButton )
- it->mpPushButton->SetZOrder(0, WINDOW_ZORDER_LAST);
+ it->mpPushButton->SetZOrder(0, ZOrderFlags::Last);
}
// Set focus on default button.
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index 3d4fabb..596f49a 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -443,7 +443,7 @@ void Window::ToTop( sal_uInt16 nFlags )
ImplFocusToTop( nFlags, IsReallyVisible() );
}
-void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
+void Window::SetZOrder( vcl::Window* pRefWindow, ZOrderFlags nFlags )
{
if ( mpWindowImpl->mpBorderWindow )
@@ -452,21 +452,21 @@ void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
return;
}
- if ( nFlags & WINDOW_ZORDER_FIRST )
+ if ( nFlags & ZOrderFlags::First )
{
if ( ImplIsOverlapWindow() )
pRefWindow = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap;
else
pRefWindow = mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild;
- nFlags |= WINDOW_ZORDER_BEFOR;
+ nFlags |= ZOrderFlags::Before;
}
- else if ( nFlags & WINDOW_ZORDER_LAST )
+ else if ( nFlags & ZOrderFlags::Last )
{
if ( ImplIsOverlapWindow() )
pRefWindow = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap;
else
pRefWindow = mpWindowImpl->mpParent->mpWindowImpl->mpLastChild;
- nFlags |= WINDOW_ZORDER_BEHIND;
+ nFlags |= ZOrderFlags::Behind;
}
while ( pRefWindow && pRefWindow->mpWindowImpl->mpBorderWindow )
@@ -475,7 +475,7 @@ void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
return;
DBG_ASSERT( pRefWindow->mpWindowImpl->mpParent == mpWindowImpl->mpParent, "Window::SetZOrder() - pRefWindow has other parent" );
- if ( nFlags & WINDOW_ZORDER_BEFOR )
+ if ( nFlags & ZOrderFlags::Before )
{
if ( pRefWindow->mpWindowImpl->mpPrev.get() == this )
return;
@@ -513,7 +513,7 @@ void Window::SetZOrder( vcl::Window* pRefWindow, sal_uInt16 nFlags )
mpWindowImpl->mpPrev->mpWindowImpl->mpNext = this;
mpWindowImpl->mpNext->mpWindowImpl->mpPrev = this;
}
- else if ( nFlags & WINDOW_ZORDER_BEHIND )
+ else if ( nFlags & ZOrderFlags::Behind )
{
if ( pRefWindow->mpWindowImpl->mpNext.get() == this )
return;
commit b419da0f53cf7f65b1d0c58351176ece23fbfe1f
Author: Noel Grandin <noel at peralex.com>
Date: Fri May 22 12:49:04 2015 +0200
convert SHOW constants to scoped enum
Change-Id: I2712a0901049885502cade31f9757f712048bb33
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 6211bcc..54c944d 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -196,7 +196,7 @@ void MacroEventListBox::ConnectElements()
maListBox->InitHeaderBar( maHeaderBar.get() );
}
-void MacroEventListBox::Show( bool bVisible, sal_uInt16 nFlags )
+void MacroEventListBox::Show( bool bVisible, ShowFlags nFlags )
{
maListBox->Show( bVisible, nFlags );
maHeaderBar->Show( bVisible, nFlags );
diff --git a/cui/source/inc/headertablistbox.hxx b/cui/source/inc/headertablistbox.hxx
index f63eba3..59037ed 100644
--- a/cui/source/inc/headertablistbox.hxx
+++ b/cui/source/inc/headertablistbox.hxx
@@ -52,7 +52,7 @@ public:
void ConnectElements();/**< should be called after all manipulations on elements are done
calcs real sizes depending on sizes of this */
- void Show( bool bVisible = true, sal_uInt16 nFlags = 0 ); ///< same meaning as Windows::Show()
+ void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NONE ); ///< same meaning as Windows::Show()
void Enable( bool bEnable = true, bool bChild = true ); ///< same meaning as Windows::Enable()
};
diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx
index 10ef520..389c39d 100644
--- a/extensions/source/update/ui/updatecheckui.cxx
+++ b/extensions/source/update/ui/updatecheckui.cxx
@@ -112,7 +112,7 @@ public:
virtual void MouseButtonDown( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
void Resize() SAL_OVERRIDE;
- void Show( bool bVisible = true, sal_uInt16 nFlags = SHOW_NOACTIVATE );
+ void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NoActivate );
void SetTipPosPixel( const Point& rTipPos ) { maTipPos = rTipPos; }
void SetTitleAndText( const OUString& rTitle, const OUString& rText,
const Image& rImage );
@@ -862,7 +862,7 @@ void BubbleWindow::MouseButtonDown( const MouseEvent& )
}
-void BubbleWindow::Show( bool bVisible, sal_uInt16 nFlags )
+void BubbleWindow::Show( bool bVisible, ShowFlags nFlags )
{
SolarMutexGuard aGuard;
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index 3b4001a..8c640a8 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -377,7 +377,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
if ( pWindow )
{
bool bForceFrontAndFocus(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext));
- pWindow->Show(true, bForceFrontAndFocus ? SHOW_FOREGROUNDTASK : 0 );
+ pWindow->Show(true, bForceFrontAndFocus ? ShowFlags::ForegroundTask : ShowFlags::NONE );
}
}
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index cd69324..76dfc71 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -1660,7 +1660,7 @@ throw (uno::RuntimeException, std::exception)
vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow );
if ( pWindow )
{
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
bResult = true;
bNotify = true;
}
diff --git a/framework/source/layoutmanager/toolbarlayoutmanager.cxx b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
index 1b1b9fc..40a62d9 100644
--- a/framework/source/layoutmanager/toolbarlayoutmanager.cxx
+++ b/framework/source/layoutmanager/toolbarlayoutmanager.cxx
@@ -675,7 +675,7 @@ bool ToolbarLayoutManager::showToolbar( const OUString& rResourceURL )
if ( !aUIElement.m_bFloating )
implts_setLayoutDirty();
else
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
aUIElement.m_bVisible = true;
implts_writeWindowStateData( aUIElement );
@@ -755,7 +755,7 @@ void ToolbarLayoutManager::setFloatingToolbarsVisibility( bool bVisible )
if ( bVisible )
{
if ( pIter->m_bVisible && !pIter->m_bMasterHide )
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
else
pWindow->Show( false );
@@ -789,7 +789,7 @@ void ToolbarLayoutManager::setVisible( bool bVisible )
else
{
if ( pIter->m_bFloating )
- pWindow->Show(true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show(true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
}
}
@@ -1479,7 +1479,7 @@ void ToolbarLayoutManager::implts_setElementData( UIElement& rElement, const uno
if ( bShowElement && pWindow )
{
SolarMutexGuard aGuard;
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
}
else
@@ -2542,7 +2542,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn(
if ( aWinRect.X < nCurrPos )
aWinRect.X = nCurrPos;
pWindow->SetPosSizePixel( ::Point( aWinRect.X, nOffset ), ::Size( aWinRect.Width, rRowColumnWindowData.nStaticSize ));
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
nCurrPos += ( aWinRect.X - nCurrPos ) + aWinRect.Width;
}
else
@@ -2550,7 +2550,7 @@ void ToolbarLayoutManager::implts_calcWindowPosSizeOnSingleRowColumn(
if ( aWinRect.Y < nCurrPos )
aWinRect.Y = nCurrPos;
pWindow->SetPosSizePixel( ::Point( nOffset, aWinRect.Y ), ::Size( rRowColumnWindowData.nStaticSize, aWinRect.Height ));
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
nCurrPos += ( aWinRect.Y - nCurrPos ) + aWinRect.Height;
}
}
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 4261971..f349ea6 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -1667,7 +1667,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X
if( pWindow->IsVisible() && (bForceFrontAndFocus || bForceToFront) )
pWindow->ToTop();
else
- pWindow->Show(true, (bForceFrontAndFocus || bForceToFront) ? SHOW_FOREGROUNDTASK : 0 );
+ pWindow->Show(true, (bForceFrontAndFocus || bForceToFront) ? ShowFlags::ForegroundTask : ShowFlags::NONE );
}
}
diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx
index 44c87bb..8e8d814 100644
--- a/framework/source/tabwin/tabwindow.cxx
+++ b/framework/source/tabwin/tabwindow.cxx
@@ -393,12 +393,12 @@ throw (css::uno::Exception, css::uno::RuntimeException, std::exception)
pWindow = VCLUnoHelper::GetWindow( xContainerWindow );
if ( pWindow )
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
pWindow = VCLUnoHelper::GetWindow( xTabControl );
if ( pWindow )
{
- pWindow->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pWindow->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
TabControl* pTabControl = static_cast<TabControl *>(pWindow);
pTabControl->SetActivatePageHdl( LINK( this, TabWindow, Activate ));
pTabControl->SetDeactivatePageHdl( LINK( this, TabWindow, Deactivate ));
diff --git a/framework/source/uielement/progressbarwrapper.cxx b/framework/source/uielement/progressbarwrapper.cxx
index b441d83..d753b9e 100644
--- a/framework/source/uielement/progressbarwrapper.cxx
+++ b/framework/source/uielement/progressbarwrapper.cxx
@@ -118,7 +118,7 @@ void ProgressBarWrapper::start( const OUString& Text, ::sal_Int32 Range )
pStatusBar->SetProgressValue( sal_uInt16( nValue ));
pStatusBar->SetUpdateMode( true );
}
- pStatusBar->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pStatusBar->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
}
}
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index eb43f8e..cffb5b6 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -183,7 +183,7 @@ public:
Point GetPosPixel()
{ return pWindow->GetPosPixel(); }
virtual void Hide();
- virtual void Show( sal_uInt16 nFlags );
+ virtual void Show( ShowFlags nFlags );
SfxChildWindowFlags GetFlags() const
{ return GetInfo().nFlags; }
bool CanGetFocus() const;
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 138a283..fef38e5 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -168,10 +168,18 @@ namespace o3tl
}
// Flags for Show()
-#define SHOW_NOPARENTUPDATE ((sal_uInt16)0x0001)
-#define SHOW_NOFOCUSCHANGE ((sal_uInt16)0x0002)
-#define SHOW_NOACTIVATE ((sal_uInt16)0x0004)
-#define SHOW_FOREGROUNDTASK ((sal_uInt16)0x0008)
+enum class ShowFlags
+{
+ NONE = 0x0000,
+ NoParentUpdate = 0x0001,
+ NoFocusChange = 0x0002,
+ NoActivate = 0x0004,
+ ForegroundTask = 0x0008,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ShowFlags> : is_typed_flags<ShowFlags, 0x000f> {};
+}
// Flags for SetZOrder()
#define WINDOW_ZORDER_BEFOR ((sal_uInt16)0x0001)
@@ -912,7 +920,7 @@ public:
// return the dialog we are contained in or NULL if un-contained
Dialog* GetParentDialog() const;
- void Show( bool bVisible = true, sal_uInt16 nFlags = 0 );
+ void Show( bool bVisible = true, ShowFlags nFlags = ShowFlags::NONE );
void Hide() { Show( false ); }
bool IsVisible() const;
bool IsReallyVisible() const;
diff --git a/sc/source/ui/inc/reffact.hxx b/sc/source/ui/inc/reffact.hxx
index 4dee934..83a29f6 100644
--- a/sc/source/ui/inc/reffact.hxx
+++ b/sc/source/ui/inc/reffact.hxx
@@ -182,7 +182,7 @@ public:
bool LockVisible( bool bLock ){ bool bVis = m_bVisibleLock; m_bVisibleLock = bLock; return bVis; }
bool LockFreeWindow( bool bLock ){ bool bFreeWindow = m_bFreeWindowLock; m_bFreeWindowLock = bLock; return bFreeWindow; }
void Hide() SAL_OVERRIDE { if( !m_bVisibleLock) SfxChildWindow::Hide(); }
- void Show( sal_uInt16 nFlags ) SAL_OVERRIDE { if( !m_bVisibleLock ) SfxChildWindow::Show( nFlags ); }
+ void Show( ShowFlags nFlags ) SAL_OVERRIDE { if( !m_bVisibleLock ) SfxChildWindow::Show( nFlags ); }
};
#endif // INCLUDED_SC_SOURCE_UI_INC_REFFACT_HXX
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index a735b72..125a69b 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -665,7 +665,7 @@ void SfxChildWindow::Hide()
}
}
-void SfxChildWindow::Show( sal_uInt16 nFlags )
+void SfxChildWindow::Show( ShowFlags nFlags )
{
switch ( pWindow->GetType() )
{
diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index b9999cb..8766b25 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1065,7 +1065,7 @@ void SfxWorkWindow::ShowChildren_Impl()
if ( SfxChildVisibility::VISIBLE == (pCli->nVisible & SfxChildVisibility::VISIBLE) && bVisible )
{
- sal_uInt16 nFlags = pCli->bSetFocus ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE;
+ ShowFlags nFlags = pCli->bSetFocus ? ShowFlags::NONE : ShowFlags::NoFocusChange | ShowFlags::NoActivate;
switch ( pCli->pWin->GetType() )
{
case RSC_DOCKINGWINDOW :
@@ -1672,7 +1672,7 @@ void SfxWorkWindow::HidePopups_Impl(bool bHide, bool bParent, sal_uInt16 nId )
{
pChild->nVisible |= SfxChildVisibility::ACTIVE;
if ( SfxChildVisibility::VISIBLE == (pChild->nVisible & SfxChildVisibility::VISIBLE) )
- pCW->Show( SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pCW->Show( ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
}
}
@@ -1741,7 +1741,7 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild,
pWin = pSplitWin->GetSplitWindow();
if ( pSplitWin->GetWindowCount() == 1 )
- static_cast<SplitWindow*>(pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ static_cast<SplitWindow*>(pWin)->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
}
@@ -2265,7 +2265,7 @@ void SfxWorkWindow::ShowChildWindow_Impl(sal_uInt16 nId, bool bVisible, bool bSe
{
pCW->pCli->bSetFocus = bSetFocus;
pCW->pCli->nVisible = SfxChildVisibility::VISIBLE;
- pChildWin->Show( bSetFocus && pChildWin->WantsFocus() ? 0 : SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ pChildWin->Show( bSetFocus && pChildWin->WantsFocus() ? ShowFlags::NONE : ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
else
static_cast<SfxDockingWindow*>(pChildWin->GetWindow())->Reappear_Impl();
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index 83c68dc..2d6a8a4 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -765,7 +765,7 @@ void SfxDockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode )
// before Show() is called must the reassignment have been made,
// therefore the base class can not be called
if ( IsFloatingMode() || !pImp->bSplitable )
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
// Set the size for toggling.
pImp->aSplitSize = rRect.GetSize();
@@ -773,7 +773,7 @@ void SfxDockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode )
{
SetFloatingMode( bFloatMode );
if ( IsFloatingMode() || !pImp->bSplitable )
- Show( true, SHOW_NOFOCUSCHANGE );
+ Show( true, ShowFlags::NoFocusChange );
}
else
{
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 5119f608..0283020 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1365,7 +1365,7 @@ void SfxPopupWindow::StateChanged(
}
else if ( m_bFloating )
{
- Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
}
diff --git a/vcl/README.lifecycle b/vcl/README.lifecycle
index 55ec160..6b5cbd6 100644
--- a/vcl/README.lifecycle
+++ b/vcl/README.lifecycle
@@ -25,7 +25,7 @@ various means such as DogTags to try to detect destruction of a window
between calls:
ImplDelData aDogTag( this ); // 'orrible old code
- Show( true, SHOW_NOACTIVATE );
+ Show( true, ShowFlags::NoActivate );
if( !aDogTag.IsDead() ) // did 'this' go invalid yet ?
Update();
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 7014a79..0ad533a 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -352,7 +352,7 @@ void HelpTextWindow::SetHelpText( const OUString& rHelpText )
void HelpTextWindow::ImplShow()
{
ImplDelData aDogTag( this );
- Show( true, SHOW_NOACTIVATE );
+ Show( true, ShowFlags::NoActivate );
if( !aDogTag.IsDead() )
Update();
}
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index 52708dd..84a0834 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -833,7 +833,7 @@ ImplDockingWindowWrapper::~ImplDockingWindowWrapper()
{
if ( IsFloatingMode() )
{
- GetWindow()->Show( false, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( false, ShowFlags::NoFocusChange );
SetFloatingMode( false );
}
}
@@ -1009,7 +1009,7 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, bool bFloatMo
bool bShow = false;
if ( bFloatMode != IsFloatingMode() )
{
- GetWindow()->Show( false, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( false, ShowFlags::NoFocusChange );
SetFloatingMode( bFloatMode );
bShow = true;
if ( bFloatMode )
@@ -1027,7 +1027,7 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, bool bFloatMo
}
if ( bShow )
- GetWindow()->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
EndDockingData data( aRect, IsFloatingMode(), IsDockingCanceled() );
@@ -1104,7 +1104,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin
if( IsFloatingMode() )
return;
- GetWindow()->Show( false, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( false, ShowFlags::NoFocusChange );
// prepare reparenting
vcl::Window* pRealParent = GetWindow()->GetWindow( GetWindowType::Parent );
@@ -1161,7 +1161,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, FloatWin
IMPL_LINK_NOARG(ImplDockingWindowWrapper, PopupModeEnd)
{
- GetWindow()->Show( false, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( false, ShowFlags::NoFocusChange );
// set parameter for handler before destroying floating window
ImplPopupFloatWin *pPopupFloatWin = static_cast<ImplPopupFloatWin*>(mpFloatWin.get());
@@ -1212,7 +1212,7 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode )
if ( bFloatMode )
{
- GetWindow()->Show( false, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( false, ShowFlags::NoFocusChange );
maDockPos = GetWindow()->GetPosPixel();
@@ -1265,13 +1265,13 @@ void ImplDockingWindowWrapper::SetFloatingMode( bool bFloatMode )
mpFloatWin = pWin;
if ( bVisible )
- GetWindow()->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ GetWindow()->Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
ToggleFloatingMode();
}
else
{
- GetWindow()->Show( false, SHOW_NOFOCUSCHANGE );
+ GetWindow()->Show( false, ShowFlags::NoFocusChange );
// store FloatingData in FloatingWindow
maFloatPos = mpFloatWin->GetPosPixel();
diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index e76b1c6..348af89 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -476,7 +476,7 @@ void DockingWindow::dispose()
{
if ( IsFloatingMode() )
{
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
SetFloatingMode( false );
}
delete mpImplData;
@@ -675,7 +675,7 @@ void DockingWindow::EndDocking( const Rectangle& rRect, bool bFloatMode )
bool bShow = false;
if ( bool(bFloatMode) != IsFloatingMode() )
{
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
SetFloatingMode( bFloatMode );
bShow = true;
if ( bFloatMode && mpFloatWin )
@@ -711,7 +711,7 @@ bool DockingWindow::Close()
if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
return false;
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
return true;
}
@@ -790,7 +790,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode )
if ( bFloatMode )
{
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
sal_Int32 nBorderWidth = get_border_width();
@@ -852,7 +852,7 @@ void DockingWindow::SetFloatingMode( bool bFloatMode )
}
else
{
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
sal_Int32 nBorderWidth = get_border_width();
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 6e4f2a5..28a40d0 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -639,7 +639,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags
{
// avoid flickering
if ( IsVisible() )
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
if ( IsRollUp() )
RollDown();
@@ -713,7 +713,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags
// force key input even without focus (useful for menus)
mbGrabFocus = true;
}
- Show( true, SHOW_NOACTIVATE );
+ Show( true, ShowFlags::NoActivate );
}
void FloatingWindow::StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags )
@@ -784,7 +784,7 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, sal_uLong n
if ( !(nFlags & FloatWinPopupEndFlags::TearOff) ||
!(nPopupModeFlags & FloatWinPopupFlags::AllowTearOff) )
{
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
// maybe pass focus on to a suitable FloatingWindow
if ( nFocusId )
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index dc0f78e..3d4fabb 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -413,7 +413,7 @@ void Window::ImplShowAllOverlaps()
{
if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible )
{
- pOverlapWindow->Show( true, SHOW_NOACTIVATE );
+ pOverlapWindow->Show( true, ShowFlags::NoActivate );
pOverlapWindow->mpWindowImpl->mbOverlapVisible = false;
}
@@ -901,7 +901,7 @@ void Window::SetParent( vcl::Window* pNewParent )
mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
bool bVisible = IsVisible();
- Show( false, SHOW_NOFOCUSCHANGE );
+ Show( false, ShowFlags::NoFocusChange );
// check if the overlap window changes
vcl::Window* pOldOverlapWindow;
@@ -1017,7 +1017,7 @@ void Window::SetParent( vcl::Window* pNewParent )
ImplGetOwnerDrawList().push_back( this );
if ( bVisible )
- Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE );
+ Show( true, ShowFlags::NoFocusChange | ShowFlags::NoActivate );
}
sal_uInt16 Window::GetChildCount() const
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 8a5e8c7..a916bc6 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -2272,7 +2272,7 @@ vcl::Font Window::GetPointFont(vcl::RenderContext& rRenderContext) const
return aFont;
}
-void Window::Show(bool bVisible, sal_uInt16 nFlags)
+void Window::Show(bool bVisible, ShowFlags nFlags)
{
if ( IsDisposed() || mpWindowImpl->mbVisible == bVisible )
return;
@@ -2332,7 +2332,7 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags)
if ( ImplIsOverlapWindow() && !mpWindowImpl->mbFrame )
{
// convert focus
- if ( !(nFlags & SHOW_NOFOCUSCHANGE) && HasChildPathFocus() )
+ if ( !(nFlags & ShowFlags::NoFocusChange) && HasChildPathFocus() )
{
if ( mpWindowImpl->mpOverlapWindow->IsEnabled() &&
mpWindowImpl->mpOverlapWindow->IsInputEnabled() &&
@@ -2361,7 +2361,7 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags)
aBounds.Bottom() += workaround_border;
aInvRegion = aBounds;
}
- if ( !mpWindowImpl->mbNoParentUpdate && !(nFlags & SHOW_NOPARENTUPDATE) )
+ if ( !mpWindowImpl->mbNoParentUpdate && !(nFlags & ShowFlags::NoParentUpdate) )
{
if ( !aInvRegion.IsEmpty() )
ImplInvalidateParentFrameRegion( aInvRegion );
@@ -2405,9 +2405,9 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags)
// If it is a SystemWindow it automatically pops up on top of
// all other windows if needed.
- if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) )
+ if ( ImplIsOverlapWindow() && !(nFlags & ShowFlags::NoActivate) )
{
- ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 );
+ ImplStartToTop(( nFlags & ShowFlags::ForegroundTask ) ? TOTOP_FOREGROUNDTASK : 0 );
ImplFocusToTop( 0, false );
}
@@ -2455,7 +2455,7 @@ void Window::Show(bool bVisible, sal_uInt16 nFlags)
mpWindowImpl->mbPaintFrame = true;
if (!Application::GetSettings().GetMiscSettings().GetPseudoHeadless())
{
- bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) != 0;
+ bool bNoActivate(nFlags & (ShowFlags::NoActivate|ShowFlags::NoFocusChange));
mpWindowImpl->mpFrame->Show( true, bNoActivate );
}
if( aDogTag.IsDead() )
diff --git a/vcl/unx/generic/app/i18n_status.cxx b/vcl/unx/generic/app/i18n_status.cxx
index 896d345..f7070e5 100644
--- a/vcl/unx/generic/app/i18n_status.cxx
+++ b/vcl/unx/generic/app/i18n_status.cxx
@@ -246,7 +246,7 @@ void XIMStatusWindow::setPosition( SalFrame* pParent )
{
setText( OUString() );
m_pLastParent = pParent;
- Show( false, SHOW_NOACTIVATE );
+ Show( false, ShowFlags::NoActivate );
}
if( IsVisible() )
{
@@ -270,7 +270,7 @@ IMPL_LINK_NOARG(XIMStatusWindow, DelayedShowHdl)
Point aPoint = updatePosition();
pStatusFrame->SetPosSize( aPoint.X(), aPoint.Y(), m_aWindowSize.Width(), m_aWindowSize.Height(), SAL_FRAME_POSSIZE_X | SAL_FRAME_POSSIZE_Y | SAL_FRAME_POSSIZE_WIDTH | SAL_FRAME_POSSIZE_HEIGHT );
}
- Show( m_bDelayedShow && m_bOn, SHOW_NOACTIVATE );
+ Show( m_bDelayedShow && m_bOn, ShowFlags::NoActivate );
if( m_bDelayedShow )
{
XRaiseWindow( static_cast<Display*>(pData->pDisplay),
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index a80409a..7bc6270 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1531,7 +1531,7 @@ class DemoPopup : public FloatingWindow
SetOutputSizePixel( Size( 300, 30 ) );
SetBackground(Wallpaper(COL_YELLOW));
- Show( true, SHOW_NOACTIVATE );
+ Show( true, ShowFlags::NoActivate );
Update();
}
More information about the Libreoffice-commits
mailing list