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

Stephan Bergmann sbergman at redhat.com
Tue Jan 26 13:42:57 PST 2016


 vcl/inc/salptype.hxx |   21 +++++++++------------
 1 file changed, 9 insertions(+), 12 deletions(-)

New commits:
commit cef2ecd0f56c8ff15b8d37e908cec625e1ab28c9
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 26 22:41:42 2016 +0100

    Use o3tl::typed_flags
    
    Change-Id: I6b43fecc6a45161d419826bc10385b26db5148e5

diff --git a/vcl/inc/salptype.hxx b/vcl/inc/salptype.hxx
index b121a12..1fb9049 100644
--- a/vcl/inc/salptype.hxx
+++ b/vcl/inc/salptype.hxx
@@ -20,19 +20,10 @@
 #ifndef INCLUDED_VCL_INC_SALPTYPE_HXX
 #define INCLUDED_VCL_INC_SALPTYPE_HXX
 
-#include <sal/types.h>
-
-enum class JobSetFlags : sal_uInt16;
+#include <sal/config.h>
 
-inline SAL_CONSTEXPR JobSetFlags operator |(const JobSetFlags a, const JobSetFlags b)
-{
-    return static_cast<JobSetFlags>(static_cast<sal_uInt16>(a) & static_cast<sal_uInt16>(b));
-}
-
-inline SAL_CONSTEXPR bool operator &(const JobSetFlags a, const JobSetFlags b)
-{
-    return (static_cast<sal_uInt16>(a) & static_cast<sal_uInt16>(b)) != 0;
-}
+#include <o3tl/typed_flags_set.hxx>
+#include <sal/types.h>
 
 enum class JobSetFlags : sal_uInt16 {
     ORIENTATION  = 1,
@@ -42,6 +33,12 @@ enum class JobSetFlags : sal_uInt16 {
     ALL          = ORIENTATION | PAPERBIN | PAPERSIZE | DUPLEXMODE
 };
 
+namespace o3tl {
+
+template<> struct typed_flags<JobSetFlags>: is_typed_flags<JobSetFlags, 0xF> {};
+
+}
+
 // - SalPrinterError -
 
 #define SAL_PRINTER_ERROR_GENERALERROR          1


More information about the Libreoffice-commits mailing list