diff options
author | Noel Grandin <noel@peralex.com> | 2014-10-06 14:48:16 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-13 17:45:57 +0200 |
commit | af5ebbf7835441c767f91a620f109ee6722e57bd (patch) | |
tree | c72b2a1ddb5aa0a0a369be7babd516a5592d5fac /test | |
parent | 1156d11ef0bb2bc3d71ae9299656db4fed66f073 (diff) |
create a macro library for implementing bit-flags types
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>,
changed from a macro- to a template-based solution. (Unfortunately MSVC 2012
does not support explicit conversion operators. Worked around that with
explicit #ifs rather than some HAVE_EXPLICIT_CONVERSION_OPERATORS and
SAL_EXPLICIT_CONVERSION_OPERATOR ainticipating we hopefully soon move to a
baseline that requires unconditional support for them.)
Change-Id: I4a89643b218d247e8e4a861faba458ec6dfe1396
Diffstat (limited to 'test')
-rw-r--r-- | test/source/mtfxmldump.cxx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index ca81b559d32b..43098d0d5ca7 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -24,33 +24,33 @@ const size_t constMaxActionType = 513; OUString flagToString(PushFlags nFlag) { - if (nFlag & PUSH_LINECOLOR) + if (nFlag & PushFlags::LINECOLOR) return OUString("PushLineColor"); - else if (nFlag & PUSH_FILLCOLOR) + else if (nFlag & PushFlags::FILLCOLOR) return OUString("PushFillColor"); - else if (nFlag & PUSH_FONT) + else if (nFlag & PushFlags::FONT) return OUString("PushFont"); - else if (nFlag & PUSH_TEXTCOLOR) + else if (nFlag & PushFlags::TEXTCOLOR) return OUString("PushTextColor"); - else if (nFlag & PUSH_MAPMODE) + else if (nFlag & PushFlags::MAPMODE) return OUString("PushMapMode"); - else if (nFlag & PUSH_CLIPREGION) + else if (nFlag & PushFlags::CLIPREGION) return OUString("PushClipRegion"); - else if (nFlag & PUSH_RASTEROP) + else if (nFlag & PushFlags::RASTEROP) return OUString("PushRasterOp"); - else if (nFlag & PUSH_TEXTFILLCOLOR) + else if (nFlag & PushFlags::TEXTFILLCOLOR) return OUString("PushTextFillColor"); - else if (nFlag & PUSH_TEXTALIGN) + else if (nFlag & PushFlags::TEXTALIGN) return OUString("PushTextAlign"); - else if (nFlag & PUSH_REFPOINT) + else if (nFlag & PushFlags::REFPOINT) return OUString("PushRefPoint"); - else if (nFlag & PUSH_TEXTLINECOLOR) + else if (nFlag & PushFlags::TEXTLINECOLOR) return OUString("PushTextLineColor"); - else if (nFlag & PUSH_TEXTLAYOUTMODE) + else if (nFlag & PushFlags::TEXTLAYOUTMODE) return OUString("PushTextLayoutMode"); - else if (nFlag & PUSH_TEXTLANGUAGE) + else if (nFlag & PushFlags::TEXTLANGUAGE) return OUString("PushTextLanguage"); - else if (nFlag & PUSH_OVERLINECOLOR) + else if (nFlag & PushFlags::OVERLINECOLOR) return OUString("PushOverlineColor"); return OUString(); @@ -58,7 +58,7 @@ OUString flagToString(PushFlags nFlag) OUString collectPushFlags(PushFlags nFlags) { - if ((nFlags & PUSH_ALL) == nFlags) + if ((nFlags & PushFlags::ALL) == nFlags) return OUString("PushAll"); else if ((nFlags & PUSH_ALLFONT) == nFlags) return OUString("PushAllFont"); |