summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/PublicMethods.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-03-31 20:03:24 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-31 20:03:24 -0700
commit64376be4aac4710848b36b823fd98aae75095336 (patch)
treeb616a397d96e05b9e30ccc7de2e4e6a4334a6a59 /fpdfsdk/javascript/PublicMethods.cpp
parent777b333109db7fceb5f2ca1fc521ced7f863fa18 (diff)
downloadpdfium-64376be4aac4710848b36b823fd98aae75095336.tar.xz
Move the fpdfsdk/include/javascript folder
This CL splits the IJavaScript.h file into the two inner classes and puts them in the fpdfsdk/javascript folder. Review URL: https://codereview.chromium.org/1847583004
Diffstat (limited to 'fpdfsdk/javascript/PublicMethods.cpp')
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index 62659e4163..b928aab31d 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -11,15 +11,14 @@
#include <vector>
#include "core/fxcrt/include/fx_ext.h"
-#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment.
-#include "fpdfsdk/include/javascript/IJavaScript.h"
+#include "fpdfsdk/include/fsdk_mgr.h"
#include "fpdfsdk/javascript/Field.h"
-#include "fpdfsdk/javascript/JS_Context.h"
#include "fpdfsdk/javascript/JS_Define.h"
#include "fpdfsdk/javascript/JS_EventHandler.h"
#include "fpdfsdk/javascript/JS_Object.h"
-#include "fpdfsdk/javascript/JS_Runtime.h"
#include "fpdfsdk/javascript/JS_Value.h"
+#include "fpdfsdk/javascript/cjs_context.h"
+#include "fpdfsdk/javascript/cjs_runtime.h"
#include "fpdfsdk/javascript/color.h"
#include "fpdfsdk/javascript/resource.h"
#include "fpdfsdk/javascript/util.h"
@@ -739,8 +738,6 @@ CFX_WideString CJS_PublicMethods::MakeFormatDate(double dDate,
return sRet;
}
-/* -------------------------------------------------------------------------- */
-
// function AFNumber_Format(nDec, sepStyle, negStyle, currStyle, strCurrency,
// bCurrencyPrepend)
FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc,
@@ -780,7 +777,6 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc,
if (iNegStyle < 0 || iNegStyle > 3)
iNegStyle = 0;
- //////////////////////////////////////////////////////
// for processing decimal places
strValue.Replace(",", ".");
double dValue = atof(strValue);
@@ -813,7 +809,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc,
}
iMax = iDec2 + 1;
}
- ///////////////////////////////////////////////////////
+
// for processing seperator style
if (iDec2 < iMax) {
if (iSepStyle == 0 || iSepStyle == 1) {
@@ -840,9 +836,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc,
}
}
- //////////////////////////////////////////////////////////////////////
// for processing currency string
-
Value = CFX_WideString::FromLocal(strValue);
std::wstring strValue2 = Value.c_str();
@@ -851,7 +845,6 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IJS_Context* cc,
else
strValue2 = strValue2 + wstrCurrency;
- /////////////////////////////////////////////////////////////////////////
// for processing negative style
if (iNegative) {
if (iNegStyle == 0) {
@@ -1069,7 +1062,6 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(
if (iSepStyle < 0 || iSepStyle > 3)
iSepStyle = 0;
- //////////////////////////////////////////////////////
// for processing decimal places
double dValue = atof(strValue);
dValue *= 100;
@@ -1097,7 +1089,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(
}
iMax = iDec2 + 1;
}
- ///////////////////////////////////////////////////////
+
// for processing seperator style
if (iDec2 < iMax) {
if (iSepStyle == 0 || iSepStyle == 1) {
@@ -1123,7 +1115,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(
iMax++;
}
}
- ////////////////////////////////////////////////////////////////////
+
// negative mark
if (iNegative)
strValue = "-" + strValue;