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

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

Issue 1417823005: Add type cast definitions for CPDF_Name. (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..53afc47dba0c9274b31a70ed8aa199947755b363 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -413,11 +413,10 @@ void CPDF_StreamContentParser::Handle_BeginMarkedContent_Dictionary() {
return;
}
FX_BOOL bDirect = TRUE;
- if (pProperty->GetType() == PDFOBJ_NAME) {
+ if (pProperty->IsName()) {
pProperty = FindResourceObj(FX_BSTRC("Properties"), pProperty->GetString());
- if (pProperty == NULL) {
+ if (!pProperty)
return;
- }
bDirect = FALSE;
}
if (CPDF_Dictionary* pDict = pProperty->AsDictionary()) {
@@ -499,7 +498,8 @@ void _PDF_ReplaceAbbr(CPDF_Object* pObj) {
pDict->ReplaceKey(key, fullname);
key = fullname;
}
- if (value->GetType() == PDFOBJ_NAME) {
+
+ if (value->IsName()) {
CFX_ByteString name = value->GetString();
fullname = _PDF_FindFullName(
_PDF_InlineValueAbbr,
@@ -517,7 +517,7 @@ void _PDF_ReplaceAbbr(CPDF_Object* pObj) {
CPDF_Array* pArray = (CPDF_Array*)pObj;
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
CPDF_Object* pElement = pArray->GetElement(i);
- if (pElement->GetType() == PDFOBJ_NAME) {
+ if (pElement->IsName()) {
CFX_ByteString name = pElement->GetString();
CFX_ByteStringC fullname = _PDF_FindFullName(
_PDF_InlineValueAbbr,
@@ -562,7 +562,7 @@ void _PDF_ReplaceFull(CPDF_Object* pObj) {
pDict->ReplaceKey(key, abbrName);
key = abbrName;
}
- if (value->GetType() == PDFOBJ_NAME) {
+ if (value->IsName()) {
CFX_ByteString name = value->GetString();
abbrName = _PDF_FindAbbrName(
_PDF_InlineValueAbbr,
@@ -580,7 +580,7 @@ void _PDF_ReplaceFull(CPDF_Object* pObj) {
CPDF_Array* pArray = (CPDF_Array*)pObj;
for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
CPDF_Object* pElement = pArray->GetElement(i);
- if (pElement->GetType() == PDFOBJ_NAME) {
+ if (pElement->IsName()) {
CFX_ByteString name = pElement->GetString();
CFX_ByteStringC abbrName = _PDF_FindAbbrName(
_PDF_InlineValueAbbr,
@@ -1065,7 +1065,7 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Fill() {
}
int nargs = m_ParamCount;
int nvalues = nargs;
- if (pLastParam->GetType() == PDFOBJ_NAME) {
+ if (pLastParam->IsName()) {
nvalues--;
}
FX_FLOAT* values = NULL;
@@ -1095,9 +1095,9 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() {
}
int nargs = m_ParamCount;
int nvalues = nargs;
- if (pLastParam->GetType() == PDFOBJ_NAME) {
+ if (pLastParam->IsName())
nvalues--;
- }
+
FX_FLOAT* values = NULL;
if (nvalues) {
values = FX_Alloc(FX_FLOAT, nvalues);

Powered by Google App Engine
This is Rietveld 408576698