summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Chang <ochang@chromium.org>2015-10-22 11:20:22 -0700
committerOliver Chang <ochang@chromium.org>2015-10-22 11:20:22 -0700
commit2bc980424d23d83e0d4b57b248789232709e07b8 (patch)
tree9e1671b817a25e819a8634823f50898ecae27c1f
parentb57b4ad6daa32b8522c0ac5bb9d50451eb1f8469 (diff)
downloadpdfium-2bc980424d23d83e0d4b57b248789232709e07b8.tar.xz
Merge to XFA: Remove unused error variable from CFX_Font::AdjustMMParams
Also fixes a potential memory leak. R=tsepez@chromium.org, thestig@chromium.org BUG=pdfium:156 Review URL: https://codereview.chromium.org/1409973003 . (cherry picked from commit de49cf173d12fe7a462168e2bf6c44971d7d28f8) Review URL: https://codereview.chromium.org/1420103002 .
-rw-r--r--core/src/fxge/ge/fx_ge_text.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp
index f2ac7129a2..2f7641ac64 100644
--- a/core/src/fxge/ge/fx_ge_text.cpp
+++ b/core/src/fxge/ge/fx_ge_text.cpp
@@ -1373,20 +1373,21 @@ void CFX_Font::AdjustMMParams(int glyph_index, int dest_width, int weight) {
int min_param = FXFT_Get_MM_Axis_Min(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
int max_param = FXFT_Get_MM_Axis_Max(FXFT_Get_MM_Axis(pMasters, 1)) / 65536;
coords[1] = min_param;
- int error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
- error = FXFT_Load_Glyph(
+ (void)FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
+ (void)FXFT_Load_Glyph(
m_Face, glyph_index,
FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
int min_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 /
FXFT_Get_Face_UnitsPerEM(m_Face);
coords[1] = max_param;
- error = FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
- error = FXFT_Load_Glyph(
+ (void)FXFT_Set_MM_Design_Coordinates(m_Face, 2, coords);
+ (void)FXFT_Load_Glyph(
m_Face, glyph_index,
FXFT_LOAD_NO_SCALE | FXFT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
int max_width = FXFT_Get_Glyph_HoriAdvance(m_Face) * 1000 /
FXFT_Get_Face_UnitsPerEM(m_Face);
if (max_width == min_width) {
+ FXFT_Free(m_Face, pMasters);
return;
}
int param = min_param +