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

Unified Diff: fpdfsdk/src/javascript/Field.cpp

Issue 1573243016: Revert "Cleanup CJS_PublicMethods::ParseNumber" (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 11 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 | fpdfsdk/src/javascript/PublicMethods.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/Field.cpp
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index ebd3d331f5bf0e6a4f6f3428548ab8d5c781840e..959e8dcadd560a8052c387aea1a08880ae97bf06 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -2741,8 +2741,13 @@ FX_BOOL Field::value(IJS_Context* cc,
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet)) {
- vp << dRet;
+ FX_BOOL bDot;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet,
+ bDot)) {
+ if (bDot)
+ vp << dRet;
+ else
+ vp << dRet;
} else {
vp << swValue;
}
@@ -2764,8 +2769,13 @@ FX_BOOL Field::value(IJS_Context* cc,
CFX_WideString swValue = pFormField->GetValue();
double dRet;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet)) {
- vp << dRet;
+ FX_BOOL bDot;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet,
+ bDot)) {
+ if (bDot)
+ vp << dRet;
+ else
+ vp << dRet;
} else {
vp << swValue;
}
@@ -2780,7 +2790,9 @@ FX_BOOL Field::value(IJS_Context* cc,
CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
double dRet;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet)) {
+ FX_BOOL bDotDummy;
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet,
+ bDotDummy)) {
vp << dRet;
} else {
vp << swValue;
« no previous file with comments | « no previous file | fpdfsdk/src/javascript/PublicMethods.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698