From 1b0023986bc22ce362097b25deb9746b693ef235 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 17 Aug 2015 18:36:43 -0700 Subject: Merge to XFA: Cleanup CFX_UnicodeEncoding and remove IFX_FontEncoding. Similarly, Clean up CFX_UnicodeEncodingEx and remove IFX_FontEncodingEx. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1296753003 . (cherry picked from commit 52a48aadc19b2dee8abeb702269bb168eb6b6999) Review URL: https://codereview.chromium.org/1297083002 . --- xfa/src/fxgraphics/src/fx_graphics.cpp | 9 +++++---- xfa/src/fxgraphics/src/fx_path_generator.h | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'xfa/src/fxgraphics') diff --git a/xfa/src/fxgraphics/src/fx_graphics.cpp b/xfa/src/fxgraphics/src/fx_graphics.cpp index c5eac42e87..df0ecbba22 100644 --- a/xfa/src/fxgraphics/src/fx_graphics.cpp +++ b/xfa/src/fxgraphics/src/fx_graphics.cpp @@ -4,8 +4,10 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "pre.h" +#include "../../../../third_party/base/nonstd_unique_ptr.h" #include "fx_path_generator.h" +#include "pre.h" + class CAGG_Graphics { public: CAGG_Graphics(); @@ -1098,7 +1100,8 @@ FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString& text, FX_DWORD* charCodes, FXTEXT_CHARPOS* charPos, CFX_RectF& rect) { - IFX_FontEncoding* encoding = FXGE_CreateUnicodeEncoding(_info._font); + nonstd::unique_ptr encoding( + new CFX_UnicodeEncoding(_info._font)); int32_t length = text.GetLength(); FX_FLOAT penX = (FX_FLOAT)rect.left; FX_FLOAT penY = (FX_FLOAT)rect.top; @@ -1135,8 +1138,6 @@ FX_ERR CFX_Graphics::CalcTextInfo(const CFX_WideString& text, } rect.width = (FX_FLOAT)penX - rect.left; rect.height = rect.top + _info._fontSize * _info._fontHScale - rect.top; - delete encoding; - encoding = NULL; return FX_ERR_Succeeded; } CAGG_Graphics::CAGG_Graphics() { diff --git a/xfa/src/fxgraphics/src/fx_path_generator.h b/xfa/src/fxgraphics/src/fx_path_generator.h index 7d34fe2d07..663087d4c3 100644 --- a/xfa/src/fxgraphics/src/fx_path_generator.h +++ b/xfa/src/fxgraphics/src/fx_path_generator.h @@ -6,6 +6,9 @@ #ifndef __H_FX_PATH_GENERATOR__ #define __H_FX_PATH_GENERATOR__ + +#include "../../../../core/include/fxge/fx_ge.h" + class CFX_PathGenerator { public: CFX_PathGenerator(); -- cgit v1.2.3