[Libreoffice-commits] core.git: include/vcl sd/source sfx2/source vcl/source

Noel Grandin noel at peralex.com
Thu May 21 03:51:38 PDT 2015


 include/vcl/syswin.hxx                              |   12 +++++++-----
 sd/source/ui/framework/factories/FullScreenPane.cxx |    2 +-
 sfx2/source/dialog/backingcomp.cxx                  |    2 +-
 sfx2/source/view/viewfrm.cxx                        |    2 +-
 vcl/source/window/syswin.cxx                        |    6 +++---
 5 files changed, 13 insertions(+), 11 deletions(-)

New commits:
commit 5b248f1348260f953686b20621255aece57358fe
Author: Noel Grandin <noel at peralex.com>
Date:   Thu May 21 12:48:36 2015 +0200

    convert MENUBAR_MODE constants to scoped enum
    
    Change-Id: Ie4cda46d02e82cca1710603cfb3af379c702d9d7

diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 7aef2ea..17ebf58 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
+};
 
 #define TITLE_BUTTON_DOCKING        ((sal_uInt16)1)
 #define TITLE_BUTTON_HIDE           ((sal_uInt16)2)
@@ -143,7 +145,7 @@ private:
     bool            mbSysChild;
     bool            mbIsCalculatingInitialLayoutSize;
     bool            mbInitialLayoutDone;
-    sal_uInt16      mnMenuBarMode;
+    MenuBarMode     mnMenuBarMode;
     sal_uInt16      mnIcon;
     ImplData*       mpImplData;
     Idle            maLayoutIdle;
@@ -222,8 +224,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 746be66..ef6c050 100644
--- a/sd/source/ui/framework/factories/FullScreenPane.cxx
+++ b/sd/source/ui/framework/factories/FullScreenPane.cxx
@@ -63,7 +63,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 f11d9ff..b69ee96 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 fc8dbae..8119842 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 d770ac3..e595f6f 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;
 
@@ -955,14 +955,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 );


More information about the Libreoffice-commits mailing list