summaryrefslogtreecommitdiff
path: root/xfa/src/fxgraphics
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-17 18:36:43 -0700
committerLei Zhang <thestig@chromium.org>2015-08-17 18:36:43 -0700
commit1b0023986bc22ce362097b25deb9746b693ef235 (patch)
tree4d18ffc5f9eff4ac4659531621be8d2c28e3c71c /xfa/src/fxgraphics
parenta0f67247277f666d80899985eda3c19f3641b9bf (diff)
downloadpdfium-1b0023986bc22ce362097b25deb9746b693ef235.tar.xz
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 .
Diffstat (limited to 'xfa/src/fxgraphics')
-rw-r--r--xfa/src/fxgraphics/src/fx_graphics.cpp9
-rw-r--r--xfa/src/fxgraphics/src/fx_path_generator.h3
2 files changed, 8 insertions, 4 deletions
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<CFX_UnicodeEncoding> 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();