summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-06-18 12:47:11 -0700
committerTom Sepez <tsepez@chromium.org>2015-06-18 12:47:11 -0700
commit2c28619de8051661c7f66f2192c6fb9ef14ee905 (patch)
tree4bd15bf0bb72e4127403548bf2f40230bbdd352b /core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
parent0c1bd7c6ad378ea97a2f54cb0c4761716f6d1057 (diff)
downloadpdfium-2c28619de8051661c7f66f2192c6fb9ef14ee905.tar.xz
Replace some Release() calls with virtual destructors.
Required fixing xfa-specific code. Original Review URL: https://codereview.chromium.org/1192013002. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1176413004.
Diffstat (limited to 'core/src/fpdfapi/fpdf_font/ttgsubtable.cpp')
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
index 3dde7fbdf6..a65359c1d4 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -4,9 +4,11 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+#include "../../../../third_party/base/nonstd_unique_ptr.h"
#include "../../../include/fxge/fx_ge.h"
#include "../../../include/fxge/fx_freetype.h"
#include "ttgsubtable.h"
+
CFX_GlyphMap::CFX_GlyphMap()
{
}
@@ -422,7 +424,8 @@ FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum)
{
return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum);
}
-IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont)
+// static
+IFX_GSUBTable* IFX_GSUBTable::Create(CFX_Font* pFont)
{
if (!pFont) {
return NULL;
@@ -439,11 +442,10 @@ IFX_GSUBTable* FXGE_CreateGSUBTable(CFX_Font* pFont)
}
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) {
- CFX_GSUBTable* pGsubTable = new CFX_GSUBTable;
+ nonstd::unique_ptr<CFX_GSUBTable> pGsubTable(new CFX_GSUBTable);
if (pGsubTable->m_GsubImp.LoadGSUBTable((FT_Bytes)pFont->m_pGsubData)) {
- return pGsubTable;
+ return pGsubTable.release();
}
- pGsubTable->Release();
}
return NULL;
}