summaryrefslogtreecommitdiff
path: root/xfa/fde/tto/fde_textout.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-04 15:43:59 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-04 15:43:59 -0700
commitcddf8253692d3beaa97a502c8b60c1d18f81664a (patch)
treebaa5b2456a1bdfec97fa97be2ef07eb3295a82d7 /xfa/fde/tto/fde_textout.h
parent32e693fe13105fab5baf81b334e932fce62d89b5 (diff)
downloadpdfium-cddf8253692d3beaa97a502c8b60c1d18f81664a.tar.xz
Use smart pointers for class owned pointers under xfa/fde
Use smart pointer to replace raw pointer type for class owned member variables so that memory management will be easier. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2208423002
Diffstat (limited to 'xfa/fde/tto/fde_textout.h')
-rw-r--r--xfa/fde/tto/fde_textout.h16
1 files changed, 7 insertions, 9 deletions
diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h
index 14ca5e19bb..8d2c0fe8a0 100644
--- a/xfa/fde/tto/fde_textout.h
+++ b/xfa/fde/tto/fde_textout.h
@@ -8,6 +8,7 @@
#define XFA_FDE_TTO_FDE_TEXTOUT_H_
#include <memory>
+#include <vector>
#include "core/fxge/include/fx_dib.h"
#include "core/fxge/include/fx_ge.h"
@@ -131,7 +132,7 @@ class CFDE_TextOut : public CFX_Target {
void LoadText(const FX_WCHAR* pwsStr, int32_t iLength, const CFX_RectF& rect);
void LoadEllipsis();
void ExpandBuffer(int32_t iSize, int32_t iType);
- void RetrieveEllPieces(int32_t*& pCharWidths);
+ void RetrieveEllPieces(std::vector<int32_t>* pCharWidths);
void Reload(const CFX_RectF& rect);
void ReloadLinePiece(CFDE_TTOLine* pLine, const CFX_RectF& rect);
@@ -152,18 +153,16 @@ class CFDE_TextOut : public CFX_Target {
FX_TXTRUN ToTextRun(const FDE_TTOPIECE* pPiece);
void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen);
- CFX_TxtBreak* m_pTxtBreak;
- CFGAS_GEFont* m_pFont;
+ std::unique_ptr<CFX_TxtBreak> m_pTxtBreak;
+ CFGAS_GEFont* m_pFont; // not owned.
FX_FLOAT m_fFontSize;
FX_FLOAT m_fLineSpace;
FX_FLOAT m_fLinePos;
FX_FLOAT m_fTolerance;
int32_t m_iAlignment;
int32_t m_iTxtBkAlignment;
- int32_t* m_pCharWidths;
- int32_t m_iChars;
- int32_t* m_pEllCharWidths;
- int32_t m_iEllChars;
+ std::vector<int32_t> m_CharWidths;
+ std::vector<int32_t> m_EllCharWidths;
FX_WCHAR m_wParagraphBkChar;
FX_ARGB m_TxtColor;
uint32_t m_dwStyles;
@@ -179,8 +178,7 @@ class CFDE_TextOut : public CFX_Target {
int32_t m_iCurLine;
int32_t m_iCurPiece;
int32_t m_iTotalLines;
- FXTEXT_CHARPOS* m_pCharPos;
- int32_t m_iCharPosSize;
+ std::vector<FXTEXT_CHARPOS> m_CharPos;
std::unique_ptr<CFDE_RenderDevice> m_pRenderDevice;
CFX_Int32Array m_hotKeys;
CFX_RectFArray m_rectArray;