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

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

Issue 1417933002: Add type cast definitions for CPDF_String. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 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_page/fpdf_page_parser.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 1283a3a596be9b1fb3e4b04ba99cb2ddb3406391..b52a592d83cf656b51d887dd3a7fb8c9e36c224b 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -1359,10 +1359,8 @@ void CPDF_StreamContentParser::Handle_ShowText_Positioning() {
}
int n = pArray->GetCount(), nsegs = 0, i;
Tom Sepez 2015/10/21 17:12:50 nit: one per line, also make i local to |for (int
dsinclair 2015/10/21 17:40:01 Done.
for (i = 0; i < n; i++) {
- CPDF_Object* pObj = pArray->GetElementValue(i);
- if (pObj->GetType() == PDFOBJ_STRING) {
+ if (pArray->GetElementValue(i)->AsString())
Lei Zhang 2015/10/21 16:55:56 IsString ?
dsinclair 2015/10/21 17:08:05 Done.
nsegs++;
- }
}
if (nsegs == 0) {
for (i = 0; i < n; i++) {
@@ -1379,7 +1377,7 @@ void CPDF_StreamContentParser::Handle_ShowText_Positioning() {
FX_FLOAT fInitKerning = 0;
for (i = 0; i < n; i++) {
CPDF_Object* pObj = pArray->GetElementValue(i);
- if (pObj->GetType() == PDFOBJ_STRING) {
+ if (pObj->IsString()) {
CFX_ByteString str = pObj->GetString();
if (str.IsEmpty()) {
continue;

Powered by Google App Engine
This is Rietveld 408576698