summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-10 13:34:46 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-11 06:54:05 +0000
commit9e0335d1db22bd3ad3f4bb249b30a00fd55558f4 (patch)
treef5a48783b8b0558b267c018b8856167bdcf7b09f /vcl/inc
parenteff219140f5dc81424b3281438dc5ed0a9dd6a9a (diff)
Convert FONT_FAMILY to scoped enum
Change-Id: Id7cc5c76ba45cdd6a06a981ad14e83713cfe5c1a Reviewed-on: https://gerrit.libreoffice.org/24840 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/PhysicalFontFamily.hxx26
1 files changed, 16 insertions, 10 deletions
diff --git a/vcl/inc/PhysicalFontFamily.hxx b/vcl/inc/PhysicalFontFamily.hxx
index 0363de3bea6e..07d329c711d9 100644
--- a/vcl/inc/PhysicalFontFamily.hxx
+++ b/vcl/inc/PhysicalFontFamily.hxx
@@ -30,14 +30,20 @@ class PhysicalFontFace;
class PhysicalFontCollection;
// flags for mnTypeFaces member
-#define FONT_FAMILY_SCALABLE (1<<0)
-#define FONT_FAMILY_SYMBOL (1<<1)
-#define FONT_FAMILY_NONESYMBOL (1<<2)
-#define FONT_FAMILY_LIGHT (1<<4)
-#define FONT_FAMILY_BOLD (1<<5)
-#define FONT_FAMILY_NORMAL (1<<6)
-#define FONT_FAMILY_NONEITALIC (1<<8)
-#define FONT_FAMILY_ITALIC (1<<9)
+enum class FontTypeFaces {
+ NONE = 0x00,
+ Scalable = 0x01,
+ Symbol = 0x02,
+ NoneSymbol = 0x04,
+ Light = 0x08,
+ Bold = 0x10,
+ Normal = 0x20,
+ NoneItalic = 0x40,
+ Italic = 0x80
+};
+namespace o3tl {
+ template<> struct typed_flags<FontTypeFaces> : is_typed_flags<FontTypeFaces, 0xff> {};
+};
class PhysicalFontFamily
{
@@ -50,7 +56,7 @@ public:
const OUString& GetAliasNames() const { return maMapNames; }
bool IsScalable() const { return maFontFaces[0]->IsScalable(); }
int GetMinQuality() const { return mnMinQuality; }
- int GetTypeFaces() const { return mnTypeFaces; }
+ FontTypeFaces GetTypeFaces() const { return mnTypeFaces; }
void GetFontHeights( std::set<int>& rHeights ) const;
const OUString& GetMatchFamilyName() const { return maMatchFamilyName; }
@@ -77,7 +83,7 @@ private:
OUString maFamilyName; // original font family name
OUString maSearchName; // normalized font family name
OUString maMapNames; // fontname aliases
- int mnTypeFaces; // Typeface Flags
+ FontTypeFaces mnTypeFaces; // Typeface Flags
FontFamily meFamily;
FontPitch mePitch;
int mnMinQuality; // quality of the worst font face