summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-21 12:48:36 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-02-05 20:32:52 -0500
commit3472060f08317a615abce293a136f1a358e506c3 (patch)
tree1a76f0a239c51af840150a153d310d23940ac83f
parentf372a783d7c3f35b6411e6c7a0b648f73d5248e1 (diff)
convert MENUBAR_MODE constants to scoped enum
Change-Id: Ie4cda46d02e82cca1710603cfb3af379c702d9d7 (cherry picked from commit 5b248f1348260f953686b20621255aece57358fe)
-rw-r--r--include/vcl/syswin.hxx12
-rw-r--r--sd/source/ui/framework/factories/FullScreenPane.cxx2
-rw-r--r--sfx2/source/dialog/backingcomp.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx2
-rw-r--r--vcl/source/window/syswin.cxx6
5 files changed, 13 insertions, 11 deletions
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 9dd1e4fb9b69..875586dbc44b 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -115,8 +115,10 @@ public:
// - SystemWindow-Types -
-#define MENUBAR_MODE_NORMAL ((sal_uInt16)0)
-#define MENUBAR_MODE_HIDE ((sal_uInt16)1)
+enum class MenuBarMode
+{
+ Normal, Hide
+};
enum class TitleButton
{
@@ -146,7 +148,7 @@ private:
bool mbSysChild;
bool mbIsCalculatingInitialLayoutSize;
bool mbInitialLayoutDone;
- sal_uInt16 mnMenuBarMode;
+ MenuBarMode mnMenuBarMode;
sal_uInt16 mnIcon;
ImplData* mpImplData;
Idle maLayoutIdle;
@@ -225,8 +227,8 @@ public:
void SetMenuBar(MenuBar* pMenuBar, const css::uno::Reference<css::frame::XFrame>& rFrame = css::uno::Reference<css::frame::XFrame>());
MenuBar* GetMenuBar() const { return mpMenuBar; }
- void SetMenuBarMode( sal_uInt16 nMode );
- sal_uInt16 GetMenuBarMode() const { return mnMenuBarMode; }
+ void SetMenuBarMode( MenuBarMode nMode );
+ MenuBarMode GetMenuBarMode() const { return mnMenuBarMode; }
TaskPaneList* GetTaskPaneList();
void GetWindowStateData( WindowStateData& rData ) const;
diff --git a/sd/source/ui/framework/factories/FullScreenPane.cxx b/sd/source/ui/framework/factories/FullScreenPane.cxx
index b1540bca15e0..731de222bc6b 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -62,7 +62,7 @@ FullScreenPane::FullScreenPane (
// Create a new top-leve window that is displayed full screen.
mpWorkWindow->ShowFullScreenMode(true, nScreenNumber);
// For debugging (non-fullscreen) use mpWorkWindow->SetScreenNumber(nScreenNumber);
- mpWorkWindow->SetMenuBarMode(MENUBAR_MODE_HIDE);
+ mpWorkWindow->SetMenuBarMode(MenuBarMode::Hide);
mpWorkWindow->SetBorderStyle(WindowBorderStyle::REMOVEBORDER);
mpWorkWindow->SetBackground(Wallpaper());
// Don't show the window right now in order to allow the setting of an
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index 5c0b6ff6d0d6..cf02dd9489ba 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -410,7 +410,7 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
if (pParent && pParent->IsFullScreenMode())
{
pParent->ShowFullScreenMode(false);
- pParent->SetMenuBarMode(MENUBAR_MODE_NORMAL);
+ pParent->SetMenuBarMode(MenuBarMode::Normal);
}
// create the menu bar for the backing component
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index fc8dbae2d294..8119842b38a6 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2913,7 +2913,7 @@ void SfxViewFrame::MiscExec_Impl( SfxRequest& rReq )
}
}
pWork->ShowFullScreenMode( bNewFullScreenMode );
- pWork->SetMenuBarMode( bNewFullScreenMode ? MENUBAR_MODE_HIDE : MENUBAR_MODE_NORMAL );
+ pWork->SetMenuBarMode( bNewFullScreenMode ? MenuBarMode::Hide : MenuBarMode::Normal );
GetFrame().GetWorkWindow_Impl()->SetFullScreen_Impl( bNewFullScreenMode );
if ( !pItem )
rReq.AppendItem( SfxBoolItem( SID_WIN_FULLSCREEN, bNewFullScreenMode ) );
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 1c79c882dc4a..542ba3aea687 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -80,7 +80,7 @@ void SystemWindow::Init()
mbSysChild = false;
mbIsCalculatingInitialLayoutSize = false;
mbInitialLayoutDone = false;
- mnMenuBarMode = MENUBAR_MODE_NORMAL;
+ mnMenuBarMode = MenuBarMode::Normal;
mnIcon = 0;
mpDialogParent = NULL;
@@ -964,14 +964,14 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar, const css::uno::Reference<css::
}
}
-void SystemWindow::SetMenuBarMode( sal_uInt16 nMode )
+void SystemWindow::SetMenuBarMode( MenuBarMode nMode )
{
if ( mnMenuBarMode != nMode )
{
mnMenuBarMode = nMode;
if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) )
{
- if ( nMode == MENUBAR_MODE_HIDE )
+ if ( nMode == MenuBarMode::Hide )
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( true );
else
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( false );