From 1b4f6b36b3ed8d1f6cea96bc32c1b376f4a499bc Mon Sep 17 00:00:00 2001 From: weili Date: Thu, 4 Aug 2016 16:37:48 -0700 Subject: Use smart pointers for class owned pointers For classes under xfa/fgas, xfa/fwl/basewidget, and xfa/fwl/core, use smart pointers instead of raw pointer to make memory management easier. BUG=pdfium:518 Review-Url: https://codereview.chromium.org/2207093005 --- xfa/fgas/layout/fgas_textbreak.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'xfa/fgas/layout/fgas_textbreak.h') diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h index 3d8e3bdbb8..366ba80cd0 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -7,6 +7,8 @@ #ifndef XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ #define XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ +#include + #include "core/fxcrt/include/fx_ucd.h" #include "core/fxge/include/fx_ge.h" #include "xfa/fgas/crt/fgas_utils.h" @@ -188,8 +190,8 @@ class CFX_TxtLine { m_iArabicChars = 0; } - CFX_TxtCharArray* m_pLineChars; - CFX_TxtPieceArray* m_pLinePieces; + std::unique_ptr m_pLineChars; + std::unique_ptr m_pLinePieces; int32_t m_iStart; int32_t m_iWidth; int32_t m_iArabicChars; @@ -297,8 +299,8 @@ class CFX_TxtBreak { int32_t m_iCurAlignment; FX_BOOL m_bArabicNumber; FX_BOOL m_bArabicComma; - CFX_TxtLine* m_pTxtLine1; - CFX_TxtLine* m_pTxtLine2; + std::unique_ptr m_pTxtLine1; + std::unique_ptr m_pTxtLine2; CFX_TxtLine* m_pCurLine; int32_t m_iReady; int32_t m_iTolerance; -- cgit v1.2.3