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

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

Issue 1194933003: Make CPDF_Object::GetString() a virtual method. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 5 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
Index: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index ce29baf738f8b5e3702132cd3882303a6334bb24..6ff0bfb468a407910a1d52804aa1415dfa9fc538 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -486,7 +486,8 @@ FX_BOOL CPDF_DIBSource::LoadColorInfo(CPDF_Dictionary* pFormResources, CPDF_Dict
}
} else if (pFilter->GetType() == PDFOBJ_ARRAY) {
CPDF_Array* pArray = (CPDF_Array*)pFilter;
- if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JPXDecode")) {
+ int count = pArray->GetCount() - 1;
+ if (pArray->GetStringAt(count) == "JPXDecode") {
m_bDoBpcCheck = FALSE;
return TRUE;
}
@@ -944,12 +945,13 @@ void CPDF_DIBSource::ValidateDictParam()
}
} else if (pFilter->GetType() == PDFOBJ_ARRAY) {
CPDF_Array *pArray = (CPDF_Array *)pFilter;
- if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("CCITTFaxDecode") ||
- pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("JBIG2Decode")) {
+ int count = pArray->GetCount() - 1;
+ if (pArray->GetStringAt(count) == "CCITTFaxDecode" ||
+ pArray->GetStringAt(count) == "JBIG2Decode") {
m_bpc = 1;
m_nComponents = 1;
}
- if (pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("DCTDecode")) {
+ if (pArray->GetStringAt(count) == "DCTDecode") {
Tom Sepez 2015/07/16 20:24:46 nit: is this |else if|?
// Previously, pArray->GetString(pArray->GetCount() - 1) == FX_BSTRC("RunLengthDecode") was checked in the "if" statement as well,
// but too many documents don't conform to it.
m_bpc = 8;

Powered by Google App Engine
This is Rietveld 408576698