summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_page
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-08-05 22:34:58 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-05 22:34:58 -0700
commitf41d9dc1ead47a1218e1cd37bd74ec850c8baaa3 (patch)
treed8d32b58909814f9835898c4a87f03b5bc510e69 /core/fpdfapi/fpdf_page
parent8ca63de14d522d3d259d74fa43b28b05b02728e8 (diff)
downloadpdfium-f41d9dc1ead47a1218e1cd37bd74ec850c8baaa3.tar.xz
Add CPDF_ImageObject::GetImage().
And use it where appropriate. Review-Url: https://codereview.chromium.org/2224623002
Diffstat (limited to 'core/fpdfapi/fpdf_page')
-rw-r--r--core/fpdfapi/fpdf_page/fpdf_page_parser.cpp4
-rw-r--r--core/fpdfapi/fpdf_page/include/cpdf_imageobject.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 5a77ba70b2..e20fe44db8 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -743,7 +743,7 @@ void CPDF_StreamContentParser::Handle_ExecuteXObject() {
if (type == "Image") {
CPDF_ImageObject* pObj = AddImage(pXObject, nullptr, false);
m_LastImageName = name;
- m_pLastImage = pObj->m_pImage;
+ m_pLastImage = pObj->GetImage();
if (!m_pObjectHolder->HasImageMask())
m_pObjectHolder->SetHasImageMask(m_pLastImage->IsMask());
} else if (type == "Form") {
@@ -792,7 +792,7 @@ CPDF_ImageObject* CPDF_StreamContentParser::AddImage(CPDF_Stream* pStream,
pImageObj->m_pImage = new CPDF_Image(m_pDocument);
pImageObj->m_pImage->LoadImageF(pStream, bInline);
}
- SetGraphicStates(pImageObj.get(), pImageObj->m_pImage->IsMask(), FALSE,
+ SetGraphicStates(pImageObj.get(), pImageObj->GetImage()->IsMask(), FALSE,
FALSE);
pImageObj->m_Matrix = ImageMatrix;
pImageObj->CalcBoundingBox();
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h b/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h
index 1128d12f8b..b2bffa707c 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_imageobject.h
@@ -26,6 +26,7 @@ class CPDF_ImageObject : public CPDF_PageObject {
const CPDF_ImageObject* AsImage() const override;
void CalcBoundingBox();
+ CPDF_Image* GetImage() const { return m_pImage; }
CPDF_Image* m_pImage;
CFX_Matrix m_Matrix;