diff options
author | Wei Li <weili@chromium.org> | 2016-03-11 17:00:48 -0800 |
---|---|---|
committer | Wei Li <weili@chromium.org> | 2016-03-11 17:00:48 -0800 |
commit | 97da97662417085774f75c26e535c6fbe70266ae (patch) | |
tree | 9654be693dfb20b49be80911fa8089ff319757f3 /fpdfsdk/src/javascript | |
parent | 55265016faac358266af280db6c62afa34ce2891 (diff) | |
download | pdfium-97da97662417085774f75c26e535c6fbe70266ae.tar.xz |
Re-enable MSVC warning 4800 for compiling with chromium_code
Mainly change the code to avoid the warnings; in a few cases we have
to use explicit casts.
BUG=pdfium:29
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1783023002 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r-- | fpdfsdk/src/javascript/Document.cpp | 4 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/Field.cpp | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 1c9c1f31f4..672a3a3874 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -652,7 +652,7 @@ FX_BOOL Document::submitForm(IJS_Context* cc, if (pPDFInterForm->CheckRequiredFields(&fieldObjects, true)) { pRuntime->BeginBlock(); - pInterForm->SubmitFields(strURL, fieldObjects, TRUE, !bFDF); + pInterForm->SubmitFields(strURL, fieldObjects, true, !bFDF); pRuntime->EndBlock(); } return TRUE; @@ -803,7 +803,7 @@ FX_BOOL Document::info(IJS_Context* cc, (float)pValueObj->GetNumber()); } else if (pValueObj->IsBoolean()) { FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(), - (bool)pValueObj->GetInteger()); + !!pValueObj->GetInteger()); } } vp << pObj; diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 35ef8b42da..0c0dfd17bf 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -3022,7 +3022,7 @@ FX_BOOL Field::checkThisBox(IJS_Context* cc, int nWidget = params[0].ToInt(); - FX_BOOL bCheckit = TRUE; + bool bCheckit = true; if (iSize >= 2) bCheckit = params[1].ToBool(); @@ -3036,10 +3036,12 @@ FX_BOOL Field::checkThisBox(IJS_Context* cc, return FALSE; if (nWidget < 0 || nWidget >= pFormField->CountControls()) return FALSE; + // TODO(weili): Check whether anything special needed for radio button, + // otherwise merge these branches. if (pFormField->GetFieldType() == FIELDTYPE_RADIOBUTTON) - pFormField->CheckControl(nWidget, bCheckit, TRUE); + pFormField->CheckControl(nWidget, bCheckit, true); else - pFormField->CheckControl(nWidget, bCheckit, TRUE); + pFormField->CheckControl(nWidget, bCheckit, true); UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); return TRUE; |