diff options
author | tsepez <tsepez@chromium.org> | 2016-09-23 07:26:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-23 07:26:29 -0700 |
commit | 3f4111fbff1233de9f5c67eda433bee0f5f88c4e (patch) | |
tree | 5cb30b258413915f8b800c871d235c123df1ad95 /core/fpdfapi/fpdf_font/font_int.h | |
parent | 917d24852841f4919f418076c0277d2742f961ca (diff) | |
download | pdfium-3f4111fbff1233de9f5c67eda433bee0f5f88c4e.tar.xz |
Make CPDF_Font::Create() return a std::unique_ptr.
Review-Url: https://codereview.chromium.org/2364643003
Diffstat (limited to 'core/fpdfapi/fpdf_font/font_int.h')
-rw-r--r-- | core/fpdfapi/fpdf_font/font_int.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/fpdfapi/fpdf_font/font_int.h b/core/fpdfapi/fpdf_font/font_int.h index 512fb6c474..bcadc8d826 100644 --- a/core/fpdfapi/fpdf_font/font_int.h +++ b/core/fpdfapi/fpdf_font/font_int.h @@ -46,8 +46,8 @@ class CFX_StockFontArray { CFX_StockFontArray(); ~CFX_StockFontArray(); - // Takes ownership of |pFont|. - void SetFont(uint32_t index, CPDF_Font* pFont); + // Takes ownership of |pFont|, returns unowned pointer to it. + CPDF_Font* SetFont(uint32_t index, std::unique_ptr<CPDF_Font> pFont); CPDF_Font* GetFont(uint32_t index) const; private: @@ -62,8 +62,10 @@ class CPDF_FontGlobals { void Clear(CPDF_Document* pDoc); CPDF_Font* Find(CPDF_Document* pDoc, uint32_t index); - // Takes ownership of |pFont|. - void Set(CPDF_Document* key, uint32_t index, CPDF_Font* pFont); + // Takes ownership of |pFont|, returns unowned pointer to it. + CPDF_Font* Set(CPDF_Document* key, + uint32_t index, + std::unique_ptr<CPDF_Font> pFont); CPDF_CMapManager m_CMapManager; struct { |