summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Consts.cpp4
-rw-r--r--fpdfsdk/src/javascript/Document.cpp2
-rw-r--r--fpdfsdk/src/javascript/Field.cpp190
-rw-r--r--fpdfsdk/src/javascript/Icon.cpp4
-rw-r--r--fpdfsdk/src/javascript/JS_Context.cpp16
-rw-r--r--fpdfsdk/src/javascript/JS_EventHandler.cpp92
-rw-r--r--fpdfsdk/src/javascript/JS_GlobalData.cpp14
-rw-r--r--fpdfsdk/src/javascript/JS_Object.cpp6
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp24
-rw-r--r--fpdfsdk/src/javascript/JS_Value.cpp34
-rw-r--r--fpdfsdk/src/javascript/PublicMethods.cpp148
-rw-r--r--fpdfsdk/src/javascript/color.cpp6
-rw-r--r--fpdfsdk/src/javascript/console.cpp2
-rw-r--r--fpdfsdk/src/javascript/event.cpp14
-rw-r--r--fpdfsdk/src/javascript/global.cpp20
-rw-r--r--fpdfsdk/src/javascript/util.cpp16
16 files changed, 296 insertions, 296 deletions
diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp
index cea9f9a4c9..9edb6f443b 100644
--- a/fpdfsdk/src/javascript/Consts.cpp
+++ b/fpdfsdk/src/javascript/Consts.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -168,7 +168,7 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime)
{
const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_COMMA_SEP";
const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*,?\\d*"};
-
+
DEFINE_GLOBAL_ARRAY(pRuntime);
}
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index 9ea8029f60..d52ef0581e 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -1963,7 +1963,7 @@ void Document::DoAnnotDelay()
}
}
-CJS_Document* Document::GetCJSDoc() const
+CJS_Document* Document::GetCJSDoc() const
{
return static_cast<CJS_Document*>(m_pJSObject);
}
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 0d5a73d6e1..c98e469408 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -165,7 +165,7 @@ void Field::ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring &
}
}
- strFieldName = strFieldNameParsed.substr(0,iStart);
+ strFieldName = strFieldNameParsed.substr(0,iStart);
}
FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName)
@@ -176,8 +176,8 @@ FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldNam
m_pDocument = pDocument->GetReaderDoc();
ASSERT(m_pDocument != NULL);
- m_bCanSet = m_pDocument->GetPermissions(FPDFPERM_FILL_FORM) ||
- m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
+ m_bCanSet = m_pDocument->GetPermissions(FPDFPERM_FILL_FORM) ||
+ m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) ||
m_pDocument->GetPermissions(FPDFPERM_MODIFY);
CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm();
@@ -195,7 +195,7 @@ FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldNam
int iControlNo = -1;
ParseFieldName(swFieldNameTemp.c_str(), strFieldName, iControlNo);
if (iControlNo == -1) return FALSE;
-
+
m_FieldName = strFieldName.c_str();
m_nFormControlIndex = iControlNo;
return TRUE;
@@ -233,7 +233,7 @@ void Field::GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& Field
Field::GetFormFields(m_pDocument, csFieldName, FieldArray);
}
-void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
+void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField,
FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
{
ASSERT(pDocument != NULL);
@@ -281,20 +281,20 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
{
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i);
ASSERT(pWidget != NULL);
-
+
CPDFSDK_InterForm * pInterForm = pWidget->GetInterForm();
CPDFSDK_Document* pDoc = pInterForm->GetDocument();
// CReader_Page* pPage = pWidget->GetPage();
ASSERT(pDoc != NULL);
pDoc->UpdateAllViews(NULL, pWidget);
}
- }
-
+ }
+
if (bChangeMark)
pDocument->SetChangeMark();
}
-void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
+void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl,
FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh)
{
ASSERT(pDocument != NULL);
@@ -304,7 +304,7 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFo
ASSERT(pInterForm != NULL);
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl);
-
+
if (pWidget)
{
if (bResetAP)
@@ -430,14 +430,14 @@ FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
return TRUE;
}
-void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
const CFX_ByteString& string)
{
//Not supported.
}
FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
+{
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
@@ -496,7 +496,7 @@ FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
return TRUE;
}
-void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
const CFX_ByteString& string)
{
ASSERT(pDocument != NULL);
@@ -578,7 +578,7 @@ FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
}
}
else
- {
+ {
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
if (FieldArray.GetSize() <= 0) return FALSE;
@@ -695,7 +695,7 @@ FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
if (!pFormControl)return FALSE;
CPDF_IconFit IconFit = pFormControl->GetIconFit();
- vp << IconFit.GetFittingBounds();
+ vp << IconFit.GetFittingBounds();
}
return TRUE;
@@ -868,7 +868,7 @@ FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
- {
+ {
if (!m_bCanSet) return FALSE;
int nVP;
@@ -975,7 +975,7 @@ FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
}
}
else
- {
+ {
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
if (FieldArray.GetSize() <= 0) return FALSE;
@@ -1075,7 +1075,7 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
array.Add(iSelecting);
}
}
-
+
if (m_bDelay)
{
AddDelay_WordArray(FP_CURRENTVALUEINDICES, array);
@@ -1115,7 +1115,7 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid
return TRUE;
}
-void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
const CFX_DWordArray& array)
{
ASSERT(pDocument != NULL);
@@ -1160,7 +1160,7 @@ FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
{
if (!m_bCanSet) return FALSE;
- ;
+ ;
}
else
{
@@ -1183,7 +1183,7 @@ FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
if (!m_bCanSet) return FALSE;
CFX_WideString WideStr;
- vp >> WideStr;
+ vp >> WideStr;
if (m_bDelay)
{
@@ -1203,7 +1203,7 @@ FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
- if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON ||
+ if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON ||
pFormField->GetFieldType() == FIELDTYPE_SIGNATURE)
return FALSE;
@@ -1284,7 +1284,7 @@ FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
- if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD &&
+ if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD &&
pFormField->GetFieldType() != FIELDTYPE_COMBOBOX)
return FALSE;
@@ -1313,7 +1313,7 @@ FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
if (vp.IsSetting())
{
if (!m_bCanSet) return FALSE;
-
+
bool bVP;
vp >> bVP;
@@ -1335,7 +1335,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
if (!m_bCanSet) return FALSE;
int nVP;
- vp >> nVP;
+ vp >> nVP;
if (m_bDelay)
{
@@ -1363,11 +1363,11 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
FX_DWORD dwFlag = pWidget->GetFlags();
- if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag)
+ if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag)
{
vp << (int32_t)1;
}
- else
+ else
{
if (ANNOTFLAG_PRINT & dwFlag)
{
@@ -1383,7 +1383,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
else
{
vp << (int32_t)2;
- }
+ }
}
}
@@ -1422,7 +1422,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
dwFlag &= (~ANNOTFLAG_INVISIBLE);
dwFlag &= (~ANNOTFLAG_HIDDEN);
dwFlag &= (~ANNOTFLAG_NOVIEW);
- dwFlag |= ANNOTFLAG_PRINT;
+ dwFlag |= ANNOTFLAG_PRINT;
break;
case 1:
dwFlag &= (~ANNOTFLAG_INVISIBLE);
@@ -1440,7 +1440,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
dwFlag |= ANNOTFLAG_PRINT;
dwFlag &= (~ANNOTFLAG_HIDDEN);
break;
- }
+ }
if (dwFlag != pWidget->GetFlags())
{
@@ -1448,8 +1448,8 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
bSet = TRUE;
}
}
- }
-
+ }
+
if (bSet) UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
else
@@ -1467,7 +1467,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
dwFlag &= (~ANNOTFLAG_INVISIBLE);
dwFlag &= (~ANNOTFLAG_HIDDEN);
dwFlag &= (~ANNOTFLAG_NOVIEW);
- dwFlag |= ANNOTFLAG_PRINT;
+ dwFlag |= ANNOTFLAG_PRINT;
break;
case 1:
dwFlag &= (~ANNOTFLAG_INVISIBLE);
@@ -1485,7 +1485,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel
dwFlag |= ANNOTFLAG_PRINT;
dwFlag &= (~ANNOTFLAG_HIDDEN);
break;
- }
+ }
if (dwFlag != pWidget->GetFlags())
{
pWidget->SetFlags(dwFlag);
@@ -1548,12 +1548,12 @@ FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
- if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX &&
+ if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX &&
pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON)
return FALSE;
if (vp.IsSetting())
- {
+ {
if (!m_bCanSet) return FALSE;
if (!vp.IsArrayObject())return FALSE;
}
@@ -1734,11 +1734,11 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
FX_DWORD dwFlags = pWidget->GetFlags();
- if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags)
+ if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags)
{
vp << true;
}
- else
+ else
vp << false;
}
@@ -1766,9 +1766,9 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++)
{
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j)))
- {
+ {
FX_DWORD dwFlags = pWidget->GetFlags();
-
+
if (b)
{
dwFlags &= (~ANNOTFLAG_INVISIBLE);
@@ -1780,19 +1780,19 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
dwFlags &= (~ANNOTFLAG_INVISIBLE);
dwFlags &= (~ANNOTFLAG_HIDDEN);
dwFlags &= (~ANNOTFLAG_NOVIEW);
- dwFlags |= ANNOTFLAG_PRINT;
+ dwFlags |= ANNOTFLAG_PRINT;
}
if (dwFlags != pWidget->GetFlags())
{
- pWidget->SetFlags(dwFlags);
+ pWidget->SetFlags(dwFlags);
bSet = TRUE;
}
}
}
if (bSet)
- UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
+ UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
else
{
@@ -1802,7 +1802,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
{
FX_DWORD dwFlags = pWidget->GetFlags();
-
+
if (b)
{
dwFlags &= (~ANNOTFLAG_INVISIBLE);
@@ -1814,13 +1814,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField
dwFlags &= (~ANNOTFLAG_INVISIBLE);
dwFlags &= (~ANNOTFLAG_HIDDEN);
dwFlags &= (~ANNOTFLAG_NOVIEW);
- dwFlags |= ANNOTFLAG_PRINT;
+ dwFlags |= ANNOTFLAG_PRINT;
}
if (dwFlags != pWidget->GetFlags())
{
- pWidget->SetFlags(dwFlags);
- UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
+ pWidget->SetFlags(dwFlags);
+ UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE);
}
}
}
@@ -1960,7 +1960,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi
{
CPDF_FormControl* pFormControl = pFormField->GetControl(j);
ASSERT(pFormControl != NULL);
-
+
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
{
if (number != pWidget->GetBorderWidth())
@@ -2096,7 +2096,7 @@ FX_BOOL Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
}
FX_BOOL Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
+{
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName, FieldArray);
if (FieldArray.GetSize() <= 0) return FALSE;
@@ -2178,7 +2178,7 @@ FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
Field::SetPassword(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
+ }
}
else
{
@@ -2280,7 +2280,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
{
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
-
+
CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField));
if (!pWidget) return FALSE;
@@ -2388,7 +2388,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
else
{
Field::SetRect(m_pDocument, m_FieldName, m_nFormControlIndex, crRect);
- }
+ }
}
else
{
@@ -2418,7 +2418,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError
rcArray.SetElement(2,Lower_Rightx);
rcArray.SetElement(3,Lower_Righty);
- vp << rcArray;
+ vp << rcArray;
}
return TRUE;
@@ -2484,7 +2484,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl))
{
CPDF_Rect crRect = rect;
-
+
CPDF_Page* pPDFPage = pWidget->GetPDFPage();
ASSERT(pPDFPage != NULL);
@@ -2563,7 +2563,7 @@ FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
Field::SetRichText(m_pDocument, m_FieldName, m_nFormControlIndex, bVP);
- }
+ }
}
else
{
@@ -2629,7 +2629,7 @@ FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
Field::SetRotation(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
+ }
}
else
{
@@ -2677,7 +2677,7 @@ FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString&
else
{
Field::SetStrokeColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
- }
+ }
}
else
{
@@ -2751,7 +2751,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
{
Field::SetStyle(m_pDocument, m_FieldName, m_nFormControlIndex, csBCaption);
- }
+ }
}
else
{
@@ -2762,7 +2762,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
- if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON &&
+ if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON &&
pFormField->GetFieldType() != FIELDTYPE_CHECKBOX)
return FALSE;
@@ -2799,7 +2799,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
return TRUE;
}
-void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
+void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex,
const CFX_ByteString& string)
{
//Not supported.
@@ -2832,7 +2832,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
else
{
Field::SetTextColor(m_pDocument, m_FieldName, m_nFormControlIndex, color);
- }
+ }
}
else
{
@@ -2845,7 +2845,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
if (!pFormControl)return FALSE;
-
+
int iColorType;
FX_ARGB color;
CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
@@ -2862,7 +2862,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
CJS_Array crArray(m_isolate);
color::ConvertPWLColorToArray(crRet, crArray);
- vp << crArray;
+ vp << crArray;
}
return TRUE;
@@ -2892,7 +2892,7 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
Field::SetTextFont(m_pDocument, m_FieldName, m_nFormControlIndex, csFontName);
- }
+ }
}
else
{
@@ -2908,8 +2908,8 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
int nFieldType = pFormField->GetFieldType();
- if (nFieldType == FIELDTYPE_PUSHBUTTON ||
- nFieldType == FIELDTYPE_COMBOBOX ||
+ if (nFieldType == FIELDTYPE_PUSHBUTTON ||
+ nFieldType == FIELDTYPE_COMBOBOX ||
nFieldType == FIELDTYPE_LISTBOX ||
nFieldType == FIELDTYPE_TEXTFIELD)
{
@@ -2948,7 +2948,7 @@ FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
Field::SetTextSize(m_pDocument, m_FieldName, m_nFormControlIndex, nVP);
- }
+ }
}
else
{
@@ -3044,7 +3044,7 @@ FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
else
{
Field::SetUserName(m_pDocument, m_FieldName, m_nFormControlIndex, swName);
- }
+ }
}
else
{
@@ -3071,7 +3071,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
ASSERT(m_pDocument != NULL);
if (vp.IsSetting())
- {
+ {
if (!m_bCanSet) return FALSE;
CJS_WideStringArray strArray;
@@ -3157,7 +3157,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
else
{
CFX_WideString swValue = pFormField->GetValue();
-
+
double dRet;
FX_BOOL bDot;
if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
@@ -3168,7 +3168,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
vp << dRet;
}
else
- vp << swValue;
+ vp << swValue;
}
}
break;
@@ -3200,7 +3200,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
continue;
}
if (!bFind)
- vp << L"Off";
+ vp << L"Off";
}
break;
default:
@@ -3212,7 +3212,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
return TRUE;
}
-void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName,
+void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName,
int nControlIndex, const CJS_WideStringArray& strArray)
{
ASSERT(pDocument != NULL);
@@ -3237,7 +3237,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
if (pFormField->GetValue() != strArray.GetAt(0))
{
CFX_WideString WideString = strArray.GetAt(0);
- pFormField->SetValue(strArray.GetAt(0), TRUE);
+ pFormField->SetValue(strArray.GetAt(0), TRUE);
UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
break;
@@ -3246,7 +3246,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
{
if (pFormField->GetValue() != strArray.GetAt(0))
{
- pFormField->SetValue(strArray.GetAt(0), TRUE);
+ pFormField->SetValue(strArray.GetAt(0), TRUE);
UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE);
}
}
@@ -3279,7 +3279,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN
}
}
break;
- default:
+ default:
break;
}
}
@@ -3349,9 +3349,9 @@ FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& pa
CPDFDoc_Environment* pApp = m_pDocument->GetEnv();
ASSERT(pApp != NULL);
- if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) &&
+ if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) &&
(pFormField->GetFieldType() == FIELDTYPE_TEXTFIELD))
- {
+ {
CFX_WideString wsFileName = pApp->JS_fieldBrowse();
if(!wsFileName.IsEmpty())
{
@@ -3359,7 +3359,7 @@ FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& pa
UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE);
}
}
- else
+ else
return FALSE;
return TRUE;
@@ -3381,13 +3381,13 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params,
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
-
+
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
return FALSE;
CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField);
if (!pFormControl)return FALSE;
-
+
if (nface == 0)
vRet = pFormControl->GetNormalCaption().c_str();
else if (nface == 1)
@@ -3410,14 +3410,14 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
int iSize = params.size();
if (iSize >= 1)
nface = params[0].ToInt();
-
+
CFX_PtrArray FieldArray;
GetFormFields(m_FieldName,FieldArray);
if (FieldArray.GetSize() <= 0) return FALSE;
CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0);
ASSERT(pFormField != NULL);
-
+
if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON)
return FALSE;
@@ -3429,10 +3429,10 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
CJS_Runtime* pRuntime = pContext->GetJSRuntime();
ASSERT(pRuntime != NULL);
-
+
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon"));
ASSERT(pObj.IsEmpty() == FALSE);
-
+
CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj);
ASSERT(pJS_Icon != NULL);
@@ -3459,7 +3459,7 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ
FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
-#if 0
+#if 0
ASSERT(m_pDocument != NULL);
CFX_PtrArray FieldArray;
@@ -3473,7 +3473,7 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params,
ASSERT(pEnv);
CFX_WideString sIconFileName = pEnv->JS_fieldBrowse();
- if (sIconFileName.IsEmpty())
+ if (sIconFileName.IsEmpty())
{
vRet = 1;
return TRUE;
@@ -3483,7 +3483,7 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params,
ASSERT(pInterForm != NULL);
CPDF_Stream* pStream = pInterForm->LoadImageFromFile(sIconFileName);
- if (!pStream)
+ if (!pStream)
{
vRet = -1;
return TRUE;
@@ -3617,7 +3617,7 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
ASSERT(pFormField != NULL);
swSort.Add(new CFX_WideString(pFormField->GetFullName()));
-
+
}
swSort.Sort(JS_COMPARESTRING);
@@ -3637,11 +3637,11 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj);
ASSERT(pJSField != NULL);
- Field* pField = (Field*)pJSField->GetEmbedObject();
+ Field* pField = (Field*)pJSField->GetEmbedObject();
ASSERT(pField != NULL);
pField->AttachField(m_pJSDoc, *pStr);
-
+
CJS_Value FormFieldValue(m_isolate);
FormFieldValue = pJSField;
FormFieldArray.SetElement(j, FormFieldValue);
@@ -3653,7 +3653,7 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
swSort.RemoveAll();
return TRUE;
}
-
+
FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
ASSERT(m_pDocument != NULL);
@@ -3800,7 +3800,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
CPDFSDK_Widget* pWidget = NULL;
if (nCount == 1)
- {
+ {
pWidget = pInterForm->GetWidget(pFormField->GetControl(0));
}
else
@@ -3815,7 +3815,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val
for (int32_t i=0; i<nCount; i++)
{
if (CPDFSDK_Widget* pTempWidget = pInterForm->GetWidget(pFormField->GetControl(i)))
- {
+ {
if (pTempWidget->GetPDFPage() == pCurPageView->GetPDFPage())
{
pWidget = pTempWidget;
diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp
index 8c05116643..6b3e02e1ec 100644
--- a/fpdfsdk/src/javascript/Icon.cpp
+++ b/fpdfsdk/src/javascript/Icon.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -20,7 +20,7 @@ BEGIN_JS_STATIC_PROP(CJS_Icon)
JS_STATIC_PROP_ENTRY(name)
END_JS_STATIC_PROP()
-BEGIN_JS_STATIC_METHOD(CJS_Icon)
+BEGIN_JS_STATIC_METHOD(CJS_Icon)
END_JS_STATIC_METHOD()
IMPLEMENT_JS_CLASS(CJS_Icon,Icon)
diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp
index 11bb092734..f41cf9ec13 100644
--- a/fpdfsdk/src/javascript/JS_Context.cpp
+++ b/fpdfsdk/src/javascript/JS_Context.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -14,7 +14,7 @@
/* -------------------------- CJS_Context -------------------------- */
-CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
+CJS_Context::CJS_Context(CJS_Runtime* pRuntime) :
m_pRuntime(pRuntime),
m_bBusy(FALSE),
m_bMsgBoxEnable(TRUE)
@@ -41,17 +41,17 @@ CPDFSDK_Document* CJS_Context::GetReaderDocument()
CPDFDoc_Environment* CJS_Context::GetReaderApp()
{
ASSERT(m_pRuntime != NULL);
-
+
return m_pRuntime->GetReaderApp();
}
FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
{
if (m_bBusy)
- {
+ {
info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
return FALSE;
- }
+ }
m_bBusy = TRUE;
@@ -66,7 +66,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri
}
FXJSErr error ={NULL,NULL, 0};
- int nRet = 0;
+ int nRet = 0;
if (script.GetLength() > 0)
{
@@ -99,7 +99,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri
m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());
m_pEventHandler->Destroy();
- m_bBusy = FALSE;
+ m_bBusy = FALSE;
return nRet >= 0;
}
@@ -343,7 +343,7 @@ void CJS_Context::OnExternal_Exec()
void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget)
{
- ASSERT(m_pEventHandler != NULL);
+ ASSERT(m_pEventHandler != NULL);
m_pEventHandler->OnBatchExec(pTarget);
}
diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp
index 1fab82f74e..7d27c66f6b 100644
--- a/fpdfsdk/src/javascript/JS_EventHandler.cpp
+++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -57,41 +57,41 @@ void CJS_EventHandler::OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString&
Initial(JET_DOC_OPEN);
m_pTargetDoc = pDoc;
- m_strTargetName = strTargetName;
+ m_strTargetName = strTargetName;
}
void CJS_EventHandler::OnDoc_WillPrint(CPDFSDK_Document* pDoc)
{
Initial(JET_DOC_WILLPRINT);
- m_pTargetDoc = pDoc;
+ m_pTargetDoc = pDoc;
}
void CJS_EventHandler::OnDoc_DidPrint(CPDFSDK_Document* pDoc)
{
Initial(JET_DOC_DIDPRINT);
-
- m_pTargetDoc = pDoc;
+
+ m_pTargetDoc = pDoc;
}
void CJS_EventHandler::OnDoc_WillSave(CPDFSDK_Document* pDoc)
{
Initial(JET_DOC_WILLSAVE);
- m_pTargetDoc = pDoc;
+ m_pTargetDoc = pDoc;
}
void CJS_EventHandler::OnDoc_DidSave(CPDFSDK_Document* pDoc)
{
- Initial(JET_DOC_DIDSAVE);
-
- m_pTargetDoc = pDoc;
+ Initial(JET_DOC_DIDSAVE);
+
+ m_pTargetDoc = pDoc;
}
void CJS_EventHandler::OnDoc_WillClose(CPDFSDK_Document* pDoc)
{
Initial(JET_DOC_WILLCLOSE);
- m_pTargetDoc = pDoc;
+ m_pTargetDoc = pDoc;
}
void CJS_EventHandler::OnPage_Open(CPDFSDK_Document* pDoc)
@@ -104,21 +104,21 @@ void CJS_EventHandler::OnPage_Open(CPDFSDK_Document* pDoc)
void CJS_EventHandler::OnPage_Close(CPDFSDK_Document* pDoc)
{
Initial(JET_PAGE_CLOSE);
-
+
m_pTargetDoc = pDoc;
}
void CJS_EventHandler::OnPage_InView(CPDFSDK_Document* pDoc)
{
Initial(JET_PAGE_INVIEW);
-
+
m_pTargetDoc = pDoc;
}
void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc)
{
Initial(JET_PAGE_OUTVIEW);
-
+
m_pTargetDoc = pDoc;
}
@@ -140,16 +140,16 @@ void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF
m_bModifier = bModifier;
m_bShift = bShift;
ASSERT(pTarget != NULL);
- m_strTargetName = pTarget->GetFullName();
+ m_strTargetName = pTarget->GetFullName();
}
void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget)
{
Initial(JET_FIELD_MOUSEDOWN);
m_eEventType = JET_FIELD_MOUSEDOWN;
-
+
m_bModifier = bModifier;
- m_bShift = bShift;
+ m_bShift = bShift;
ASSERT(pTarget != NULL);
m_strTargetName = pTarget->GetFullName();
}
@@ -164,13 +164,13 @@ void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_F
m_strTargetName = pTarget->GetFullName();
}
-void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget,
const CFX_WideString& Value)
{
Initial(JET_FIELD_FOCUS);
m_bModifier = bModifier;
- m_bShift = bShift;
+ m_bShift = bShift;
ASSERT(pTarget != NULL);
m_strTargetName = pTarget->GetFullName();
m_pValue = (CFX_WideString*)&Value;
@@ -185,7 +185,7 @@ void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_Form
m_bShift = bShift;
ASSERT(pTarget != NULL);
m_strTargetName = pTarget->GetFullName();
- m_pValue = (CFX_WideString*)&Value;
+ m_pValue = (CFX_WideString*)&Value;
}
void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
@@ -196,7 +196,7 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
FX_BOOL bFieldFull, FX_BOOL& bRc)
{
Initial(JET_FIELD_KEYSTROKE);
-
+
m_nCommitKey = 0;
m_pWideStrChange = &strChange;
m_WideStrChangeEx = strChangeEx;
@@ -204,11 +204,11 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange,
m_bModifier = bModifier;
m_pISelEnd = &nSelEnd;
m_pISelStart = &nSelStart;
- m_bShift = bShift;
+ m_bShift = bShift;
ASSERT(pTarget != NULL);
m_strTargetName = pTarget->GetFullName();
m_pValue = &Value;
- m_bWillCommit = bWillCommit;
+ m_bWillCommit = bWillCommit;
m_pbRc = &bRc;
m_bFieldFull = bFieldFull;
}
@@ -218,19 +218,19 @@ void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_Wid
CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc)
{
Initial(JET_FIELD_VALIDATE);
-
+
m_pWideStrChange = &strChange;
- m_WideStrChangeEx = strChangeEx;
+ m_WideStrChangeEx = strChangeEx;
m_bKeyDown = bKeyDown;
m_bModifier = bModifier;
m_bShift = bShift;
ASSERT(pTarget != NULL);
m_strTargetName = pTarget->GetFullName();
- m_pValue = &Value;
- m_pbRc = &bRc;
+ m_pValue = &Value;
+ m_pbRc = &bRc;
}
-void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget,
+void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget,
CFX_WideString& Value, FX_BOOL& bRc)
{
Initial(JET_FIELD_CALCULATE);
@@ -248,7 +248,7 @@ void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget,
FX_BOOL bWillCommit)
{
Initial(JET_FIELD_FORMAT);
-
+
m_nCommitKey = 0;
ASSERT(pTarget != NULL);
m_strTargetName = pTarget->GetFullName();
@@ -349,15 +349,15 @@ void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFS
void CJS_EventHandler::OnLink_MouseUp(CPDFSDK_Document* pTarget)
{
Initial(JET_LINK_MOUSEUP);
-
- m_pTargetDoc = pTarget;
+
+ m_pTargetDoc = pTarget;
}
void CJS_EventHandler::OnBookmark_MouseUp(CPDF_Bookmark* pBookMark)
{
Initial(JET_BOOKMARK_MOUSEUP);
- m_pTargetBookMark = pBookMark;
+ m_pTargetBookMark = pBookMark;
}
void CJS_EventHandler::OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName)
@@ -377,7 +377,7 @@ void CJS_EventHandler::OnBatchExec(CPDFSDK_Document* pTarget)
{
Initial(JET_BATCH_EXEC);
- m_pTargetDoc = pTarget;
+ m_pTargetDoc = pTarget;
}
void CJS_EventHandler::OnConsole_Exec()
@@ -477,13 +477,13 @@ const FX_WCHAR* CJS_EventHandler::Name()
case JET_DOC_WILLPRINT: return L"WillPrint";
case JET_DOC_WILLSAVE: return L"WillSave";
case JET_EXTERNAL_EXEC: return L"Exec";
- case JET_FIELD_FOCUS:
+ case JET_FIELD_FOCUS:
case JET_SCREEN_FOCUS: return L"Focus";
- case JET_FIELD_BLUR:
+ case JET_FIELD_BLUR:
case JET_SCREEN_BLUR: return L"Blur";
case JET_FIELD_MOUSEDOWN:
case JET_SCREEN_MOUSEDOWN: return L"Mouse Down";
- case JET_FIELD_MOUSEUP:
+ case JET_FIELD_MOUSEUP:
case JET_SCREEN_MOUSEUP: return L"Mouse Up";
case JET_FIELD_MOUSEENTER:
case JET_SCREEN_MOUSEENTER: return L"Mouse Enter";
@@ -495,11 +495,11 @@ const FX_WCHAR* CJS_EventHandler::Name()
case JET_FIELD_VALIDATE: return L"Validate";
case JET_LINK_MOUSEUP: return L"Mouse Up";
case JET_MENU_EXEC: return L"Exec";
- case JET_PAGE_OPEN:
+ case JET_PAGE_OPEN:
case JET_SCREEN_OPEN: return L"Open";
case JET_PAGE_CLOSE:
case JET_SCREEN_CLOSE: return L"Close";
- case JET_SCREEN_INVIEW:
+ case JET_SCREEN_INVIEW:
case JET_PAGE_INVIEW: return L"InView";
case JET_PAGE_OUTVIEW:
case JET_SCREEN_OUTVIEW: return L"OutView";
@@ -516,7 +516,7 @@ const FX_WCHAR* CJS_EventHandler::Type()
{
case JET_APP_INIT: return L"App";
case JET_BATCH_EXEC: return L"Batch";
- case JET_BOOKMARK_MOUSEUP: return L"BookMark";
+ case JET_BOOKMARK_MOUSEUP: return L"BookMark";
case JET_CONSOLE_EXEC: return L"Console";
case JET_DOC_DIDPRINT:
case JET_DOC_DIDSAVE:
@@ -545,7 +545,7 @@ const FX_WCHAR* CJS_EventHandler::Type()
case JET_SCREEN_MOUSEEXIT:
case JET_SCREEN_INVIEW:
case JET_SCREEN_OUTVIEW: return L"Screen";
- case JET_LINK_MOUSEUP: return L"Link";
+ case JET_LINK_MOUSEUP: return L"Link";
case JET_MENU_EXEC: return L"Menu";
case JET_PAGE_OPEN:
case JET_PAGE_CLOSE:
@@ -563,7 +563,7 @@ FX_BOOL& CJS_EventHandler::Rc()
if (m_pbRc != NULL)
return *m_pbRc;
else
- {
+ {
return m_bRcDu;
}
}
@@ -614,7 +614,7 @@ Field* CJS_EventHandler::Source()
pDocument->AttachDoc(m_pTargetDoc);
else
pDocument->AttachDoc(m_pJSContext->GetReaderDocument());
-
+
//if (m_pSourceField == NULL)
// return NULL;
//CRAO_Widget *pWidget = IBCL_Widget::GetWidget(m_pSourceField);
@@ -623,10 +623,10 @@ Field* CJS_EventHandler::Source()
//CFX_WideString csFieldName = pFormField->GetFullName();
CJS_Field * pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
ASSERT(pJSField != NULL);
- Field * pField = (Field *)pJSField->GetEmbedObject();
+ Field * pField = (Field *)pJSField->GetEmbedObject();
ASSERT(pField != NULL);
pField->AttachField(pDocument, m_strSourceName);
- return pField;
+ return pField;
}
Field* CJS_EventHandler::Target_Field()
@@ -648,15 +648,15 @@ Field* CJS_EventHandler::Target_Field()
pDocument->AttachDoc(m_pTargetDoc);
else
pDocument->AttachDoc(m_pJSContext->GetReaderDocument());
-
+
CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj);
ASSERT(pJSField != NULL);
- Field* pField = (Field *)pJSField->GetEmbedObject();
+ Field* pField = (Field *)pJSField->GetEmbedObject();
ASSERT(pField != NULL);
pField->AttachField(pDocument, m_strTargetName);
- return pField;
+ return pField;
}
CFX_WideString& CJS_EventHandler::Value()
diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp
index 0fa2189453..e17f305d36 100644
--- a/fpdfsdk/src/javascript/JS_GlobalData.cpp
+++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -121,7 +121,7 @@ CJS_GlobalData::CJS_GlobalData(CPDFDoc_Environment* pApp) : m_pApp(pApp)
{
// IBaseAnnot* pBaseAnnot = IBaseAnnot::GetBaseAnnot(m_pApp);
// ASSERT(pBaseAnnot != NULL);
-//
+//
// m_sFilePath = pBaseAnnot->GetUserPath();
m_sFilePath += SDK_JS_GLOBALDATA_FILENAME;
@@ -268,7 +268,7 @@ void CJS_GlobalData::SetGlobalVariableObject(const FX_CHAR* propname, const CJS_
pNewData->data.sKey = sPropName;
pNewData->data.nType = JS_GLOBALDATA_TYPE_OBJECT;
pNewData->data.objData.Copy(array);
-
+
m_arrayGlobalData.Add(pNewData);
}
}
@@ -277,12 +277,12 @@ void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname)
{
ASSERT(propname != NULL);
CFX_ByteString sPropName = propname;
-
+
sPropName.TrimLeft();
sPropName.TrimRight();
-
+
if (sPropName.GetLength() == 0) return;
-
+
if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName))
{
pData->data.nType = JS_GLOBALDATA_TYPE_NULL;
@@ -292,7 +292,7 @@ void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname)
CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element;
pNewData->data.sKey = sPropName;
pNewData->data.nType = JS_GLOBALDATA_TYPE_NULL;
-
+
m_arrayGlobalData.Add(pNewData);
}
}
diff --git a/fpdfsdk/src/javascript/JS_Object.cpp b/fpdfsdk/src/javascript/JS_Object.cpp
index 9f2d0f8258..bb7d6c4108 100644
--- a/fpdfsdk/src/javascript/JS_Object.cpp
+++ b/fpdfsdk/src/javascript/JS_Object.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -46,7 +46,7 @@ CPDFSDK_PageView* FXJS_GetPageView(IFXJS_Context* cc)
/* --------------------------------- CJS_EmbedObj --------------------------------- */
-CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) :
+CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) :
m_pJSObject(pJSObject)
{
}
@@ -76,7 +76,7 @@ CJS_Timer* CJS_EmbedObj::BeginTimer(CPDFDoc_Environment* pApp, FX_UINT nElapse)
{
CJS_Timer* pTimer = new CJS_Timer(this,pApp);
pTimer->SetJSTimer(nElapse);
-
+
return pTimer;
}
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index d8fea8d768..2ffc9ff988 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -48,7 +48,7 @@ void CJS_RuntimeFactory::AddRef()
m_nRef++;
}
void CJS_RuntimeFactory::Release()
-{
+{
if(m_bInit)
{
//to do.Should be implemented as atom manipulation.
@@ -85,7 +85,7 @@ CJS_GlobalData* CJS_RuntimeFactory::NewGlobalData(CPDFDoc_Environment* pApp)
void CJS_RuntimeFactory::ReleaseGlobalData()
{
m_nGlobalDataCount--;
-
+
if (m_nGlobalDataCount <= 0)
{
delete m_pGlobalData;
@@ -178,21 +178,21 @@ FX_BOOL CJS_Runtime::InitJSObjects()
if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE;
if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE;
if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE;
//9 - 11
if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE;
if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE;
//12 - 14
- if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE;
- if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE;
- if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE;
+ if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE;
//15 - 17
- if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE;
+ if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE;
if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE;
if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE;
@@ -373,7 +373,7 @@ FX_BOOL CJS_Runtime::GetHValueByName(const CFX_ByteStringC& utf8Name, FXJSE_HVAL
//v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsolate(), m_context);
v8::Local<v8::Value> propvalue = context->Global()->Get(v8::String::NewFromUtf8(GetIsolate(), name, v8::String::kNormalString, utf8Name.GetLength()));
-
+
if (propvalue.IsEmpty()) {
FXJSE_Value_SetUndefined(hValue);
return FALSE;
@@ -398,6 +398,6 @@ FX_BOOL CJS_Runtime::SetHValueByName(const CFX_ByteStringC& utf8Name, FXJSE_HVAL
//v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsolate(), m_context);
v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(GetIsolate(),((CFXJSE_Value*)hValue)->DirectGetValue());
context->Global()->Set(v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, utf8Name.GetLength()), propvalue);
-
+
return TRUE;
}
diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp
index 5bca831710..058f2eaf45 100644
--- a/fpdfsdk/src/javascript/JS_Value.cpp
+++ b/fpdfsdk/src/javascript/JS_Value.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -35,39 +35,39 @@ CJS_Value::CJS_Value(v8::Isolate* isolate, const float &fValue):m_isolate(isolat
operator =(fValue);
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isolate)
{
operator =(dValue);
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate)
{
operator =(pJsObj);
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object* pJsObj):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object* pJsObj):m_isolate(isolate)
{
operator =(pJsObj);
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isolate)
{
m_eType = VT_object;
if (pJsDoc)
m_pValue = (JSFXObject)*pJsDoc;
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_WCHAR* pWstr):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_WCHAR* pWstr):m_isolate(isolate)
{
operator =(pWstr);
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr):m_isolate(isolate)
{
operator = (pStr);
}
-CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Array& array):m_isolate(isolate)
+CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Array& array):m_isolate(isolate)
{
operator = (array);
}
@@ -215,7 +215,7 @@ void CJS_Value::SetNull()
}
void CJS_Value::operator = (const FX_CHAR* pStr)
-{
+{
operator = (CFX_WideString::FromLocal(pStr).c_str());
}
@@ -256,7 +256,7 @@ FXJSVALUETYPE CJS_Value::GetType() const
return VT_unknown;
}
-FX_BOOL CJS_Value::IsArrayObject() const
+FX_BOOL CJS_Value::IsArrayObject() const
{
if(m_pValue.IsEmpty()) return FALSE;
return m_pValue->IsArray();
@@ -294,12 +294,12 @@ FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const
return TRUE;
}
- return FALSE;
+ return FALSE;
}
/* ---------------------------- CJS_PropValue ---------------------------- */
-CJS_PropValue::CJS_PropValue(const CJS_Value &value) :
+CJS_PropValue::CJS_PropValue(const CJS_Value &value) :
CJS_Value(value),
m_bIsSetting(0)
{
@@ -472,7 +472,7 @@ CJS_Array::CJS_Array(v8::Isolate* isolate):m_isolate(isolate)
}
CJS_Array::~CJS_Array()
-{
+{
}
void CJS_Array::Attach(v8::Local<v8::Array> pArray)
@@ -522,16 +522,16 @@ CJS_Date::CJS_Date(v8::Isolate* isolate) :m_isolate(isolate)
{
}
-CJS_Date::CJS_Date(v8::Isolate* isolate,double dMsec_time)
+CJS_Date::CJS_Date(v8::Isolate* isolate,double dMsec_time)
{
m_isolate = isolate;
- m_pDate = JS_NewDate(isolate,dMsec_time);
+ m_pDate = JS_NewDate(isolate,dMsec_time);
}
-CJS_Date::CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec)
+CJS_Date::CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec)
{
m_isolate = isolate;
- m_pDate = JS_NewDate(isolate,MakeDate(year,mon,day,hour,min,sec,0));
+ m_pDate = JS_NewDate(isolate,MakeDate(year,mon,day,hour,min,sec,0));
}
double CJS_Date::MakeDate(int year, int mon, int day,int hour, int min, int sec,int ms)
diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp
index c3fb8c3b2e..3a0ac00097 100644
--- a/fpdfsdk/src/javascript/PublicMethods.cpp
+++ b/fpdfsdk/src/javascript/PublicMethods.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -174,13 +174,13 @@ FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask)
switch (c_Mask)
{
case L'9':
- return IsDigit(c_Change);
+ return IsDigit(c_Change);
case L'A':
- return IsAlphabetic(c_Change);
+ return IsAlphabetic(c_Change);
case L'O':
- return IsAlphaNumeric(c_Change);
+ return IsAlphaNumeric(c_Change);
case L'X':
- return TRUE;
+ return TRUE;
default:
return (c_Change == c_Mask);
}
@@ -300,7 +300,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
CFX_WideString swDigits;
while (p <= pEnd)
- {
+ {
c = *p;
if (IsDigit(c))
@@ -308,7 +308,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig
swDigits += c;
bDigitExist = TRUE;
}
- else
+ else
{
switch (c)
{
@@ -454,11 +454,11 @@ CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Valu
StrArray.SetElement(nIndex, CJS_Value(isolate, StrTrim(pSub).c_str()));
delete []pSub;
-
+
nIndex ++;
p = ++pTemp;
}
-
+
}
return StrArray;
}
@@ -477,7 +477,7 @@ int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string,int nStar
{
nRet = nRet * 10 + (c - '0');
nSkip = i - nStart + 1;
- if (nSkip >= nMaxStep)
+ if (nSkip >= nMaxStep)
break;
}
else
@@ -531,7 +531,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL&
if (IsDigit((wchar_t)c))
{
number[nIndex++] = ParseStringInteger(value, i, nSkip, 4);
- i += nSkip;
+ i += nSkip;
}
else
{
@@ -1066,34 +1066,34 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
}
if(!pEvent->m_pValue)
return FALSE;
- CFX_WideString& Value = pEvent->Value();
+ CFX_WideString& Value = pEvent->Value();
CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value));
-
+
if (strValue.IsEmpty()) return TRUE;
-
+
int iDec = params[0].ToInt();
int iSepStyle = params[1].ToInt();
int iNegStyle = params[2].ToInt();
// params[3] is iCurrStyle, it's not used.
std::wstring wstrCurrency(params[4].ToCFXWideString().c_str());
FX_BOOL bCurrencyPrepend = params[5].ToBool();
-
+
if (iDec < 0) iDec = -iDec;
-
+
if (iSepStyle < 0 || iSepStyle > 3)
iSepStyle = 0;
-
+
if (iNegStyle < 0 || iNegStyle > 3)
iNegStyle = 0;
-
-
+
+
//////////////////////////////////////////////////////
//for processing decimal places
strValue.Replace(",", ".");
double dValue = atof(strValue);
if (iDec > 0)
dValue += DOUBLE_CORRECT;//
-
+
int iDec2;
FX_BOOL bNagative = FALSE;
@@ -1117,7 +1117,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
strValue = "0" + strValue;
}
iDec2 = 0;
-
+
}
int iMax = strValue.GetLength();
if (iDec2 > iMax)
@@ -1126,7 +1126,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
{
strValue += "0";
}
- iMax = iDec2+1;
+ iMax = iDec2+1;
}
///////////////////////////////////////////////////////
//for processing seperator style
@@ -1142,7 +1142,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
strValue.Insert(iDec2, ',');
iMax++;
}
-
+
if (iDec2 == 0)
strValue.Insert(iDec2, '0');
}
@@ -1153,18 +1153,18 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
cSeperator = ',';
else
cSeperator = '.';
-
+
int iDecPositive,iDecNagative;
iDecPositive = iDec2;
- iDecNagative = iDec2;
-
+ iDecNagative = iDec2;
+
for (iDecPositive = iDec2 -3; iDecPositive > 0;iDecPositive -= 3)
{
strValue.Insert(iDecPositive, cSeperator);
iMax++;
}
}
-
+
//////////////////////////////////////////////////////////////////////
//for processing currency string
@@ -1175,9 +1175,9 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
strValue2 = wstrCurrency + strValue2;
else
strValue2 = strValue2 + wstrCurrency;
-
-
-
+
+
+
/////////////////////////////////////////////////////////////////////////
//for processing negative style
if (bNagative)
@@ -1203,9 +1203,9 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
arColor.SetElement(1,vColElm);
vColElm = 0;
arColor.SetElement(2,vColElm);
-
+
arColor.SetElement(3,vColElm);
-
+
CJS_PropValue vProp(isolate);
vProp.StartGetting();
vProp<<arColor;
@@ -1228,11 +1228,11 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete
arColor.SetElement(1,vColElm);
arColor.SetElement(2,vColElm);
arColor.SetElement(3,vColElm);
-
+
CJS_PropValue vProp(isolate);
vProp.StartGetting();
fTarget->textColor(cc,vProp,sError);
-
+
CJS_Array aProp(isolate);
vProp.ConvertToArray(aProp);
@@ -1264,16 +1264,16 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
ASSERT(pContext != NULL);
CJS_EventHandler* pEvent = pContext->GetEventHandler();
ASSERT(pEvent != NULL);
-
+
if(params.size() < 2)
return FALSE;
int iSepStyle = params[1].ToInt();
-
+
if (iSepStyle < 0 || iSepStyle > 3)
iSepStyle = 0;
if(!pEvent->m_pValue)
return FALSE;
- CFX_WideString & val = pEvent->Value();
+ CFX_WideString & val = pEvent->Value();
CFX_WideString & w_strChange = pEvent->Change();
CFX_WideString w_strValue = val;
@@ -1283,7 +1283,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
CFX_WideString wstrValue = StrLTrim(w_strValue.c_str());
if (wstrValue.IsEmpty())
return TRUE;
-
+
CFX_WideString swTemp = wstrValue;
swTemp.Replace(L",", L".");
if (!IsNumber(swTemp.c_str()))
@@ -1326,7 +1326,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
cSep = L',';
break;
}
-
+
FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1);
for (std::wstring::iterator it = w_strChange2.begin(); it != w_strChange2.end(); it++)
{
@@ -1367,16 +1367,16 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
bHasSign = TRUE;
continue;
}
-
+
if (!IsDigit(*it))
- {
+ {
FX_BOOL &bRc = pEvent->Rc();
bRc = FALSE;
return TRUE;
}
}
-
-
+
+
std::wstring w_prefix = w_strValue2.substr(0,pEvent->SelStart());
std::wstring w_postfix;
if (pEvent->SelEnd()<(int)w_strValue2.length())
@@ -1384,8 +1384,8 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param
w_strValue2 = w_prefix + w_strChange2 + w_postfix;
w_strValue = w_strValue2.c_str();
val = w_strValue;
- return TRUE;
-
+ return TRUE;
+
}
//function AFPercent_Format(nDec, sepStyle)
@@ -1441,7 +1441,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet
strValue = "0" + strValue;
}
iDec2 = 0;
-
+
}
int iMax = strValue.GetLength();
if (iDec2 > iMax)
@@ -1450,7 +1450,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet
{
strValue += "0";
}
- iMax = iDec2+1;
+ iMax = iDec2+1;
}
///////////////////////////////////////////////////////
//for processing seperator style
@@ -1466,7 +1466,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet
strValue.Insert(iDec2, ',');
iMax++;
}
-
+
if (iDec2 == 0)
strValue.Insert(iDec2, '0');
}
@@ -1477,11 +1477,11 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet
cSeperator = ',';
else
cSeperator = '.';
-
+
int iDecPositive,iDecNagative;
iDecPositive = iDec2;
iDecNagative = iDec2;
-
+
for (iDecPositive = iDec2 -3; iDecPositive > 0; iDecPositive -= 3)
{
strValue.Insert(iDecPositive,cSeperator);
@@ -1569,7 +1569,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
{
FX_WCHAR c = strValue.GetAt(i);
if(c == L' ' || c == L':')
- {
+ {
wsArray.Add(sTemp);
sTemp = L"";
continue;
@@ -1577,7 +1577,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
sTemp += c;
}
-
+
wsArray.Add(sTemp);
if(wsArray.GetSize() != 8)return 0;
@@ -1607,7 +1607,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue)
{
dRet = JS_DateParse(strValue.c_str());
}
-
+
return dRet;
}
@@ -1793,24 +1793,24 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet
if(!pEvent->m_pValue)
return FALSE;
- CFX_WideString& Value = pEvent->Value();
+ CFX_WideString& Value = pEvent->Value();
std::string strSrc = CFX_ByteString::FromUnicode(Value).c_str();
-
- switch (iIndex)
+
+ switch (iIndex)
{
- case 0:
+ case 0:
cFormat = "99999";
break;
- case 1:
+ case 1:
cFormat = "99999-9999";
break;
- case 2:
+ case 2:
{
std::string NumberStr;
- util::printx("9999999999", strSrc,NumberStr);
+ util::printx("9999999999", strSrc,NumberStr);
if (NumberStr.length() >= 10 )
cFormat = "(999) 999-9999";
- else
+ else
cFormat = "999-9999";
break;
}
@@ -1818,7 +1818,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet
cFormat = "999-99-9999";
break;
}
-
+
std::string strDes;
util::printx(cFormat,strSrc,strDes);
Value = CFX_WideString::FromLocal(strDes.c_str());
@@ -1946,23 +1946,23 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para
std::string strSrc = CFX_ByteString::FromUnicode(val).c_str();
std::wstring wstrChange = pEvent->Change().c_str();
- switch (iIndex)
+ switch (iIndex)
{
- case 0:
+ case 0:
cFormat = "99999";
break;
- case 1:
+ case 1:
//cFormat = "99999-9999";
cFormat = "999999999";
break;
- case 2:
+ case 2:
{
std::string NumberStr;
- util::printx("9999999999", strSrc,NumberStr);
+ util::printx("9999999999", strSrc,NumberStr);
if (strSrc.length() + wstrChange.length() > 7 )
//cFormat = "(999) 999-9999";
cFormat = "9999999999";
- else
+ else
//cFormat = "999-9999";
cFormat = "9999999";
break;
@@ -1972,11 +1972,11 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para
cFormat = "999999999";
break;
}
-
+
CJS_Parameters params2;
CJS_Value vMask(isolate, cFormat.c_str());
params2.push_back(vMask);
-
+
return AFSpecial_KeystrokeEx(cc,params2,vRet,sError);
}
@@ -2199,7 +2199,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param
return TRUE;
}
-/* This function validates the current event to ensure that its value is
+/* This function validates the current event to ensure that its value is
** within the specified range. */
FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
@@ -2209,7 +2209,7 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Paramet
CJS_EventHandler* pEvent = pContext->GetEventHandler();
ASSERT(pEvent != NULL);
- if (params.size() != 4)
+ if (params.size() != 4)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
return FALSE;
@@ -2260,7 +2260,7 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
- if (params.size() != 1)
+ if (params.size() != 1)
{
sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR);
return FALSE;
@@ -2295,7 +2295,7 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters
if (sPart.GetLength() > 0)
{
- nums.SetElement(nIndex,CJS_Value(isolate,sPart.c_str()));
+ nums.SetElement(nIndex,CJS_Value(isolate,sPart.c_str()));
}
if (nums.GetLength() > 0)
diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp
index 7f36be0920..a2bbadcd51 100644
--- a/fpdfsdk/src/javascript/color.cpp
+++ b/fpdfsdk/src/javascript/color.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -32,13 +32,13 @@ END_JS_STATIC_CONST()
BEGIN_JS_STATIC_PROP(CJS_Color)
JS_STATIC_PROP_ENTRY(black)
JS_STATIC_PROP_ENTRY(blue)
- JS_STATIC_PROP_ENTRY(cyan)
+ JS_STATIC_PROP_ENTRY(cyan)
JS_STATIC_PROP_ENTRY(dkGray)
JS_STATIC_PROP_ENTRY(gray)
JS_STATIC_PROP_ENTRY(green)
JS_STATIC_PROP_ENTRY(ltGray)
JS_STATIC_PROP_ENTRY(magenta)
- JS_STATIC_PROP_ENTRY(red)
+ JS_STATIC_PROP_ENTRY(red)
JS_STATIC_PROP_ENTRY(transparent)
JS_STATIC_PROP_ENTRY(white)
JS_STATIC_PROP_ENTRY(yellow)
diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp
index f13017022b..ed9b1fbc56 100644
--- a/fpdfsdk/src/javascript/console.cpp
+++ b/fpdfsdk/src/javascript/console.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp
index fb57e741ee..f57b1fb607 100644
--- a/fpdfsdk/src/javascript/event.cpp
+++ b/fpdfsdk/src/javascript/event.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -43,12 +43,12 @@ BEGIN_JS_STATIC_PROP(CJS_Event)
JS_STATIC_PROP_ENTRY(willCommit)
END_JS_STATIC_PROP()
-BEGIN_JS_STATIC_METHOD(CJS_Event)
+BEGIN_JS_STATIC_METHOD(CJS_Event)
END_JS_STATIC_METHOD()
IMPLEMENT_JS_CLASS(CJS_Event,event)
-event::event(CJS_Object * pJsObject) : CJS_EmbedObj(pJsObject)
+event::event(CJS_Object * pJsObject) : CJS_EmbedObj(pJsObject)
{
}
@@ -86,7 +86,7 @@ FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE
ASSERT(pEvent != NULL);
vp << pEvent->ChangeEx();
- return TRUE;
+ return TRUE;
}
FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
@@ -103,7 +103,7 @@ FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s
}
FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
+{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
CJS_EventHandler* pEvent = pContext->GetEventHandler();
@@ -248,7 +248,7 @@ FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr
}
FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
-{
+{
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
CJS_EventHandler* pEvent = pContext->GetEventHandler();
@@ -288,7 +288,7 @@ FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
{
- if (!vp.IsGetting())return FALSE;
+ if (!vp.IsGetting())return FALSE;
CJS_Context* pContext = (CJS_Context*)cc;
ASSERT(pContext != NULL);
diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp
index b7908dc993..e829d7fb19 100644
--- a/fpdfsdk/src/javascript/global.cpp
+++ b/fpdfsdk/src/javascript/global.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/IJavaScript.h"
@@ -104,9 +104,9 @@ FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc)
global_alternate* pGlobal = (global_alternate*)GetEmbedObject();
ASSERT(pGlobal != NULL);
-
+
pGlobal->Initial(pContext->GetReaderApp());
-
+
return TRUE;
};
@@ -335,10 +335,10 @@ void global_alternate::CommitGlobalPersisitentVariables()
FX_POSITION pos = m_mapGlobal.GetStartPosition();
while (pos)
{
- CFX_ByteString name;
+ CFX_ByteString name;
js_global_data* pData = NULL;
m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData);
-
+
if (pData)
{
if (pData->bDeleted)
@@ -390,7 +390,7 @@ void global_alternate::ObjectToArray(v8::Local<v8::Object> pObj, CJS_GlobalVaria
for (int i=0; i<nObjElements; i++)
{
-
+
CFX_WideString ws = JS_ToString(isolate, JS_GetArrayElement(isolate, pKeyList, i));
CFX_ByteString sKey = ws.UTF8Encode();
@@ -489,7 +489,7 @@ void global_alternate::DestroyGlobalPersisitentVariables()
FX_POSITION pos = m_mapGlobal.GetStartPosition();
while (pos)
{
- CFX_ByteString name;
+ CFX_ByteString name;
js_global_data* pData = NULL;
m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData);
delete pData;
@@ -499,7 +499,7 @@ void global_alternate::DestroyGlobalPersisitentVariables()
}
-FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
+FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent)
{
if (propname == NULL) return FALSE;
@@ -545,7 +545,7 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
break;
default:
return FALSE;
- }
+ }
return TRUE;
}
@@ -595,7 +595,7 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType,
break;
default:
return FALSE;
- }
+ }
m_mapGlobal.SetAt(propname, (void*)pNewData);
diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp
index 97bddec5c1..22e1c6dd99 100644
--- a/fpdfsdk/src/javascript/util.cpp
+++ b/fpdfsdk/src/javascript/util.cpp
@@ -1,7 +1,7 @@
// Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
+
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../../include/javascript/JavaScript.h"
@@ -152,7 +152,7 @@ FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
iOffend = c_ConvChar.find(L"%",iOffset+1);
std::wstring strSub;
if (iOffend == -1)
- strSub = c_ConvChar.substr(iOffset);
+ strSub = c_ConvChar.substr(iOffset);
else
strSub = c_ConvChar.substr(iOffset ,iOffend - iOffset);
c_strConvers.push_back(strSub);
@@ -235,7 +235,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
switch (nFormat)
{
case 0:
- swResult.Format(L"D:%04d%02d%02d%02d%02d%02d",
+ swResult.Format(L"D:%04d%02d%02d%02d%02d%02d",
jsDate.GetYear(),
jsDate.GetMonth() + 1,
jsDate.GetDay(),
@@ -244,7 +244,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
jsDate.GetSeconds());
break;
case 1:
- swResult.Format(L"%04d.%02d.%02d %02d:%02d:%02d",
+ swResult.Format(L"%04d.%02d.%02d %02d:%02d:%02d",
jsDate.GetYear(),
jsDate.GetMonth() + 1,
jsDate.GetDay(),
@@ -253,7 +253,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
jsDate.GetSeconds());
break;
case 2:
- swResult.Format(L"%04d/%02d/%02d %02d:%02d:%02d",
+ swResult.Format(L"%04d/%02d/%02d %02d:%02d:%02d",
jsDate.GetYear(),
jsDate.GetMonth() + 1,
jsDate.GetDay(),
@@ -373,7 +373,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose)
{
std::wstring cFormat = cFormat2;
-
+
if (bXFAPicture)
{
return ; //currently, it doesn't support XFAPicture.
@@ -588,8 +588,8 @@ FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value&
{
FX_BOOL bWrongFormat = FALSE;
dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat);
- }
-
+ }
+
if (!JS_PortIsNan(dDate))
{
CJS_Date date(isolate,dDate);