summaryrefslogtreecommitdiff
path: root/xfa/fde/tto
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/fde/tto
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/fde/tto')
-rw-r--r--xfa/fde/tto/fde_textout.cpp2
-rw-r--r--xfa/fde/tto/fde_textout.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp
index cf541a289c..1081526148 100644
--- a/xfa/fde/tto/fde_textout.cpp
+++ b/xfa/fde/tto/fde_textout.cpp
@@ -46,7 +46,7 @@ CFDE_TextOut::~CFDE_TextOut() {
m_ttoLines.RemoveAll(false);
}
-void CFDE_TextOut::SetFont(CFGAS_GEFont* pFont) {
+void CFDE_TextOut::SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont) {
ASSERT(pFont);
m_pFont = pFont;
m_pTxtBreak->SetFont(pFont);
diff --git a/xfa/fde/tto/fde_textout.h b/xfa/fde/tto/fde_textout.h
index 684a6411fa..f9eeb82ddc 100644
--- a/xfa/fde/tto/fde_textout.h
+++ b/xfa/fde/tto/fde_textout.h
@@ -79,7 +79,7 @@ class CFDE_TextOut : public CFX_Target {
CFDE_TextOut();
~CFDE_TextOut() override;
- void SetFont(CFGAS_GEFont* pFont);
+ void SetFont(const CFX_RetainPtr<CFGAS_GEFont>& pFont);
void SetFontSize(FX_FLOAT fFontSize);
void SetTextColor(FX_ARGB color);
void SetStyles(uint32_t dwStyles);
@@ -153,7 +153,7 @@ class CFDE_TextOut : public CFX_Target {
void DrawLine(const FDE_TTOPIECE* pPiece, CFDE_Pen*& pPen);
std::unique_ptr<CFX_TxtBreak> m_pTxtBreak;
- CFGAS_GEFont* m_pFont; // not owned.
+ CFX_RetainPtr<CFGAS_GEFont> m_pFont;
FX_FLOAT m_fFontSize;
FX_FLOAT m_fLineSpace;
FX_FLOAT m_fLinePos;