summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_textbreak.h
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-04 16:37:48 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-04 16:37:48 -0700
commit1b4f6b36b3ed8d1f6cea96bc32c1b376f4a499bc (patch)
treeaa3ba6730495096411f2a3555c74e83f5d1fca11 /xfa/fgas/layout/fgas_textbreak.h
parent52a5005c453a9e08384e375ae51c5f1ad628fe86 (diff)
downloadpdfium-1b4f6b36b3ed8d1f6cea96bc32c1b376f4a499bc.tar.xz
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
Diffstat (limited to 'xfa/fgas/layout/fgas_textbreak.h')
-rw-r--r--xfa/fgas/layout/fgas_textbreak.h10
1 files changed, 6 insertions, 4 deletions
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 <memory>
+
#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<CFX_TxtCharArray> m_pLineChars;
+ std::unique_ptr<CFX_TxtPieceArray> 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<CFX_TxtLine> m_pTxtLine1;
+ std::unique_ptr<CFX_TxtLine> m_pTxtLine2;
CFX_TxtLine* m_pCurLine;
int32_t m_iReady;
int32_t m_iTolerance;