summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/PublicMethods.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-10-14 14:17:26 -0700
committerTom Sepez <tsepez@chromium.org>2015-10-14 14:17:26 -0700
commitdfbf8e7ba55695c4e6cb30eadbe9c6a2955815ba (patch)
tree58eef2a1e6763f71926524827da0f220f761f960 /fpdfsdk/src/javascript/PublicMethods.cpp
parent758ae14e113c07285126274577d7a5cab559fa65 (diff)
downloadpdfium-dfbf8e7ba55695c4e6cb30eadbe9c6a2955815ba.tar.xz
Next round of XFA changes to match master.
This contains a missed merge of the Document:delay fixes. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1398703009 .
Diffstat (limited to 'fpdfsdk/src/javascript/PublicMethods.cpp')
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index 0b3b38f8f1..71726a2db0 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -48,9 +48,18 @@ END_JS_STATIC_GLOBAL_FUN()
IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods)
-static const FX_WCHAR* months[] = {L"Jan", L"Feb", L"Mar", L"Apr",
- L"May", L"Jun", L"Jul", L"Aug",
- L"Sep", L"Oct", L"Nov", L"Dec"};
+static const FX_WCHAR* const months[] = {L"Jan",
+ L"Feb",
+ L"Mar",
+ L"Apr",
+ L"May",
+ L"Jun",
+ L"Jul",
+ L"Aug",
+ L"Sep",
+ L"Oct",
+ L"Nov",
+ L"Dec"};
static const FX_WCHAR* const fullmonths[] = {
L"January", L"February", L"March", L"April",
@@ -935,7 +944,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc,
strValue.Replace(",", ".");
double dValue = atof(strValue);
if (iDec > 0)
- dValue += DOUBLE_CORRECT; //
+ dValue += DOUBLE_CORRECT;
int iDec2;
int iNegative = 0;
@@ -984,11 +993,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc,
else
cSeperator = '.';
- int iDecPositive, iDecNegative;
- iDecPositive = iDec2;
- iDecNegative = iDec2;
-
- for (iDecPositive = iDec2 - 3; iDecPositive > 0; iDecPositive -= 3) {
+ for (int iDecPositive = iDec2 - 3; iDecPositive > 0; iDecPositive -= 3) {
strValue.Insert(iDecPositive, cSeperator);
iMax++;
}
@@ -1274,11 +1279,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IJS_Context* cc,
else
cSeperator = '.';
- int iDecPositive, iDecNegative;
- iDecPositive = iDec2;
- iDecNegative = iDec2;
-
- for (iDecPositive = iDec2 - 3; iDecPositive > 0; iDecPositive -= 3) {
+ for (int iDecPositive = iDec2 - 3; iDecPositive > 0; iDecPositive -= 3) {
strValue.Insert(iDecPositive, cSeperator);
iMax++;
}