From e647799f6a2f7f747c9f55d9f0ce08dcdfbd53f4 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 5 Jan 2017 12:57:00 -0800 Subject: Properly ref-count CFGAS_GEFont with CFX_RetainPtr. We worry about cyclical references, but no leaks found. Review-Url: https://codereview.chromium.org/2609423003 --- xfa/fgas/layout/fgas_textbreak.h | 6 +++--- 1 file changed, 3 insertions(+), 3 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 7bae6cd46e..36602749c7 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -93,7 +93,7 @@ struct FX_TXTRUN { CFX_WideString wsStr; int32_t* pWidths; int32_t iLength; - CFGAS_GEFont* pFont; + CFX_RetainPtr pFont; FX_FLOAT fFontSize; uint32_t dwStyles; int32_t iHorizontalScale; @@ -206,7 +206,7 @@ class CFX_TxtBreak { void SetLinePos(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& pFont); void SetFontSize(FX_FLOAT fFontSize); void SetTabWidth(FX_FLOAT fTabWidth, bool bEquidistant); void SetDefaultChar(FX_WCHAR wch); @@ -280,7 +280,7 @@ class CFX_TxtBreak { bool m_bCombText; int32_t m_iArabicContext; int32_t m_iCurArabicContext; - CFGAS_GEFont* m_pFont; + CFX_RetainPtr m_pFont; int32_t m_iFontSize; bool m_bEquidistant; int32_t m_iTabWidth; -- cgit v1.2.3