Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2213)

Unified Diff: core/src/fpdfapi/fpdf_font/ttgsubtable.cpp

Issue 1293973002: Cleanup CFX_Font a bit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Remove LoadFile() Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index a1717a9fd4df1e9a44f341bfb81a03423fcad4c9..5e4b82c2ee2751ec3d6ba5abb09dc1af74553c48 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -395,23 +395,23 @@ IFX_GSUBTable* IFX_GSUBTable::Create(CFX_Font* pFont) {
if (!pFont) {
return NULL;
}
- if (NULL == pFont->m_pGsubData) {
+ if (!pFont->GetSubData()) {
unsigned long length = 0;
int error = FXFT_Load_Sfnt_Table(
- pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
+ pFont->GetFace(), FT_MAKE_TAG('G', 'S', 'U', 'B'), 0, NULL, &length);
if (!error) {
- pFont->m_pGsubData = (unsigned char*)FX_Alloc(uint8_t, length);
+ pFont->SetSubData((uint8_t*)FX_Alloc(uint8_t, length));
}
- if (!pFont->m_pGsubData) {
+ if (!pFont->GetSubData()) {
return NULL;
}
}
int error =
- FXFT_Load_Sfnt_Table(pFont->m_Face, FT_MAKE_TAG('G', 'S', 'U', 'B'), 0,
- pFont->m_pGsubData, NULL);
- if (!error && pFont->m_pGsubData) {
+ FXFT_Load_Sfnt_Table(pFont->GetFace(), FT_MAKE_TAG('G', 'S', 'U', 'B'), 0,
+ pFont->GetSubData(), NULL);
+ if (!error && pFont->GetSubData()) {
nonstd::unique_ptr<CFX_GSUBTable> pGsubTable(new CFX_GSUBTable);
- if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->m_pGsubData)) {
+ if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->GetSubData())) {
return pGsubTable.release();
}
}

Powered by Google App Engine
This is Rietveld 408576698