fdo#84938: replace SYSTEMWINDOW_MODE constants with 'enum class'
Change-Id: I1c761482cb78efc26d3beda75381557268e1bc0d
This commit is contained in:
@@ -1207,8 +1207,8 @@ sal_uInt16 Desktop::Exception(sal_uInt16 nError)
|
||||
// protect against recursive calls
|
||||
static bool bInException = false;
|
||||
|
||||
sal_uInt16 nOldMode = Application::GetSystemWindowMode();
|
||||
Application::SetSystemWindowMode( nOldMode & ~SYSTEMWINDOW_MODE_NOAUTOMODE );
|
||||
SystemWindowFlags nOldMode = Application::GetSystemWindowMode();
|
||||
Application::SetSystemWindowMode( nOldMode & ~SystemWindowFlags::NOAUTOMODE );
|
||||
Application::SetDefDialogParent( NULL );
|
||||
|
||||
if ( bInException )
|
||||
@@ -1576,7 +1576,7 @@ int Desktop::Main()
|
||||
SetSplashScreenProgress(75);
|
||||
|
||||
// use system window dialogs
|
||||
Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_DIALOG );
|
||||
Application::SetSystemWindowMode( SystemWindowFlags::DIALOG );
|
||||
|
||||
SetSplashScreenProgress(80);
|
||||
|
||||
|
@@ -39,6 +39,7 @@
|
||||
#include <vcl/vclevent.hxx>
|
||||
#include <vcl/metric.hxx>
|
||||
#include <unotools/localedatawrapper.hxx>
|
||||
#include <o3tl/typed_flags_set.hxx>
|
||||
|
||||
class BitmapEx;
|
||||
class Link;
|
||||
@@ -84,12 +85,18 @@ namespace awt {
|
||||
VCL_DLLPUBLIC sal_UCS4 GetMirroredChar( sal_UCS4 );
|
||||
VCL_DLLPUBLIC sal_UCS4 GetLocalizedChar( sal_UCS4, LanguageType );
|
||||
|
||||
#define SYSTEMWINDOW_MODE_NOAUTOMODE ((sal_uInt16)0x0001)
|
||||
#define SYSTEMWINDOW_MODE_DIALOG ((sal_uInt16)0x0002)
|
||||
enum class SystemWindowFlags {
|
||||
NOAUTOMODE = 0x0001,
|
||||
DIALOG = 0x0002
|
||||
};
|
||||
namespace o3tl
|
||||
{
|
||||
template<> struct typed_flags<SystemWindowFlags> : is_typed_flags<SystemWindowFlags, 0x03> {};
|
||||
}
|
||||
|
||||
typedef long (*VCLEventHookProc)( NotifyEvent& rEvt, void* pData );
|
||||
|
||||
/** An application can be notified of a number of different events:
|
||||
/** An application can be notified of a number of different events:
|
||||
- TYPE_ACCEPT - listen for connection to the application (a connection
|
||||
string is passed via the event)
|
||||
- TYPE_UNACCEPT - stops listening for a connection to the app (determined by
|
||||
@@ -1287,20 +1294,20 @@ public:
|
||||
|
||||
/** Make a dialog box a system window or not.
|
||||
|
||||
@param nMode Can be either: SYSTEMWINDOW_MODE_NOAUTOMODE (0x0001) or
|
||||
SYSTEMWINDOW_MODE_DIALOG (0x0002)
|
||||
@param nMode Can be either: SystemWindowFlags::NOAUTOMODE (0x0001) or
|
||||
SystemWindowFlags::DIALOG (0x0002)
|
||||
|
||||
@see GetSystemWindowMode
|
||||
*/
|
||||
static void SetSystemWindowMode( sal_uInt16 nMode );
|
||||
static void SetSystemWindowMode( SystemWindowFlags nMode );
|
||||
|
||||
/** Get the system window mode of dialogs.
|
||||
|
||||
@returns SYSTEMWINDOW_MODE_NOAUTOMODE (0x0001) or SYSTEMWINDOW_MODE_DIALOG (0x0002)
|
||||
@returns SystemWindowFlags::NOAUTOMODE (0x0001) or SystemWindowFlags::DIALOG (0x0002)
|
||||
|
||||
@see SetSystemWindowMode
|
||||
*/
|
||||
static sal_uInt16 GetSystemWindowMode();
|
||||
static SystemWindowFlags GetSystemWindowMode();
|
||||
|
||||
|
||||
/** Set a dialog scaling factor. Used for localization.
|
||||
|
@@ -209,7 +209,7 @@ SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId,
|
||||
{
|
||||
SfxChildWindow *pChild=0;
|
||||
SfxChildWinFactory* pFact=0;
|
||||
sal_uInt16 nOldMode = Application::GetSystemWindowMode();
|
||||
SystemWindowFlags nOldMode = Application::GetSystemWindowMode();
|
||||
|
||||
// First search for ChildWindow in SDT; Overlay windows are realized
|
||||
// by using ChildWindowContext
|
||||
@@ -227,7 +227,7 @@ SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId,
|
||||
if ( pBindings )
|
||||
pBindings->ENTERREGISTRATIONS();
|
||||
SfxChildWinInfo aInfo = rFactInfo;
|
||||
Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_NOAUTOMODE );
|
||||
Application::SetSystemWindowMode( SystemWindowFlags::NOAUTOMODE );
|
||||
pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo );
|
||||
Application::SetSystemWindowMode( nOldMode );
|
||||
if ( pBindings )
|
||||
@@ -258,7 +258,7 @@ SfxChildWindow* SfxChildWindow::CreateChildWindow( sal_uInt16 nId,
|
||||
if ( pBindings )
|
||||
pBindings->ENTERREGISTRATIONS();
|
||||
SfxChildWinInfo aInfo = rFactInfo;
|
||||
Application::SetSystemWindowMode( SYSTEMWINDOW_MODE_NOAUTOMODE );
|
||||
Application::SetSystemWindowMode( SystemWindowFlags::NOAUTOMODE );
|
||||
pChild = pFact->pCtor( pParent, nId, pBindings, &aInfo );
|
||||
Application::SetSystemWindowMode( nOldMode );
|
||||
if ( pBindings )
|
||||
|
@@ -129,7 +129,7 @@ struct ImplSVAppData
|
||||
sal_uInt16 mnModalMode; // ModalMode Count
|
||||
sal_uInt16 mnModalDialog; // ModalDialog Count
|
||||
sal_uInt16 mnAccessCount; // AccessHdl Count
|
||||
sal_uInt16 mnSysWinMode; // Mode, when SystemWindows should be created
|
||||
SystemWindowFlags mnSysWinMode; // Mode, when SystemWindows should be created
|
||||
short mnDialogScaleX; // Scale X-Positions and sizes in Dialogs
|
||||
bool mbInAppMain; // is Application::Main() on stack
|
||||
bool mbInAppExecute; // is Application::Execute() on stack
|
||||
|
@@ -1352,12 +1352,12 @@ bool Application::IsDialogCancelEnabled()
|
||||
return ImplGetSVData()->maAppData.meDialogCancel != DIALOG_CANCEL_OFF;
|
||||
}
|
||||
|
||||
void Application::SetSystemWindowMode( sal_uInt16 nMode )
|
||||
void Application::SetSystemWindowMode( SystemWindowFlags nMode )
|
||||
{
|
||||
ImplGetSVData()->maAppData.mnSysWinMode = nMode;
|
||||
}
|
||||
|
||||
sal_uInt16 Application::GetSystemWindowMode()
|
||||
SystemWindowFlags Application::GetSystemWindowMode()
|
||||
{
|
||||
return ImplGetSVData()->maAppData.mnSysWinMode;
|
||||
}
|
||||
|
@@ -130,8 +130,8 @@ oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo
|
||||
ImplSVData* pSVData = ImplGetSVData();
|
||||
if ( pSVData->mpApp )
|
||||
{
|
||||
sal_uInt16 nOldMode = Application::GetSystemWindowMode();
|
||||
Application::SetSystemWindowMode( nOldMode & ~SYSTEMWINDOW_MODE_NOAUTOMODE );
|
||||
SystemWindowFlags nOldMode = Application::GetSystemWindowMode();
|
||||
Application::SetSystemWindowMode( nOldMode & ~SystemWindowFlags::NOAUTOMODE );
|
||||
pSVData->mpApp->Exception( nVCLException );
|
||||
Application::SetSystemWindowMode( nOldMode );
|
||||
}
|
||||
|
@@ -359,7 +359,7 @@ void Dialog::ImplInitDialogData()
|
||||
|
||||
void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle )
|
||||
{
|
||||
sal_uInt16 nSysWinMode = Application::GetSystemWindowMode();
|
||||
SystemWindowFlags nSysWinMode = Application::GetSystemWindowMode();
|
||||
|
||||
if ( !(nStyle & WB_NODIALOGCONTROL) )
|
||||
nStyle |= WB_DIALOGCONTROL;
|
||||
@@ -401,8 +401,8 @@ void Dialog::ImplInit( vcl::Window* pParent, WinBits nStyle )
|
||||
pParent = NULL;
|
||||
|
||||
if ( !pParent || (nStyle & WB_SYSTEMWINDOW) ||
|
||||
(pParent->mpWindowImpl->mpFrameData->mbNeedSysWindow && !(nSysWinMode & SYSTEMWINDOW_MODE_NOAUTOMODE)) ||
|
||||
(nSysWinMode & SYSTEMWINDOW_MODE_DIALOG) )
|
||||
(pParent->mpWindowImpl->mpFrameData->mbNeedSysWindow && !(nSysWinMode & SystemWindowFlags::NOAUTOMODE)) ||
|
||||
(nSysWinMode & SystemWindowFlags::DIALOG) )
|
||||
{
|
||||
// create window with a small border ?
|
||||
if ( (nStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE)) == WB_BORDER )
|
||||
|
Reference in New Issue
Block a user