loplugin:mergeclasses

Change-Id: If8fabc79f4cbef6fc0d164bbe2f6136f1d1f00af
This commit is contained in:
Noel Grandin
2015-10-07 09:50:40 +02:00
parent 687bba75da
commit 64d0de92ab
7 changed files with 37 additions and 36 deletions

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}

View File

@@ -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 );

View File

@@ -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;
};

View File

@@ -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) {}
virtual ~ImplFontOptions() {}
meHintStyle(HINT_SLIGHT),
mpPattern(0) {}
FontConfigFontOptions(FcPattern* pPattern) :
meEmbeddedBitmap(EMBEDDEDBITMAP_DONTKNOW),
meAntiAlias(ANTIALIAS_DONTKNOW),
meAutoHint(AUTOHINT_DONTKNOW),
meHinting(HINTING_DONTKNOW),
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 -

View File

@@ -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;