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

Noel Grandin noel.grandin at collabora.co.uk
Thu Dec 22 06:43:13 UTC 2016


 include/vcl/layout.hxx        |   12 ++++++------
 include/vcl/outdev.hxx        |    2 +-
 vcl/source/window/layout.cxx  |   10 +++++-----
 vcl/source/window/window2.cxx |   12 ++++++------
 4 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit 21907d647c58594e58fde0d6507f63f6207fe4bd
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Dec 21 15:51:29 2016 +0200

    convert VclSizeGroupMode to scoped enum
    
    Change-Id: Id731fb3d5f9eb5ddaa3af41b010bff340f1077ce
    Reviewed-on: https://gerrit.libreoffice.org/32290
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index e137178..d487a9e 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -569,12 +569,12 @@ public:
     virtual void Command(const CommandEvent& rCEvt) override;
 };
 
-enum VclSizeGroupMode
+enum class VclSizeGroupMode
 {
-    VCL_SIZE_GROUP_NONE,
-    VCL_SIZE_GROUP_HORIZONTAL,
-    VCL_SIZE_GROUP_VERTICAL,
-    VCL_SIZE_GROUP_BOTH
+    NONE,
+    Horizontal,
+    Vertical,
+    Both
 };
 
 class VCL_DLLPUBLIC VclSizeGroup
@@ -588,7 +588,7 @@ private:
 public:
     VclSizeGroup()
         : m_bIgnoreHidden(false)
-        , m_eMode(VCL_SIZE_GROUP_HORIZONTAL)
+        , m_eMode(VclSizeGroupMode::Horizontal)
     {
     }
     void insert(vcl::Window *pWindow)
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 9a51658..0b8795a 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2135,15 +2135,15 @@ bool VclSizeGroup::set_property(const OString &rKey, const OString &rValue)
         set_ignore_hidden(toBool(rValue));
     else if (rKey == "mode")
     {
-        VclSizeGroupMode eMode = VCL_SIZE_GROUP_HORIZONTAL;
+        VclSizeGroupMode eMode = VclSizeGroupMode::Horizontal;
         if (rValue.equals("none"))
-            eMode = VCL_SIZE_GROUP_NONE;
+            eMode = VclSizeGroupMode::NONE;
         else if (rValue.equals("horizontal"))
-            eMode = VCL_SIZE_GROUP_HORIZONTAL;
+            eMode = VclSizeGroupMode::Horizontal;
         else if (rValue.equals("vertical"))
-            eMode = VCL_SIZE_GROUP_VERTICAL;
+            eMode = VclSizeGroupMode::Vertical;
         else if (rValue.equals("both"))
-            eMode = VCL_SIZE_GROUP_BOTH;
+            eMode = VclSizeGroupMode::Both;
         else
         {
             SAL_WARN("vcl.layout", "unknown size group mode" << rValue.getStr());
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index beeb364..b6f4ea4 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1367,7 +1367,7 @@ void Window::queue_resize(StateChangedType eReason)
     }
 
     WindowImpl *pWindowImpl = mpWindowImpl->mpBorderWindow ? mpWindowImpl->mpBorderWindow->mpWindowImpl.get() : mpWindowImpl.get();
-    if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VCL_SIZE_GROUP_NONE)
+    if (pWindowImpl->m_xSizeGroup && pWindowImpl->m_xSizeGroup->get_mode() != VclSizeGroupMode::NONE)
     {
         std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
         for (VclPtr<vcl::Window> const & pOther : rWindows)
@@ -1665,7 +1665,7 @@ Size Window::get_preferred_size() const
     if (pWindowImpl->m_xSizeGroup)
     {
         const VclSizeGroupMode eMode = pWindowImpl->m_xSizeGroup->get_mode();
-        if (eMode != VCL_SIZE_GROUP_NONE)
+        if (eMode != VclSizeGroupMode::NONE)
         {
             const bool bIgnoreInHidden = pWindowImpl->m_xSizeGroup->get_ignore_hidden();
             const std::set<VclPtr<vcl::Window> > &rWindows = pWindowImpl->m_xSizeGroup->get_widgets();
@@ -1677,9 +1677,9 @@ Size Window::get_preferred_size() const
                 if (bIgnoreInHidden && !pOther->IsVisible())
                     continue;
                 Size aOtherSize = pOther->get_ungrouped_preferred_size();
-                if (eMode == VCL_SIZE_GROUP_BOTH || eMode == VCL_SIZE_GROUP_HORIZONTAL)
+                if (eMode == VclSizeGroupMode::Both || eMode == VclSizeGroupMode::Horizontal)
                     aRet.Width() = std::max(aRet.Width(), aOtherSize.Width());
-                if (eMode == VCL_SIZE_GROUP_BOTH || eMode == VCL_SIZE_GROUP_VERTICAL)
+                if (eMode == VclSizeGroupMode::Both || eMode == VclSizeGroupMode::Vertical)
                     aRet.Height() = std::max(aRet.Height(), aOtherSize.Height());
             }
         }
@@ -1934,7 +1934,7 @@ void Window::add_to_size_group(const std::shared_ptr<VclSizeGroup>& xGroup)
     //To-Do, multiple groups
     pWindowImpl->m_xSizeGroup = xGroup;
     pWindowImpl->m_xSizeGroup->insert(this);
-    if (VCL_SIZE_GROUP_NONE != pWindowImpl->m_xSizeGroup->get_mode())
+    if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
         queue_resize();
 }
 
@@ -1944,7 +1944,7 @@ void Window::remove_from_all_size_groups()
     //To-Do, multiple groups
     if (pWindowImpl->m_xSizeGroup)
     {
-        if (VCL_SIZE_GROUP_NONE != pWindowImpl->m_xSizeGroup->get_mode())
+        if (VclSizeGroupMode::NONE != pWindowImpl->m_xSizeGroup->get_mode())
             queue_resize();
         pWindowImpl->m_xSizeGroup->erase(this);
         pWindowImpl->m_xSizeGroup.reset();
commit 29fa61837f11c6149157f1c2dd850415a38a3e47
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Dec 21 13:58:34 2016 +0200

    convert GetDefaultFontFlags to scoped enum
    
    Change-Id: I048aa989f5a90a5e2fb51e33eb9c1dafda3fc7f6
    Reviewed-on: https://gerrit.libreoffice.org/32284
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 0baaaf3..a2130e0 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -271,7 +271,7 @@ namespace o3tl
 }
 
 // GetDefaultFont() flags
-enum GetDefaultFontFlags
+enum class GetDefaultFontFlags
 {
     NONE          = 0x0000,
     OnlyOne       = 0x0001,


More information about the Libreoffice-commits mailing list