Kaydet (Commit) d3816ab9 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Use o3tl::typed_flags

Change-Id: I02b88e60a03441c3c4df6ed32616bb618089539c
üst dfad3e87
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <memory> #include <memory>
#include <o3tl/typed_flags_set.hxx>
#include <sfx2/dllapi.h> #include <sfx2/dllapi.h>
#include <sal/types.h> #include <sal/types.h>
#include <rtl/strbuf.hxx> #include <rtl/strbuf.hxx>
...@@ -61,30 +62,9 @@ enum class SfxCallMode : sal_uInt16 ...@@ -61,30 +62,9 @@ enum class SfxCallMode : sal_uInt16
API = 0x08, // API call (silent) API = 0x08, // API call (silent)
MODAL = 0x10 // despite ModalMode MODAL = 0x10 // despite ModalMode
}; };
// make combining these type-safe
inline SfxCallMode operator| (SfxCallMode lhs, SfxCallMode rhs)
{
return static_cast<SfxCallMode>(static_cast<sal_uInt16>(lhs) | static_cast<sal_uInt16>(rhs));
}
inline SfxCallMode operator& (SfxCallMode lhs, SfxCallMode rhs)
{
return static_cast<SfxCallMode>(static_cast<sal_uInt16>(lhs) & static_cast<sal_uInt16>(rhs));
}
inline SfxCallMode operator~ (SfxCallMode rhs)
{
return static_cast<SfxCallMode>(0x1f & ~(static_cast<sal_uInt16>(rhs)));
}
inline SfxCallMode& operator|= (SfxCallMode& lhs, SfxCallMode rhs)
{
lhs = static_cast<SfxCallMode>(static_cast<sal_uInt16>(lhs) | static_cast<sal_uInt16>(rhs));
return lhs;
}
inline SfxCallMode& operator&= (SfxCallMode& lhs, SfxCallMode rhs)
{
lhs = static_cast<SfxCallMode>(static_cast<sal_uInt16>(lhs) & static_cast<sal_uInt16>(rhs));
return lhs;
}
template<> struct o3tl::typed_flags<SfxCallMode>:
o3tl::is_typed_flags<SfxCallMode, 0x1F> {};
class SFX2_DLLPUBLIC SfxBindings: public SfxBroadcaster class SFX2_DLLPUBLIC SfxBindings: public SfxBroadcaster
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment