vcl/inc/impfont.hxx | 125 ++++++++++++++++++++++-------------------------- vcl/source/gdi/font.cxx | 4 - 2 files changed, 60 insertions(+), 69 deletions(-)
New commits: commit d244a0c1af7e5448d46cfa3172bcee5799f38087 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Sat Oct 4 15:32:54 2014 +1000 vcl: remove FontRefCount typedef There is honestly no real need for FontRefCount. I really cannot see why this typedef was ever introduced into the codebase Change-Id: Ifa24a95cf6c788b4b11a4425520a2f6bc0e61169 diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index 434db48..3c42f6e 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -31,8 +31,6 @@ // - Impl_Font - -typedef sal_uInt32 FontRefCount; - class Impl_Font { public: @@ -51,7 +49,7 @@ private: friend class vcl::Font; void AskConfig(); - FontRefCount mnRefCount; + sal_uInt32 mnRefCount; OUString maFamilyName; OUString maStyleName; Size maSize; @@ -98,7 +96,7 @@ private: long mnLineHeight; // Ascent+Descent+EmphasisMark long mnSlant; // Slant sal_uInt16 mnMiscFlags; // Misc Flags - FontRefCount mnRefCount; // Reference Counter + sal_uInt32 mnRefCount; // Reference Counter enum { DEVICE_FLAG=1, SCALABLE_FLAG=2, LATIN_FLAG=4, CJK_FLAG=8, CTL_FLAG=16 }; @@ -194,7 +192,7 @@ private: const sal_uInt16* mpGlyphIds; // individual glyphid mappings int mnRangeCount; int mnCharCount; // covered codepoints - mutable FontRefCount mnRefCount; + mutable sal_uInt32 mnRefCount; }; // CmapResult is a normalized version of the many CMAP formats diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index 269527e..81270c0 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -234,7 +234,7 @@ Font::Font() Font::Font( const vcl::Font& rFont ) { - bool bRefIncrementable = rFont.mpImplFont->mnRefCount < ::std::numeric_limits<FontRefCount>::max(); + bool bRefIncrementable = rFont.mpImplFont->mnRefCount < ::std::numeric_limits<sal_uInt32>::max(); DBG_ASSERT( bRefIncrementable, "Font: RefCount overflow" ); mpImplFont = rFont.mpImplFont; @@ -565,7 +565,7 @@ void Font::SetWordLineMode( bool bWordLine ) Font& Font::operator=( const vcl::Font& rFont ) { - bool bRefIncrementable = rFont.mpImplFont->mnRefCount < ::std::numeric_limits<FontRefCount>::max(); + bool bRefIncrementable = rFont.mpImplFont->mnRefCount < ::std::numeric_limits<sal_uInt32>::max(); DBG_ASSERT( bRefIncrementable, "Font: RefCount overflow" ); // Increment RefCount first, so that we can reference ourselves commit bcfa2ea2225875c53c9e8935ecc2740c3bc0db94 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Sat Oct 4 13:39:45 2014 +1000 vcl: tab cleanup of vcl/inc/impfont.hxx Change-Id: I54f669cd4ba472744f013f157baa035519d052bf diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index 5cd5d2a..434db48 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -36,10 +36,10 @@ typedef sal_uInt32 FontRefCount; class Impl_Font { public: - Impl_Font(); - Impl_Font( const Impl_Font& ); + Impl_Font(); + Impl_Font( const Impl_Font& ); - bool operator==( const Impl_Font& ) const; + bool operator==( const Impl_Font& ) const; FontPitch GetPitch() { if(mePitch==PITCH_DONTKNOW) AskConfig(); return mePitch; } FontFamily GetFamily() { if(meFamily==FAMILY_DONTKNOW) AskConfig(); return meFamily; } @@ -91,36 +91,36 @@ class ImplFontMetric friend class ::OutputDevice; private: - long mnAscent; // Ascent - long mnDescent; // Descent - long mnIntLeading; // Internal Leading - long mnExtLeading; // External Leading - long mnLineHeight; // Ascent+Descent+EmphasisMark - long mnSlant; // Slant - sal_uInt16 mnMiscFlags; // Misc Flags - FontRefCount mnRefCount; // Reference Counter + long mnAscent; // Ascent + long mnDescent; // Descent + long mnIntLeading; // Internal Leading + long mnExtLeading; // External Leading + long mnLineHeight; // Ascent+Descent+EmphasisMark + long mnSlant; // Slant + sal_uInt16 mnMiscFlags; // Misc Flags + FontRefCount mnRefCount; // Reference Counter enum { DEVICE_FLAG=1, SCALABLE_FLAG=2, LATIN_FLAG=4, CJK_FLAG=8, CTL_FLAG=16 }; public: - ImplFontMetric(); - void AddReference(); - void DeReference(); - - long GetAscent() const { return mnAscent; } - long GetDescent() const { return mnDescent; } - long GetIntLeading() const { return mnIntLeading; } - long GetExtLeading() const { return mnExtLeading; } - long GetLineHeight() const { return mnLineHeight; } - long GetSlant() const { return mnSlant; } - - bool IsDeviceFont() const { return ((mnMiscFlags & DEVICE_FLAG) != 0); } - bool IsScalable() const { return ((mnMiscFlags & SCALABLE_FLAG) != 0); } - bool SupportsLatin() const { return ((mnMiscFlags & LATIN_FLAG) != 0); } - bool SupportsCJK() const { return ((mnMiscFlags & CJK_FLAG) != 0); } - bool SupportsCTL() const { return ((mnMiscFlags & CTL_FLAG) != 0); } - - bool operator==( const ImplFontMetric& ) const; + ImplFontMetric(); + void AddReference(); + void DeReference(); + + long GetAscent() const { return mnAscent; } + long GetDescent() const { return mnDescent; } + long GetIntLeading() const { return mnIntLeading; } + long GetExtLeading() const { return mnExtLeading; } + long GetLineHeight() const { return mnLineHeight; } + long GetSlant() const { return mnSlant; } + + bool IsDeviceFont() const { return ((mnMiscFlags & DEVICE_FLAG) != 0); } + bool IsScalable() const { return ((mnMiscFlags & SCALABLE_FLAG) != 0); } + bool SupportsLatin() const { return ((mnMiscFlags & LATIN_FLAG) != 0); } + bool SupportsCJK() const { return ((mnMiscFlags & CJK_FLAG) != 0); } + bool SupportsCTL() const { return ((mnMiscFlags & CTL_FLAG) != 0); } + + bool operator==( const ImplFontMetric& ) const; }; // - ImplFontOptions - @@ -134,27 +134,20 @@ public: FontHinting meHinting; // whether the font should be hinted FontHintStyle meHintStyle; // type of font hinting to be used public: - ImplFontOptions() : - meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), - meAntiAlias(ANTIALIAS_DONTKNOW), - meAutoHint(AUTOHINT_DONTKNOW), - meHinting(HINTING_DONTKNOW), - meHintStyle(HINT_SLIGHT) - {} - virtual ~ImplFontOptions() - {} - FontAutoHint GetUseAutoHint() const - { return meAutoHint; } - 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); } - virtual void *GetPattern(void * /*pFace*/, bool /*bEmbolden*/, bool /*bVerticalMetrics*/) const - { return NULL; } + ImplFontOptions() : + meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), + meAntiAlias(ANTIALIAS_DONTKNOW), + meAutoHint(AUTOHINT_DONTKNOW), + meHinting(HINTING_DONTKNOW), + meHintStyle(HINT_SLIGHT) {} + virtual ~ImplFontOptions() {} + + FontAutoHint GetUseAutoHint() const { return meAutoHint; } + 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); } + virtual void* GetPattern(void * /*pFace*/, bool /*bEmbolden*/, bool /*bVerticalMetrics*/) const { return NULL; } }; // - ImplFontCharMap - @@ -164,8 +157,8 @@ class CmapResult; class VCL_PLUGIN_PUBLIC ImplFontCharMap { public: - explicit ImplFontCharMap( const CmapResult& ); - virtual ~ImplFontCharMap(); + explicit ImplFontCharMap( const CmapResult& ); + virtual ~ImplFontCharMap(); static ImplFontCharMap* GetDefaultMap( bool bSymbols=false); @@ -198,26 +191,26 @@ private: private: const sal_uInt32* mpRangeCodes; // pairs of StartCode/(EndCode+1) const int* mpStartGlyphs; // range-specific mapper to glyphs - const sal_uInt16* mpGlyphIds; // individual glyphid mappings + const sal_uInt16* mpGlyphIds; // individual glyphid mappings int mnRangeCount; int mnCharCount; // covered codepoints - mutable FontRefCount mnRefCount; + mutable FontRefCount mnRefCount; }; // CmapResult is a normalized version of the many CMAP formats class VCL_PLUGIN_PUBLIC CmapResult { public: - explicit CmapResult( bool bSymbolic = false, - const sal_uInt32* pRangeCodes = NULL, int nRangeCount = 0, - const int* pStartGlyphs = 0, const sal_uInt16* pGlyphIds = NULL ); - - const sal_uInt32* mpRangeCodes; - const int* mpStartGlyphs; - const sal_uInt16* mpGlyphIds; - int mnRangeCount; - bool mbSymbolic; - bool mbRecoded; + explicit CmapResult( bool bSymbolic = false, + const sal_uInt32* pRangeCodes = NULL, int nRangeCount = 0, + const int* pStartGlyphs = 0, const sal_uInt16* pGlyphIds = NULL ); + + const sal_uInt32* mpRangeCodes; + const int* mpStartGlyphs; + const sal_uInt16* mpGlyphIds; + int mnRangeCount; + bool mbSymbolic; + bool mbRecoded; }; bool ParseCMAP( const unsigned char* pRawData, int nRawLength, CmapResult& ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits