From edc1e4e5baac33c8f2799e82ff52fd556d3c5e02 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 24 May 2017 13:21:45 -0700 Subject: Convert to CFX_UnownedPtr, part 9 Change-Id: Ia1151e0855accda0873251938a521df1913c73fa Reviewed-on: https://pdfium-review.googlesource.com/5852 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fpdfapi/font/cpdf_font.h | 5 +++-- core/fpdfapi/font/cpdf_type3font.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'core/fpdfapi/font') diff --git a/core/fpdfapi/font/cpdf_font.h b/core/fpdfapi/font/cpdf_font.h index be1d91319e..c8e65e26a5 100644 --- a/core/fpdfapi/font/cpdf_font.h +++ b/core/fpdfapi/font/cpdf_font.h @@ -11,6 +11,7 @@ #include #include "core/fpdfapi/parser/cpdf_stream_acc.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" #include "core/fxge/fx_font.h" @@ -78,7 +79,7 @@ class CPDF_Font { virtual int GetCharWidthF(uint32_t charcode) = 0; virtual FX_RECT GetCharBBox(uint32_t charcode) = 0; - CPDF_Document* GetDocument() { return m_pDocument; } + CPDF_Document* GetDocument() const { return m_pDocument.Get(); } CFX_Font* GetFont() { return &m_Font; } const CFX_Font* GetFont() const { return &m_Font; } CFX_Font* GetFontFallback(int position); @@ -101,7 +102,7 @@ class CPDF_Font { const std::vector& charnames, int charcode); - CPDF_Document* m_pDocument; + CFX_UnownedPtr m_pDocument; CFX_Font m_Font; std::vector> m_FontFallbacks; CFX_ByteString m_BaseFont; diff --git a/core/fpdfapi/font/cpdf_type3font.cpp b/core/fpdfapi/font/cpdf_type3font.cpp index 1e8c567a7f..b1ac99b0c3 100644 --- a/core/fpdfapi/font/cpdf_type3font.cpp +++ b/core/fpdfapi/font/cpdf_type3font.cpp @@ -107,7 +107,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(uint32_t charcode) { auto pNewChar = pdfium::MakeUnique(pdfium::MakeUnique( - m_pDocument, + m_pDocument.Get(), m_pFontResources ? m_pFontResources.Get() : m_pPageResources.Get(), pStream, nullptr)); -- cgit v1.2.3