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

Unified Diff: fpdfsdk/src/fsdk_baseform.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
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_Utils.cpp ('k') | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fsdk_baseform.cpp
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index b4aa822bb69e84683f1854b4628501f7fec66cf4..542ade022a372906fa05a78058ce4b9c362d2582 100644
--- a/fpdfsdk/src/fsdk_baseform.cpp
+++ b/fpdfsdk/src/fsdk_baseform.cpp
@@ -2053,10 +2053,9 @@ void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer) {
CPDF_Object* pJS = pJSDict->GetElementValue("Before");
if (pJS != NULL) {
- int iType = pJS->GetType();
- if (iType == PDFOBJ_STRING)
+ if (pJS->IsString())
csJS = pJSDict->GetUnicodeText("Before");
- else if (iType == PDFOBJ_STREAM)
+ else if (pJS->GetType() == PDFOBJ_STREAM)
csJS = pJS->GetUnicodeText();
}
}
@@ -2226,13 +2225,12 @@ void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects,
if (pObject == NULL)
continue;
- int iType = pObject->GetType();
- if (iType == PDFOBJ_STRING) {
+ if (pObject->IsString()) {
CFX_WideString csName = pObject->GetUnicodeText();
CPDF_FormField* pField = m_pInterForm->GetField(0, csName);
if (pField != NULL)
fields.Add(pField);
- } else if (iType == PDFOBJ_DICTIONARY) {
+ } else if (pObject->IsDictionary()) {
if (m_pInterForm->IsValidFormField(pObject))
fields.Add(pObject);
}
« no previous file with comments | « fpdfsdk/src/formfiller/FFL_Utils.cpp ('k') | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698