diff options
author | Noel Grandin <noel@peralex.com> | 2015-10-07 09:50:40 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-10-07 12:32:23 +0200 |
commit | 64d0de92ab06e6550be7dd59ae887750166d15a9 (patch) | |
tree | 0ac4130293e2a9a244791038d472160321bd979e | |
parent | 687bba75dadf94b06d0e5d2888e7d312ed668a53 (diff) |
loplugin:mergeclasses
Change-Id: If8fabc79f4cbef6fc0d164bbe2f6136f1d1f00af
-rw-r--r-- | compilerplugins/clang/mergeclasses.results | 1 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontconfig.cxx | 21 | ||||
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.cxx | 4 | ||||
-rw-r--r-- | vcl/inc/fontmanager.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/generic/glyphcache.hxx | 10 | ||||
-rw-r--r-- | vcl/inc/impfont.hxx | 25 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/cairotextrender.cxx | 8 |
7 files changed, 37 insertions, 36 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results index a5461e1d47fd..a92afb513002 100644 --- a/compilerplugins/clang/mergeclasses.results +++ b/compilerplugins/clang/mergeclasses.results @@ -46,7 +46,6 @@ merge ISwFrameControl with SwFrameMenuButtonBase merge IXFAttrList with XFSaxAttrList merge IXFStream with XFSaxStream merge IXFStyle with XFStyle -merge ImplFontOptions with FontConfigFontOptions merge ImplGlyphFallbackFontSubstitution with FcGlyphFallbackSubstititution merge ImplPreMatchFontSubstitution with FcPreMatchSubstititution merge LwpDLList with LwpParaProperty diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx index 5d61dcd07346..2ba76387df51 100644 --- a/vcl/generic/fontmanager/fontconfig.cxx +++ b/vcl/generic/fontmanager/fontconfig.cxx @@ -1140,15 +1140,12 @@ bool PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi return bRet; } -class FontConfigFontOptions : public ImplFontOptions +FontConfigFontOptions::~FontConfigFontOptions() { -public: - FontConfigFontOptions() : mpPattern(0) {} - virtual ~FontConfigFontOptions() - { - FcPatternDestroy(mpPattern); - } - virtual void *GetPattern(void * face, bool bEmbolden, bool /*bVerticalLayout*/) const SAL_OVERRIDE + FcPatternDestroy(mpPattern); +} + + void *FontConfigFontOptions::GetPattern(void * face, bool bEmbolden) const { FcValue value; value.type = FcTypeFTFace; @@ -1163,10 +1160,8 @@ public: #endif return mpPattern; } - FcPattern* mpPattern; -}; -ImplFontOptions* PrintFontManager::getFontOptions( +FontConfigFontOptions* PrintFontManager::getFontOptions( const FastPrintFontInfo& rInfo, int nSize, void (*subcallback)(void*)) { FontCfgWrapper& rWrapper = FontCfgWrapper::get(); @@ -1210,9 +1205,7 @@ ImplFontOptions* PrintFontManager::getFontOptions( (void) FcPatternGetInteger(pResult, FC_HINT_STYLE, 0, &hintstyle); - pOptions = new FontConfigFontOptions; - - pOptions->mpPattern = pResult; + pOptions = new FontConfigFontOptions(pResult); if( eEmbeddedBitmap == FcResultMatch ) pOptions->meEmbeddedBitmap = embitmap ? EMBEDDEDBITMAP_TRUE : EMBEDDEDBITMAP_FALSE; diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index 27ca57689e5c..c44a7cd9ada9 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -555,7 +555,7 @@ ServerFont::ServerFont( const FontSelectPattern& rFSD, FtFontInfo* pFI ) mnLoadFlags |= FT_LOAD_NO_BITMAP; } -void ServerFont::SetFontOptions(std::shared_ptr<ImplFontOptions> xFontOptions) +void ServerFont::SetFontOptions(std::shared_ptr<FontConfigFontOptions> xFontOptions) { mxFontOptions = xFontOptions; @@ -608,7 +608,7 @@ void ServerFont::SetFontOptions(std::shared_ptr<ImplFontOptions> xFontOptions) mnLoadFlags |= FT_LOAD_NO_BITMAP; } -std::shared_ptr<ImplFontOptions> ServerFont::GetFontOptions() const +std::shared_ptr<FontConfigFontOptions> ServerFont::GetFontOptions() const { return mxFontOptions; } diff --git a/vcl/inc/fontmanager.hxx b/vcl/inc/fontmanager.hxx index 8b4f76acd9cd..c96e2e7bd272 100644 --- a/vcl/inc/fontmanager.hxx +++ b/vcl/inc/fontmanager.hxx @@ -45,7 +45,7 @@ namespace utl { class MultiAtomProvider; } class FontSubsetInfo; -class ImplFontOptions; +class FontConfigFontOptions; class FontSelectPattern; namespace psp { @@ -498,7 +498,7 @@ public: false else */ bool matchFont( FastPrintFontInfo& rInfo, const com::sun::star::lang::Locale& rLocale ); - static ImplFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)); + static FontConfigFontOptions* getFontOptions( const FastPrintFontInfo&, int nSize, void (*subcallback)(void*)); bool Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes ); diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx index 509044d70145..37568c735804 100644 --- a/vcl/inc/generic/glyphcache.hxx +++ b/vcl/inc/generic/glyphcache.hxx @@ -42,7 +42,7 @@ class FtFontInfo; class GlyphCachePeer; class GlyphData; class GraphiteFaceWrapper; -class ImplFontOptions; +class FontConfigFontOptions; class PhysicalFontCollection; class RawBitmap; class ServerFont; @@ -174,8 +174,8 @@ public: bool TestFont() const { return mbFaceOk;} FT_Face GetFtFace() const; int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); } - void SetFontOptions(std::shared_ptr<ImplFontOptions>); - std::shared_ptr<ImplFontOptions> GetFontOptions() const; + void SetFontOptions(std::shared_ptr<FontConfigFontOptions>); + std::shared_ptr<FontConfigFontOptions> GetFontOptions() const; bool NeedsArtificialBold() const { return mbArtBold; } bool NeedsArtificialItalic() const { return mbArtItalic; } @@ -253,7 +253,7 @@ private: FT_FaceRec_* maFaceFT; FT_SizeRec_* maSizeFT; - std::shared_ptr<ImplFontOptions> mxFontOptions; + std::shared_ptr<FontConfigFontOptions> mxFontOptions; bool mbFaceOk; bool mbArtItalic; @@ -278,7 +278,7 @@ public: private: ServerFont* mpServerFont; - std::shared_ptr<ImplFontOptions> mxFontOptions; + std::shared_ptr<FontConfigFontOptions> mxFontOptions; bool mbGotFontOptions; }; diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx index 898e47dcdbfc..5ad974e56841 100644 --- a/vcl/inc/impfont.hxx +++ b/vcl/inc/impfont.hxx @@ -122,9 +122,8 @@ public: bool operator==( const ImplFontMetric& ) const; }; -// - ImplFontOptions - - -class ImplFontOptions +typedef struct _FcPattern FcPattern; +class FontConfigFontOptions { public: FontEmbeddedBitmap meEmbeddedBitmap; // whether the embedded bitmaps should be used @@ -132,21 +131,31 @@ public: FontAutoHint meAutoHint; // whether the font should be autohinted FontHinting meHinting; // whether the font should be hinted FontHintStyle meHintStyle; // type of font hinting to be used -public: - ImplFontOptions() : + + FontConfigFontOptions() : + meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), + meAntiAlias(ANTIALIAS_DONTKNOW), + meAutoHint(AUTOHINT_DONTKNOW), + meHinting(HINTING_DONTKNOW), + meHintStyle(HINT_SLIGHT), + mpPattern(0) {} + FontConfigFontOptions(FcPattern* pPattern) : meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW), meAntiAlias(ANTIALIAS_DONTKNOW), meAutoHint(AUTOHINT_DONTKNOW), meHinting(HINTING_DONTKNOW), - meHintStyle(HINT_SLIGHT) {} - virtual ~ImplFontOptions() {} + meHintStyle(HINT_SLIGHT), + mpPattern(pPattern) {} + ~FontConfigFontOptions(); 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; } + void* GetPattern(void * /*pFace*/, bool /*bEmbolden*/) const; +private: + FcPattern* mpPattern; }; // - ImplFontCharMap - diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 0f9fafc93df4..10f4f57043ff 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -100,7 +100,7 @@ bool CairoTextRender::setFont( const FontSelectPattern *pEntry, int nFallbackLev return false; } -ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize); +FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize); void ImplServerFontEntry::HandleFontOptions() { @@ -257,8 +257,8 @@ void CairoTextRender::DrawServerFontLayout( const ServerFontLayout& rLayout ) cairo_font_face_t* font_face = static_cast<cairo_font_face_t*>(CairoFontsCache::FindCachedFont(aId)); if (!font_face) { - const ImplFontOptions *pOptions = rFont.GetFontOptions().get(); - void *pPattern = pOptions ? pOptions->GetPattern(aFace, aId.mbEmbolden, aId.mbVerticalMetrics) : NULL; + const FontConfigFontOptions *pOptions = rFont.GetFontOptions().get(); + void *pPattern = pOptions ? pOptions->GetPattern(aFace, aId.mbEmbolden) : NULL; if (pPattern) font_face = cairo_ft_font_face_create_for_pattern(static_cast<FcPattern*>(pPattern)); if (!font_face) @@ -439,7 +439,7 @@ void cairosubcallback(void* pPattern) static_cast<FcPattern*>(pPattern)); } -ImplFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize) +FontConfigFontOptions* GetFCFontOptions( const ImplFontAttributes& rFontAttributes, int nSize) { psp::FastPrintFontInfo aInfo; |