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

Unified Diff: xfa/src/fxgraphics/src/fx_graphics.cpp

Issue 1297083002: Merge to XFA: Cleanup CFX_UnicodeEncoding and remove IFX_FontEncoding. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: nits 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
« no previous file with comments | « xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp ('k') | xfa/src/fxgraphics/src/fx_path_generator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxgraphics/src/fx_graphics.cpp
diff --git a/xfa/src/fxgraphics/src/fx_graphics.cpp b/xfa/src/fxgraphics/src/fx_graphics.cpp
index c5eac42e87c8636d484cbd5e7eed04ecc1dae02d..df0ecbba22082b4d9128bdd741106d111214bf29 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() {
« no previous file with comments | « xfa/src/fxbarcode/oned/BC_OneDimWriter.cpp ('k') | xfa/src/fxgraphics/src/fx_path_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698