[Libreoffice-commits] core.git: include/o3tl include/vcl sw/inc

Noel Grandin noel at peralex.com
Thu Jul 30 00:16:12 PDT 2015


 include/o3tl/typed_flags_set.hxx |    5 ++++-
 include/vcl/salnativewidgets.hxx |   18 +++++++++---------
 sw/inc/fesh.hxx                  |    2 +-
 3 files changed, 14 insertions(+), 11 deletions(-)

New commits:
commit cebfe56ae5f9cee4b403370774040f35a17d223c
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jul 30 08:20:20 2015 +0200

    add assert for valid value in o3tl::typed_flags_set
    
    , fixing a couple of bugs in the process
    
    Change-Id: I40f932deecbcc99dff9aa13dd1882c7487e7fa8e
    Reviewed-on: https://gerrit.libreoffice.org/17411
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/o3tl/typed_flags_set.hxx b/include/o3tl/typed_flags_set.hxx
index d997f6a..d3ac7e2 100644
--- a/include/o3tl/typed_flags_set.hxx
+++ b/include/o3tl/typed_flags_set.hxx
@@ -70,7 +70,10 @@ struct is_typed_flags {
     public:
         explicit Wrap(typename std::underlying_type<E>::type value):
             value_(value)
-        { assert(detail::isNonNegative(value)); }
+        {
+            assert(detail::isNonNegative(value));
+            assert((value & ~M) == 0);
+        }
 
         operator E() { return static_cast<E>(value_); }
 
diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx
index 8118b29..2ae7a6e 100644
--- a/include/vcl/salnativewidgets.hxx
+++ b/include/vcl/salnativewidgets.hxx
@@ -240,20 +240,20 @@ typedef sal_uInt32      ControlPart;
  *   in the ControlState.
  */
 enum class ControlState {
-    NONE         = 0,
-    ENABLED      = 0x0001,
-    FOCUSED      = 0x0002,
-    PRESSED      = 0x0004,
-    ROLLOVER     = 0x0008,
-    HIDDEN       = 0x0010,
-    DEFAULT      = 0x0020,
-    SELECTED     = 0x0040,
+    NONE            = 0,
+    ENABLED         = 0x0001,
+    FOCUSED         = 0x0002,
+    PRESSED         = 0x0004,
+    ROLLOVER        = 0x0008,
+    HIDDEN          = 0x0010,
+    DEFAULT         = 0x0020,
+    SELECTED        = 0x0040,
     DOUBLEBUFFERING = 0x4000,  ///< Set when the control is painted using double-buffering via VirtualDevice.
     CACHING_ALLOWED = 0x8000,  ///< Set when the control is completely visible (i.e. not clipped).
 };
 namespace o3tl
 {
-    template<> struct typed_flags<ControlState> : is_typed_flags<ControlState, 0xc007f> {};
+    template<> struct typed_flags<ControlState> : is_typed_flags<ControlState, 0xc07f> {};
 }
 
 class ControlCacheKey
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index b8604d1..472d57c 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -82,7 +82,7 @@ enum class FrmTypeFlags {
 };
 namespace o3tl
 {
-    template<> struct typed_flags<FrmTypeFlags> : is_typed_flags<FrmTypeFlags, 0x4fff> {};
+    template<> struct typed_flags<FrmTypeFlags> : is_typed_flags<FrmTypeFlags, 0x7fff> {};
 }
 
 //! values can be combined via logical or


More information about the Libreoffice-commits mailing list