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

Unified Diff: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp

Issue 2001783003: Get rid of CPDF_Object::GetArray(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 4 years, 7 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 | « no previous file | core/fpdfapi/fpdf_parser/cpdf_array.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 0374915af422ffbd1c55209cc38aacbeefd8898b..8985b50291155b19ef3f70c972b3314de9e2417b 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -697,7 +697,7 @@ void CPDF_StreamContentParser::Handle_SetColorSpace_Stroke() {
}
void CPDF_StreamContentParser::Handle_SetDash() {
- CPDF_Array* pArray = GetObject(1) ? GetObject(1)->GetArray() : nullptr;
+ CPDF_Array* pArray = ToArray(GetObject(1));
if (!pArray)
return;
@@ -1306,10 +1306,10 @@ void CPDF_StreamContentParser::Handle_ShowText() {
}
void CPDF_StreamContentParser::Handle_ShowText_Positioning() {
- CPDF_Array* pArray = GetObject(0) ? GetObject(0)->GetArray() : NULL;
- if (!pArray) {
+ CPDF_Array* pArray = ToArray(GetObject(0));
+ if (!pArray)
return;
- }
+
size_t n = pArray->GetCount();
size_t nsegs = 0;
for (size_t i = 0; i < n; i++) {
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_array.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698