Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Unified Diff: xfa/fgas/layout/fgas_rtfbreak.h

Issue 2609423003: Properly ref-count CFGAS_GEFont with CFX_RetainPtr. (Closed)
Patch Set: comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/fgas/layout/fgas_rtfbreak.h
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index de2497ed1d14b8000dbb98d306294ba3b2d03c5b..c281192553f52b9b89fb3489644117ab86900c2b 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;

Powered by Google App Engine
This is Rietveld 408576698