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

Noel Grandin noel at peralex.com
Wed May 25 08:22:45 UTC 2016


 include/vcl/vclenum.hxx                        |    2 +-
 vcl/inc/unx/fc_fontoptions.hxx                 |    4 ++--
 vcl/unx/generic/fontmanager/fontconfig.cxx     |    8 ++++----
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |    8 ++++----
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 2a4f9cbf01c8ee4ecf571e4a8b9e121050e7bd95
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 24 10:23:42 2016 +0200

    Convert FontHintStyle to scoped enum
    
    Change-Id: I6e59bf8beacc524897aede45420574148c0fecde
    Reviewed-on: https://gerrit.libreoffice.org/25397
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 45f9ed2..8dcafe1 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -77,7 +77,7 @@ enum FontAutoHint { AUTOHINT_DONTKNOW, AUTOHINT_FALSE, AUTOHINT_TRUE };
 
 enum FontHinting { HINTING_DONTKNOW, HINTING_FALSE, HINTING_TRUE };
 
-enum FontHintStyle { HINT_NONE, HINT_SLIGHT, HINT_MEDIUM, HINT_FULL };
+enum class FontHintStyle { NONE, Slight, Medium, Full };
 
 typedef sal_uInt32 sal_UCS4;    // TODO: this should be moved to rtl
 
diff --git a/vcl/inc/unx/fc_fontoptions.hxx b/vcl/inc/unx/fc_fontoptions.hxx
index d99870d..d085e26 100644
--- a/vcl/inc/unx/fc_fontoptions.hxx
+++ b/vcl/inc/unx/fc_fontoptions.hxx
@@ -42,7 +42,7 @@ public:
                             meAntiAlias(ANTIALIAS_DONTKNOW),
                             meAutoHint(AUTOHINT_DONTKNOW),
                             meHinting(HINTING_DONTKNOW),
-                            meHintStyle(HINT_SLIGHT),
+                            meHintStyle(FontHintStyle::Slight),
                             mpPattern(pPattern) {}
                         ~FontConfigFontOptions();
 
@@ -50,7 +50,7 @@ public:
     FontHintStyle       GetHintStyle() const { return meHintStyle; }
     bool                DontUseEmbeddedBitmaps() const { return meEmbeddedBitmap == EMBEDDEDBITMAP_FALSE; }
     bool                DontUseAntiAlias() const { return meAntiAlias == ANTIALIAS_FALSE; }
-    bool                DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == HINT_NONE); }
+    bool                DontUseHinting() const { return (meHinting == HINTING_FALSE) || (GetHintStyle() == FontHintStyle::NONE); }
     void*               GetPattern(void * /*pFace*/, bool /*bEmbolden*/) const;
 private:
     FcPattern* mpPattern;
diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 73ad87a..957afb14 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -1215,11 +1215,11 @@ FontConfigFontOptions* PrintFontManager::getFontOptions(
             pOptions->meHinting = hinting ? HINTING_TRUE : HINTING_FALSE;
         switch (hintstyle)
         {
-            case FC_HINT_NONE:   pOptions->meHintStyle = HINT_NONE; break;
-            case FC_HINT_SLIGHT: pOptions->meHintStyle = HINT_SLIGHT; break;
-            case FC_HINT_MEDIUM: pOptions->meHintStyle = HINT_MEDIUM; break;
+            case FC_HINT_NONE:   pOptions->meHintStyle = FontHintStyle::NONE; break;
+            case FC_HINT_SLIGHT: pOptions->meHintStyle = FontHintStyle::Slight; break;
+            case FC_HINT_MEDIUM: pOptions->meHintStyle = FontHintStyle::Medium; break;
             default: // fall through
-            case FC_HINT_FULL:   pOptions->meHintStyle = HINT_FULL; break;
+            case FC_HINT_FULL:   pOptions->meHintStyle = FontHintStyle::Full; break;
         }
     }
 
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 7e1dbc9..933771c 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -571,15 +571,15 @@ void ServerFont::SetFontOptions(const std::shared_ptr<FontConfigFontOptions>& xF
        mnLoadFlags |= FT_LOAD_TARGET_NORMAL;
        switch (mxFontOptions->GetHintStyle())
        {
-           case HINT_NONE:
+           case FontHintStyle::NONE:
                 mnLoadFlags |= FT_LOAD_NO_HINTING;
                 break;
-           case HINT_SLIGHT:
+           case FontHintStyle::Slight:
                 mnLoadFlags |= FT_LOAD_TARGET_LIGHT;
                 break;
-           case HINT_MEDIUM:
+           case FontHintStyle::Medium:
                 break;
-           case HINT_FULL:
+           case FontHintStyle::Full:
            default:
                 break;
        }


More information about the Libreoffice-commits mailing list