summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_docpagedata.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-24 14:07:18 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-24 21:19:30 +0000
commit4734512572776f8fc705e28fba8a46d981372e99 (patch)
treef791427bf7d0acfb590880c8bcc1f4c4c370dba6 /core/fpdfapi/page/cpdf_docpagedata.cpp
parenta38f7989beacdf0a73441e4096d9ce7a196b10d3 (diff)
downloadpdfium-4734512572776f8fc705e28fba8a46d981372e99.tar.xz
Convert to CFX_UnownedPtr, part 8chromium/3110
Change-Id: I99d6b4df72e369652301c36e4046f03ef95ed07d Reviewed-on: https://pdfium-review.googlesource.com/5837 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_docpagedata.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_docpagedata.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/fpdfapi/page/cpdf_docpagedata.cpp b/core/fpdfapi/page/cpdf_docpagedata.cpp
index 58e81559ea..435b0f2eec 100644
--- a/core/fpdfapi/page/cpdf_docpagedata.cpp
+++ b/core/fpdfapi/page/cpdf_docpagedata.cpp
@@ -28,7 +28,7 @@
#include "third_party/base/stl_util.h"
CPDF_DocPageData::CPDF_DocPageData(CPDF_Document* pPDFDoc)
- : m_pPDFDoc(pPDFDoc), m_bForceClear(false) {
+ : m_bForceClear(false), m_pPDFDoc(pPDFDoc) {
assert(m_pPDFDoc);
}
@@ -117,7 +117,8 @@ CPDF_Font* CPDF_DocPageData::GetFont(CPDF_Dictionary* pFontDict) {
return pFontData->AddRef();
}
}
- std::unique_ptr<CPDF_Font> pFont = CPDF_Font::Create(m_pPDFDoc, pFontDict);
+ std::unique_ptr<CPDF_Font> pFont =
+ CPDF_Font::Create(m_pPDFDoc.Get(), pFontDict);
if (!pFont)
return nullptr;
@@ -165,7 +166,7 @@ CPDF_Font* CPDF_DocPageData::GetStandardFont(const CFX_ByteString& fontName,
pEncoding->Realize(m_pPDFDoc->GetByteStringPool()));
}
- std::unique_ptr<CPDF_Font> pFont = CPDF_Font::Create(m_pPDFDoc, pDict);
+ std::unique_ptr<CPDF_Font> pFont = CPDF_Font::Create(m_pPDFDoc.Get(), pDict);
if (!pFont)
return nullptr;
@@ -268,7 +269,7 @@ CPDF_ColorSpace* CPDF_DocPageData::GetColorSpaceImpl(
}
std::unique_ptr<CPDF_ColorSpace> pCS =
- CPDF_ColorSpace::Load(m_pPDFDoc, pArray);
+ CPDF_ColorSpace::Load(m_pPDFDoc.Get(), pArray);
if (!pCS)
return nullptr;
@@ -329,18 +330,18 @@ CPDF_Pattern* CPDF_DocPageData::GetPattern(CPDF_Object* pPatternObj,
}
std::unique_ptr<CPDF_Pattern> pPattern;
if (bShading) {
- pPattern = pdfium::MakeUnique<CPDF_ShadingPattern>(m_pPDFDoc, pPatternObj,
- true, matrix);
+ pPattern = pdfium::MakeUnique<CPDF_ShadingPattern>(
+ m_pPDFDoc.Get(), pPatternObj, true, matrix);
} else {
CPDF_Dictionary* pDict = pPatternObj->GetDict();
if (pDict) {
int type = pDict->GetIntegerFor("PatternType");
if (type == CPDF_Pattern::TILING) {
- pPattern = pdfium::MakeUnique<CPDF_TilingPattern>(m_pPDFDoc,
+ pPattern = pdfium::MakeUnique<CPDF_TilingPattern>(m_pPDFDoc.Get(),
pPatternObj, matrix);
} else if (type == CPDF_Pattern::SHADING) {
pPattern = pdfium::MakeUnique<CPDF_ShadingPattern>(
- m_pPDFDoc, pPatternObj, false, matrix);
+ m_pPDFDoc.Get(), pPatternObj, false, matrix);
}
}
}
@@ -382,7 +383,7 @@ CFX_RetainPtr<CPDF_Image> CPDF_DocPageData::GetImage(uint32_t dwStreamObjNum) {
if (it != m_ImageMap.end())
return it->second;
- auto pImage = pdfium::MakeRetain<CPDF_Image>(m_pPDFDoc, dwStreamObjNum);
+ auto pImage = pdfium::MakeRetain<CPDF_Image>(m_pPDFDoc.Get(), dwStreamObjNum);
m_ImageMap[dwStreamObjNum] = pImage;
return pImage;
}