Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1193)

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp

Issue 1709393002: Remove PageObject's m_Type and add As<Type> functions (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp ('k') | core/src/fpdfapi/fpdf_render/render_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
index d2faac3b7ea7eef7d781bbe339a3a818f889e4cc..769ee05dc91ac8c6689abebdeff5201134a90d07 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -318,10 +318,9 @@ FX_BOOL CPDF_Type3Char::LoadBitmap(CPDF_RenderContext* pContext) {
}
if (m_pForm->GetPageObjectList()->size() == 1 && !m_bColored) {
auto& pPageObj = m_pForm->GetPageObjectList()->front();
- if (pPageObj->m_Type == CPDF_PageObject::IMAGE) {
- CPDF_ImageObject* pImage = static_cast<CPDF_ImageObject*>(pPageObj.get());
- m_ImageMatrix = pImage->m_Matrix;
- const CFX_DIBSource* pSource = pImage->m_pImage->LoadDIBSource();
+ if (pPageObj->IsImage()) {
+ const CFX_DIBSource* pSource =
+ pPageObj->AsImage()->m_pImage->LoadDIBSource();
if (pSource) {
m_pBitmap = pSource->Clone();
delete pSource;
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp ('k') | core/src/fpdfapi/fpdf_render/render_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698