summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_rtfbreak.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2017-01-05 12:57:00 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-05 12:57:00 -0800
commite647799f6a2f7f747c9f55d9f0ce08dcdfbd53f4 (patch)
tree282c502bd9f807f385d0cbcc1692bb475c8a4df1 /xfa/fgas/layout/fgas_rtfbreak.h
parent6bb3b894488fd6f38c096b708980a9f08286ac5c (diff)
downloadpdfium-e647799f6a2f7f747c9f55d9f0ce08dcdfbd53f4.tar.xz
Properly ref-count CFGAS_GEFont with CFX_RetainPtr.
We worry about cyclical references, but no leaks found. Review-Url: https://codereview.chromium.org/2609423003
Diffstat (limited to 'xfa/fgas/layout/fgas_rtfbreak.h')
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index de2497ed1d..c281192553 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.h
+++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -67,11 +67,12 @@ class CFGAS_GEFont;
struct FX_RTFTEXTOBJ {
FX_RTFTEXTOBJ();
+ ~FX_RTFTEXTOBJ();
const FX_WCHAR* pStr;
int32_t* pWidths;
int32_t iLength;
- CFGAS_GEFont* pFont;
+ CFX_RetainPtr<CFGAS_GEFont> pFont;
FX_FLOAT fFontSize;
uint32_t dwLayoutStyles;
int32_t iCharRotation;
@@ -222,7 +223,7 @@ class CFX_RTFBreak {
void SetLineStartPos(FX_FLOAT fLinePos);
uint32_t GetLayoutStyles() const { return m_dwLayoutStyles; }
void SetLayoutStyles(uint32_t dwLayoutStyles);
- void SetFont(CFGAS_GEFont* pFont);
+ void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont);
void SetFontSize(FX_FLOAT fFontSize);
void SetTabWidth(FX_FLOAT fTabWidth);
void AddPositionedTab(FX_FLOAT fTabPos);
@@ -294,7 +295,7 @@ class CFX_RTFBreak {
bool m_bVertical;
bool m_bSingleLine;
bool m_bCharCode;
- CFGAS_GEFont* m_pFont;
+ CFX_RetainPtr<CFGAS_GEFont> m_pFont;
int32_t m_iFontHeight;
int32_t m_iFontSize;
int32_t m_iTabWidth;