summaryrefslogtreecommitdiff
path: root/xfa/fgas/font
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-06-06 10:51:58 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-06 10:51:58 -0700
commit48ddd86c45b437151d660758befbebec242d407d (patch)
treea61201d16145b605c3e3fbf5f951be6b5ff2db1a /xfa/fgas/font
parent884b4f942d510974e713361b84a717340eb928b9 (diff)
downloadpdfium-48ddd86c45b437151d660758befbebec242d407d.tar.xz
Make GetDevFont() return a CFX_Font* instead of void*
Then we can remove a bunch of casts. Review-Url: https://codereview.chromium.org/2033243004
Diffstat (limited to 'xfa/fgas/font')
-rw-r--r--xfa/fgas/font/fgas_font.h2
-rw-r--r--xfa/fgas/font/fgas_gefont.h2
-rw-r--r--xfa/fgas/font/fgas_stdfontmgr.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/xfa/fgas/font/fgas_font.h b/xfa/fgas/font/fgas_font.h
index ea82ec1526..5d3a44092d 100644
--- a/xfa/fgas/font/fgas_font.h
+++ b/xfa/fgas/font/fgas_font.h
@@ -88,7 +88,7 @@ class IFGAS_Font {
virtual int32_t GetItalicAngle() const = 0;
virtual void Reset() = 0;
virtual IFGAS_Font* GetSubstFont(int32_t iGlyphIndex) const = 0;
- virtual void* GetDevFont() const = 0;
+ virtual CFX_Font* GetDevFont() const = 0;
virtual void SetFontProvider(CXFA_PDFFontMgr* pProvider) = 0;
#if _FXM_PLATFORM_ != _FXM_PLATFORM_WINDOWS_
virtual void SetLogicalFontStyle(uint32_t dwLogFontStyle) = 0;
diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h
index 835fe2c11a..c818b6286d 100644
--- a/xfa/fgas/font/fgas_gefont.h
+++ b/xfa/fgas/font/fgas_gefont.h
@@ -49,7 +49,7 @@ class CFGAS_GEFont : public IFGAS_Font {
virtual int32_t GetItalicAngle() const;
virtual void Reset();
virtual IFGAS_Font* GetSubstFont(int32_t iGlyphIndex) const;
- virtual void* GetDevFont() const { return (void*)m_pFont; }
+ virtual CFX_Font* GetDevFont() const { return m_pFont; }
virtual void SetFontProvider(CXFA_PDFFontMgr* pProvider) {
m_pProvider = pProvider;
}
diff --git a/xfa/fgas/font/fgas_stdfontmgr.cpp b/xfa/fgas/font/fgas_stdfontmgr.cpp
index c19d44d923..9ea37cf32b 100644
--- a/xfa/fgas/font/fgas_stdfontmgr.cpp
+++ b/xfa/fgas/font/fgas_stdfontmgr.cpp
@@ -813,7 +813,7 @@ FX_BOOL CFGAS_FontMgrImp::VerifyUnicode(IFGAS_Font* pFont, FX_WCHAR wcUnicode) {
if (!pFont)
return FALSE;
- FXFT_Face pFace = ((CFX_Font*)pFont->GetDevFont())->GetFace();
+ FXFT_Face pFace = pFont->GetDevFont()->GetFace();
FXFT_CharMap charmap = FXFT_Get_Face_Charmap(pFace);
if (FXFT_Select_Charmap(pFace, FXFT_ENCODING_UNICODE) != 0)
return FALSE;
@@ -889,7 +889,7 @@ IFGAS_Font* CFGAS_FontMgrImp::LoadFont(IFX_FileAccess* pFontAccess,
if (m_FileAccess2IFXFont.Lookup(dwHash, pFont)) {
if (pFont) {
if (pFaceCount)
- *pFaceCount = ((CFX_Font*)pFont->GetDevFont())->GetFace()->num_faces;
+ *pFaceCount = pFont->GetDevFont()->GetFace()->num_faces;
return pFont->Retain();
}
}
@@ -918,7 +918,7 @@ IFGAS_Font* CFGAS_FontMgrImp::LoadFont(IFX_FileAccess* pFontAccess,
m_IFXFont2FileRead.SetAt(pFont, pFontStream);
if (pFaceCount)
- *pFaceCount = ((CFX_Font*)pFont->GetDevFont())->GetFace()->num_faces;
+ *pFaceCount = pFont->GetDevFont()->GetFace()->num_faces;
return pFont;
}
@@ -958,7 +958,7 @@ IFGAS_Font* CFGAS_FontMgrImp::LoadFont(const CFX_WideString& wsFaceName,
m_IFXFont2FileRead.SetAt(pFont, pFontStream);
if (pFaceCount)
- *pFaceCount = ((CFX_Font*)pFont->GetDevFont())->GetFace()->num_faces;
+ *pFaceCount = pFont->GetDevFont()->GetFace()->num_faces;
return pFont;
}