diff options
Diffstat (limited to 'fpdfsdk')
49 files changed, 125 insertions, 78 deletions
diff --git a/fpdfsdk/include/formfiller/FFL_FormFiller.h b/fpdfsdk/include/formfiller/FFL_FormFiller.h index 3ad1e9d8c4..f15d40c7a3 100644 --- a/fpdfsdk/include/formfiller/FFL_FormFiller.h +++ b/fpdfsdk/include/formfiller/FFL_FormFiller.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ #define FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ +#include <map> + #include "fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h" #include "fpdfsdk/include/formfiller/FFL_IFormFiller.h" #include "fpdfsdk/include/fsdk_baseform.h" diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h index fa2c8a2752..2bc579c1da 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h @@ -114,23 +114,17 @@ class CPDFXFA_Document : public IXFA_DocProvider { return 0; } - // SignaturePseudoModel method - // TODO: - virtual int32_t Verify( - IXFA_Doc* hDoc, - CXFA_Node* pSigNode, - FX_BOOL - bUsed = TRUE /*, SecurityHandler* pHandler, SignatureInfo &info*/) { + virtual int32_t Verify(IXFA_Doc* hDoc, + CXFA_Node* pSigNode, + FX_BOOL bUsed = TRUE) { return 0; } - virtual FX_BOOL Sign( - IXFA_Doc* hDoc, - CXFA_NodeList* pNodeList, - const CFX_WideStringC& wsExpression, - const CFX_WideStringC& wsXMLIdent, - const CFX_WideStringC& wsValue = FX_WSTRC(L"open"), - FX_BOOL - bUsed = TRUE /*, SecurityHandler* pHandler = NULL, SignatureInfo &info*/) { + virtual FX_BOOL Sign(IXFA_Doc* hDoc, + CXFA_NodeList* pNodeList, + const CFX_WideStringC& wsExpression, + const CFX_WideStringC& wsXMLIdent, + const CFX_WideStringC& wsValue = FX_WSTRC(L"open"), + FX_BOOL bUsed = TRUE) { return 0; } virtual CXFA_NodeList* Enumerate(IXFA_Doc* hDoc) { return 0; } diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h index 407e94d236..703525dd0f 100644 --- a/fpdfsdk/include/fsdk_annothandler.h +++ b/fpdfsdk/include/fsdk_annothandler.h @@ -11,6 +11,7 @@ #include <vector> #include "core/include/fxcrt/fx_basic.h" +#include "xfa/include/fxfa/fxfa.h" #ifdef PDF_ENABLE_XFA #define FSDK_XFAWIDGET_TYPENAME "XFAWidget" diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h index 4f64145844..bfd1ce188c 100644 --- a/fpdfsdk/include/fx_systemhandler.h +++ b/fpdfsdk/include/fx_systemhandler.h @@ -55,7 +55,7 @@ class IFX_SystemHandler { virtual FX_BOOL IsSelectionImplemented() = 0; virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0; - virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 0; + virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString str) = 0; virtual void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; virtual void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) = 0; @@ -73,7 +73,7 @@ class IFX_SystemHandler { virtual FX_HMENU CreatePopupMenu() = 0; virtual FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, - CFX_WideString string) = 0; + CFX_WideString str) = 0; virtual FX_BOOL EnableMenuItem(FX_HMENU hMenu, int32_t nIDItem, FX_BOOL bEnabled) = 0; diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index 089eecc1d9..d04b45d587 100644 --- a/fpdfsdk/include/fxedit/fx_edit.h +++ b/fpdfsdk/include/fxedit/fx_edit.h @@ -542,7 +542,7 @@ class IFX_List { virtual int32_t GetItemIndex(const CFX_FloatPoint& point) const = 0; virtual int32_t GetFirstSelected() const = 0; - virtual void AddString(const FX_WCHAR* string) = 0; + virtual void AddString(const FX_WCHAR* str) = 0; virtual void SetTopItem(int32_t nIndex) = 0; virtual void Select(int32_t nItemIndex) = 0; virtual void SetCaret(int32_t nItemIndex) = 0; diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h index a02cd8a45e..4f1274c1aa 100644 --- a/fpdfsdk/include/fxedit/fxet_list.h +++ b/fpdfsdk/include/fxedit/fxet_list.h @@ -7,7 +7,7 @@ #ifndef FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ #define FPDFSDK_INCLUDE_FXEDIT_FXET_LIST_H_ -#include "core/include/fpdfapi/fpdf_parser.h" // For CFX_FloatPoint. +#include "core/include/fpdfapi/fpdf_parser.h" #include "fpdfsdk/include/fxedit/fx_edit.h" class IFX_Edit; @@ -307,7 +307,7 @@ class CFX_ListCtrl : public CFX_List { int32_t GetTopItem() const override; CFX_FloatRect GetContentRect() const override; int32_t GetItemIndex(const CFX_FloatPoint& point) const override; - void AddString(const FX_WCHAR* string) override; + void AddString(const FX_WCHAR* str) override; void SetTopItem(int32_t nIndex) override; void Select(int32_t nItemIndex) override; void SetCaret(int32_t nItemIndex) override; diff --git a/fpdfsdk/include/jsapi/fxjs_v8.h b/fpdfsdk/include/jsapi/fxjs_v8.h index 64fa01bd44..dccb261b06 100644 --- a/fpdfsdk/include/jsapi/fxjs_v8.h +++ b/fpdfsdk/include/jsapi/fxjs_v8.h @@ -286,8 +286,7 @@ v8::Local<v8::Value> FXJS_NewObject(v8::Isolate* pIsolate, v8::Local<v8::Object> pObj); v8::Local<v8::Value> FXJS_NewObject2(v8::Isolate* pIsolate, v8::Local<v8::Array> pObj); -v8::Local<v8::Value> FXJS_NewString(v8::Isolate* pIsolate, - const wchar_t* string); +v8::Local<v8::Value> FXJS_NewString(v8::Isolate* pIsolate, const wchar_t* str); v8::Local<v8::Value> FXJS_NewNull(); v8::Local<v8::Value> FXJS_NewDate(v8::Isolate* pIsolate, double d); diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h index e5383009b9..b08e954947 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h @@ -71,7 +71,7 @@ class CPWL_ComboBox : public CPWL_Wnd { CFX_WideString GetText() const; void SetText(const FX_WCHAR* text); - void AddString(const FX_WCHAR* string); + void AddString(const FX_WCHAR* str); int32_t GetSelect() const; void SetSelect(int32_t nItemIndex); diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h index ced4e73d03..e12d727d58 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h @@ -81,7 +81,7 @@ class CPWL_ListBox : public CPWL_Wnd { void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL& bExit, FX_DWORD nFlag); - void AddString(const FX_WCHAR* string); + void AddString(const FX_WCHAR* str); void SetTopVisibleIndex(int32_t nItemIndex); void ScrollToListItem(int32_t nItemIndex); void ResetContent(); diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h index 8087585cee..cb04aaebad 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Note.h +++ b/fpdfsdk/include/pdfwindow/PWL_Note.h @@ -305,7 +305,7 @@ class CPWL_Note : public CPWL_NoteItem { void EnableModify(FX_BOOL bEnabled); CFX_WideString GetReplyString() const; - void SetReplyString(const CFX_WideString& string); + void SetReplyString(const CFX_WideString& str); // CPWL_NoteItem void SetSubjectName(const CFX_WideString& sName) override; diff --git a/fpdfsdk/include/pdfwindow/PWL_Signature.h b/fpdfsdk/include/pdfwindow/PWL_Signature.h index 1f2fa733b2..209782a0b8 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Signature.h +++ b/fpdfsdk/include/pdfwindow/PWL_Signature.h @@ -38,7 +38,7 @@ class CPWL_Signature : public CPWL_Wnd { ~CPWL_Signature() override; void SetText(const FX_WCHAR* sText); - void SetDescription(const FX_WCHAR* string); + void SetDescription(const FX_WCHAR* str); void SetImage(CFX_DIBSource* pImage); void SetImageStream(CPDF_Stream* pStream, const FX_CHAR* sImageAlias); diff --git a/fpdfsdk/src/fpdfdoc_embeddertest.cpp b/fpdfsdk/src/fpdfdoc_embeddertest.cpp index 0ca6a48ca7..4788773982 100644 --- a/fpdfsdk/src/fpdfdoc_embeddertest.cpp +++ b/fpdfsdk/src/fpdfdoc_embeddertest.cpp @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <string> + #include "core/include/fxcrt/fx_string.h" #include "public/fpdf_doc.h" #include "public/fpdfview.h" diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp index 3b3d340a93..2f3a23c548 100644 --- a/fpdfsdk/src/fpdfppo.cpp +++ b/fpdfsdk/src/fpdfppo.cpp @@ -6,7 +6,9 @@ #include "public/fpdf_ppo.h" +#include <map> #include <memory> +#include <vector> #include "core/include/fpdfapi/cpdf_document.h" #include "fpdfsdk/include/fsdk_define.h" diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp index f93b52d6b7..0971a4bcd1 100644 --- a/fpdfsdk/src/fpdfsave.cpp +++ b/fpdfsdk/src/fpdfsave.cpp @@ -6,6 +6,8 @@ #include "public/fpdf_save.h" +#include <vector> + #include "core/include/fpdfapi/cpdf_document.h" #include "core/include/fpdfapi/fpdf_parser.h" #include "core/include/fpdfapi/fpdf_serial.h" diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index e896441263..36064de653 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -634,7 +634,7 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc, content.GetLength()); CFX_WideStringC data(L"data"); if (pXFADocHander->SavePackage(m_pXFADocView->GetDoc(), data, &fileWrite)) { - // TODO: Maybe report error. + // Ignoring error. } } else if (fileType == FXFA_SAVEAS_XDP) { if (m_pPDFDoc == NULL) @@ -694,12 +694,11 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc, } } if (!fileWrite.Flush()) { - // TODO: Report error. + // Ignoring flush error. } } void CPDFXFA_Document::ImportData(IXFA_Doc* hDoc, const CFX_WideStringC& wsFilePath) { - // TODO ... } void CPDFXFA_Document::GotoURL(IXFA_Doc* hDoc, @@ -1001,7 +1000,6 @@ FX_BOOL CPDFXFA_Document::_ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler, pDocHandler->SavePackage(m_pXFADoc, ws, &fileStream); } else { // PDF,creator. - // TODO: } } } @@ -1192,7 +1190,7 @@ FX_BOOL CPDFXFA_Document::_SubmitData(IXFA_Doc* hDoc, CXFA_Submit submit) { bsSubject.ReleaseBuffer(); bsMsg.ReleaseBuffer(); } else { - // http¡¢ftp + // HTTP or FTP CFX_WideString ws; CFX_ByteString bs = csURL.UTF16LE_Encode(); int len = bs.GetLength() / sizeof(unsigned short); diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp index c2a0db022c..7814d8bd8a 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_util.cpp @@ -5,6 +5,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "fpdfsdk/include/fpdfxfa/fpdfxfa_util.h" + +#include <vector> + #include "fpdfsdk/include/fsdk_define.h" #include "fpdfsdk/include/fsdk_mgr.h" diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp index 496e1131dc..3bdc2c8467 100644 --- a/fpdfsdk/src/fsdk_actionhandler.cpp +++ b/fpdfsdk/src/fsdk_actionhandler.cpp @@ -5,6 +5,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "fpdfsdk/include/fsdk_actionhandler.h" + +#include <set> + #include "fpdfsdk/include/fsdk_define.h" #include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/javascript/IJavaScript.h" diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp index ee0a4d8d73..57591d0228 100644 --- a/fpdfsdk/src/fsdk_annothandler.cpp +++ b/fpdfsdk/src/fsdk_annothandler.cpp @@ -4,11 +4,13 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include "fpdfsdk/include/fsdk_annothandler.h" + #include <algorithm> +#include <vector> #include "core/include/fpdfapi/cpdf_document.h" #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" -#include "fpdfsdk/include/fsdk_annothandler.h" #include "fpdfsdk/include/fsdk_define.h" #include "fpdfsdk/include/fsdk_mgr.h" diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index e18959f5fd..27dc171890 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -8,6 +8,7 @@ #include <algorithm> #include <memory> +#include <vector> #include "core/include/fpdfapi/cpdf_document.h" #include "fpdfsdk/include/formfiller/FFL_FormFiller.h" diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index 1177ddfabc..ed2df4bc83 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -62,7 +62,7 @@ class CFX_SystemHandler : public IFX_SystemHandler { void OutputSelectedRect(void* pFormFiller, CFX_FloatRect& rect) override; FX_BOOL IsSelectionImplemented() override; CFX_WideString GetClipboardText(FX_HWND hWnd) override { return L""; } - FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) override { + FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString str) override { return FALSE; } void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) override {} @@ -71,7 +71,7 @@ class CFX_SystemHandler : public IFX_SystemHandler { FX_HMENU CreatePopupMenu() override { return NULL; } FX_BOOL AppendMenuItem(FX_HMENU hMenu, int32_t nIDNewItem, - CFX_WideString string) override { + CFX_WideString str) override { return FALSE; } FX_BOOL EnableMenuItem(FX_HMENU hMenu, diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp index 313cc481b3..cc9696030e 100644 --- a/fpdfsdk/src/fxedit/fxet_list.cpp +++ b/fpdfsdk/src/fxedit/fxet_list.cpp @@ -4,9 +4,10 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "fpdfsdk/include/fxedit/fxet_edit.h" #include "fpdfsdk/include/fxedit/fxet_list.h" +#include "fpdfsdk/include/fxedit/fxet_edit.h" + CFX_ListItem::CFX_ListItem() : m_pEdit(NULL), m_bSelected(FALSE), @@ -592,8 +593,8 @@ CFX_FloatRect CFX_ListCtrl::GetItemRect(int32_t nIndex) const { return InToOut(CFX_List::GetItemRect(nIndex)); } -void CFX_ListCtrl::AddString(const FX_WCHAR* string) { - AddItem(string); +void CFX_ListCtrl::AddString(const FX_WCHAR* str) { + AddItem(str); ReArrange(GetCount() - 1); } diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index f688982da5..1c9c1f31f4 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -6,8 +6,10 @@ #include "fpdfsdk/src/javascript/Document.h" +#include <vector> + #include "core/include/fpdfapi/cpdf_document.h" -#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. +#include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/src/javascript/Field.h" #include "fpdfsdk/src/javascript/Icon.h" @@ -656,8 +658,6 @@ FX_BOOL Document::submitForm(IJS_Context* cc, return TRUE; } -////////////////////////////////////////////////////////////////////////////////////////////// - void Document::AttachDoc(CPDFSDK_Document* pDoc) { m_pDocument = pDoc; } diff --git a/fpdfsdk/src/javascript/Document.h b/fpdfsdk/src/javascript/Document.h index c36893fd87..06c4121510 100644 --- a/fpdfsdk/src/javascript/Document.h +++ b/fpdfsdk/src/javascript/Document.h @@ -9,6 +9,7 @@ #include <list> #include <memory> +#include <vector> #include "fpdfsdk/src/javascript/JS_Define.h" diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 9b6a7facba..35ef8b42da 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -8,6 +8,7 @@ #include <algorithm> #include <memory> +#include <string> #include <vector> #include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. diff --git a/fpdfsdk/src/javascript/Field.h b/fpdfsdk/src/javascript/Field.h index 4fba1ddfa1..49103c8284 100644 --- a/fpdfsdk/src/javascript/Field.h +++ b/fpdfsdk/src/javascript/Field.h @@ -7,7 +7,8 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_FIELD_H_ #define FPDFSDK_SRC_JAVASCRIPT_FIELD_H_ -#include <string> // For std::wstring. +#include <string> +#include <vector> #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" // For CPWL_Color. #include "fpdfsdk/src/javascript/JS_Define.h" diff --git a/fpdfsdk/src/javascript/JS_Define.h b/fpdfsdk/src/javascript/JS_Define.h index f03d9ec7fc..e16c5a097a 100644 --- a/fpdfsdk/src/javascript/JS_Define.h +++ b/fpdfsdk/src/javascript/JS_Define.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_ #define FPDFSDK_SRC_JAVASCRIPT_JS_DEFINE_H_ +#include <vector> + #include "fpdfsdk/include/jsapi/fxjs_v8.h" #include "fpdfsdk/src/javascript/JS_Object.h" #include "fpdfsdk/src/javascript/JS_Value.h" @@ -15,7 +17,7 @@ struct JSConstSpec { const wchar_t* pName; double number; - const wchar_t* string; + const wchar_t* string; // NOLINT uint8_t t; // 0:double 1:str }; diff --git a/fpdfsdk/src/javascript/JS_Runtime.h b/fpdfsdk/src/javascript/JS_Runtime.h index 8215b88994..c7b0009ccb 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.h +++ b/fpdfsdk/src/javascript/JS_Runtime.h @@ -8,6 +8,7 @@ #define FPDFSDK_SRC_JAVASCRIPT_JS_RUNTIME_H_ #include <set> +#include <map> #include <utility> #include <vector> diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp index cd5f2518cf..70ccdb5e97 100644 --- a/fpdfsdk/src/javascript/JS_Value.cpp +++ b/fpdfsdk/src/javascript/JS_Value.cpp @@ -7,9 +7,11 @@ #include "fpdfsdk/src/javascript/JS_Value.h" #include <time.h> + #include <algorithm> #include <cmath> #include <limits> +#include <vector> #include "fpdfsdk/src/javascript/Document.h" #include "fpdfsdk/src/javascript/JS_Define.h" @@ -361,14 +363,14 @@ void CJS_PropValue::StartSetting() { void CJS_PropValue::StartGetting() { m_bIsSetting = 0; } -void CJS_PropValue::operator<<(CFX_ByteString string) { +void CJS_PropValue::operator<<(CFX_ByteString str) { ASSERT(!m_bIsSetting); - CJS_Value::operator=(string.c_str()); + CJS_Value::operator=(str.c_str()); } -void CJS_PropValue::operator>>(CFX_ByteString& string) const { +void CJS_PropValue::operator>>(CFX_ByteString& str) const { ASSERT(m_bIsSetting); - string = CJS_Value::ToCFXByteString(); + str = CJS_Value::ToCFXByteString(); } void CJS_PropValue::operator<<(const FX_WCHAR* c_string) { @@ -794,7 +796,7 @@ int JS_GetSecFromTime(double dt) { return (int)_Mod(FXSYS_floor((double)(dt / 1000)), 60); } -double JS_DateParse(const wchar_t* string) { +double JS_DateParse(const wchar_t* str) { v8::Isolate* pIsolate = v8::Isolate::GetCurrent(); v8::Isolate::Scope isolate_scope(pIsolate); v8::HandleScope scope(pIsolate); @@ -817,7 +819,7 @@ double JS_DateParse(const wchar_t* string) { v8::Local<v8::Function> funC = v8::Local<v8::Function>::Cast(v); const int argc = 1; - v8::Local<v8::String> timeStr = FXJS_WSToJSString(pIsolate, string); + v8::Local<v8::String> timeStr = FXJS_WSToJSString(pIsolate, str); v8::Local<v8::Value> argv[argc] = {timeStr}; v = funC->Call(context, context->Global(), argc, argv).ToLocalChecked(); if (v->IsNumber()) { diff --git a/fpdfsdk/src/javascript/JS_Value.h b/fpdfsdk/src/javascript/JS_Value.h index 6c6a03d265..f6c1c360ca 100644 --- a/fpdfsdk/src/javascript/JS_Value.h +++ b/fpdfsdk/src/javascript/JS_Value.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_ #define FPDFSDK_SRC_JAVASCRIPT_JS_VALUE_H_ +#include <vector> + #include "core/include/fxcrt/fx_basic.h" #include "fpdfsdk/include/jsapi/fxjs_v8.h" @@ -206,7 +208,7 @@ int JS_GetDayFromTime(double dt); int JS_GetHourFromTime(double dt); int JS_GetMinFromTime(double dt); int JS_GetSecFromTime(double dt); -double JS_DateParse(const wchar_t* string); +double JS_DateParse(const wchar_t* str); double JS_MakeDay(int nYear, int nMonth, int nDay); double JS_MakeTime(int nHour, int nMin, int nSec, int nMs); double JS_MakeDate(double day, double time); diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index f228072b35..014dea2d6a 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -7,6 +7,8 @@ #include "fpdfsdk/src/javascript/PublicMethods.h" #include <algorithm> +#include <string> +#include <vector> #include "core/include/fxcrt/fx_ext.h" #include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. @@ -77,8 +79,8 @@ static const FX_WCHAR* const fullmonths[] = {L"January", L"November", L"December"}; -FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string) { - CFX_WideString sTrim = StrTrim(string); +FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* str) { + CFX_WideString sTrim = StrTrim(str); const FX_WCHAR* pTrim = sTrim.c_str(); const FX_WCHAR* p = pTrim; @@ -228,17 +230,17 @@ CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(CJS_Runtime* pRuntime, return StrArray; } -int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string, +int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& str, int nStart, int& nSkip, int nMaxStep) { int nRet = 0; nSkip = 0; - for (int i = nStart, sz = string.GetLength(); i < sz; i++) { + for (int i = nStart, sz = str.GetLength(); i < sz; i++) { if (i - nStart > 10) break; - FX_WCHAR c = string.GetAt(i); + FX_WCHAR c = str.GetAt(i); if (!FXSYS_iswdigit(c)) break; @@ -251,14 +253,13 @@ int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string, return nRet; } -CFX_WideString CJS_PublicMethods::ParseStringString( - const CFX_WideString& string, - int nStart, - int& nSkip) { +CFX_WideString CJS_PublicMethods::ParseStringString(const CFX_WideString& str, + int nStart, + int& nSkip) { CFX_WideString swRet; nSkip = 0; - for (int i = nStart, sz = string.GetLength(); i < sz; i++) { - FX_WCHAR c = string.GetAt(i); + for (int i = nStart, sz = str.GetLength(); i < sz; i++) { + FX_WCHAR c = str.GetAt(i); if (!FXSYS_iswdigit(c)) break; diff --git a/fpdfsdk/src/javascript/PublicMethods.h b/fpdfsdk/src/javascript/PublicMethods.h index aa9be94ec7..d0c81e03e3 100644 --- a/fpdfsdk/src/javascript/PublicMethods.h +++ b/fpdfsdk/src/javascript/PublicMethods.h @@ -7,6 +7,9 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ #define FPDFSDK_SRC_JAVASCRIPT_PUBLICMETHODS_H_ +#include <string> +#include <vector> + #include "fpdfsdk/src/javascript/JS_Define.h" class CJS_PublicMethods : public CJS_Object { diff --git a/fpdfsdk/src/javascript/app.cpp b/fpdfsdk/src/javascript/app.cpp index a9227a7bdb..767555ff3b 100644 --- a/fpdfsdk/src/javascript/app.cpp +++ b/fpdfsdk/src/javascript/app.cpp @@ -7,8 +7,9 @@ #include "fpdfsdk/src/javascript/app.h" #include <memory> +#include <vector> -#include "fpdfsdk/include/fsdk_mgr.h" // For CPDFDoc_Environment. +#include "fpdfsdk/include/fsdk_mgr.h" #include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/src/javascript/Document.h" #include "fpdfsdk/src/javascript/JS_Context.h" diff --git a/fpdfsdk/src/javascript/app.h b/fpdfsdk/src/javascript/app.h index 0b3e50e63d..faebcbd5ce 100644 --- a/fpdfsdk/src/javascript/app.h +++ b/fpdfsdk/src/javascript/app.h @@ -7,12 +7,11 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_APP_H_ #define FPDFSDK_SRC_JAVASCRIPT_APP_H_ +#include <vector> + #include "fpdfsdk/src/javascript/JS_Define.h" class CJS_Runtime; - -/* ---------------------------- TimerObj ---------------------------- */ - class CJS_Timer; class TimerObj : public CJS_EmbedObj { diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp index 5c02ca28da..4339b4eccf 100644 --- a/fpdfsdk/src/javascript/color.cpp +++ b/fpdfsdk/src/javascript/color.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/src/javascript/color.h" +#include <vector> + #include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/src/javascript/JS_Context.h" #include "fpdfsdk/src/javascript/JS_Define.h" diff --git a/fpdfsdk/src/javascript/color.h b/fpdfsdk/src/javascript/color.h index 20f5244a58..616337414d 100644 --- a/fpdfsdk/src/javascript/color.h +++ b/fpdfsdk/src/javascript/color.h @@ -7,7 +7,9 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_COLOR_H_ #define FPDFSDK_SRC_JAVASCRIPT_COLOR_H_ -#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" // For CPWL_Color. +#include <vector> + +#include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" #include "fpdfsdk/src/javascript/JS_Define.h" class color : public CJS_EmbedObj { diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp index 2f56c1e090..8beb083f1e 100644 --- a/fpdfsdk/src/javascript/console.cpp +++ b/fpdfsdk/src/javascript/console.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/src/javascript/console.h" +#include <vector> + #include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/src/javascript/JS_Context.h" #include "fpdfsdk/src/javascript/JS_Define.h" diff --git a/fpdfsdk/src/javascript/console.h b/fpdfsdk/src/javascript/console.h index a810184b41..651899bf4c 100644 --- a/fpdfsdk/src/javascript/console.h +++ b/fpdfsdk/src/javascript/console.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_CONSOLE_H_ #define FPDFSDK_SRC_JAVASCRIPT_CONSOLE_H_ +#include <vector> + #include "fpdfsdk/src/javascript/JS_Define.h" class console : public CJS_EmbedObj { diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index fdd67553fc..234e132d46 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/src/javascript/global.h" +#include <vector> + #include "core/include/fxcrt/fx_ext.h" #include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/src/javascript/JS_Context.h" diff --git a/fpdfsdk/src/javascript/global.h b/fpdfsdk/src/javascript/global.h index c2fb076b8c..e8172e691e 100644 --- a/fpdfsdk/src/javascript/global.h +++ b/fpdfsdk/src/javascript/global.h @@ -8,6 +8,7 @@ #define FPDFSDK_SRC_JAVASCRIPT_GLOBAL_H_ #include <map> +#include <vector> #include "fpdfsdk/src/javascript/JS_Define.h" diff --git a/fpdfsdk/src/javascript/report.cpp b/fpdfsdk/src/javascript/report.cpp index 952ed21a20..8374f3c2c8 100644 --- a/fpdfsdk/src/javascript/report.cpp +++ b/fpdfsdk/src/javascript/report.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/src/javascript/report.h" +#include <vector> + #include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/src/javascript/JS_Define.h" #include "fpdfsdk/src/javascript/JS_Object.h" diff --git a/fpdfsdk/src/javascript/report.h b/fpdfsdk/src/javascript/report.h index dc43912cb1..55d74648fc 100644 --- a/fpdfsdk/src/javascript/report.h +++ b/fpdfsdk/src/javascript/report.h @@ -7,6 +7,8 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_REPORT_H_ #define FPDFSDK_SRC_JAVASCRIPT_REPORT_H_ +#include <vector> + #include "fpdfsdk/src/javascript/JS_Define.h" class Report : public CJS_EmbedObj { diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index c9149be570..52a93625b9 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -8,6 +8,9 @@ #include <time.h> +#include <string> +#include <vector> + #include "core/include/fxcrt/fx_ext.h" #include "fpdfsdk/include/javascript/IJavaScript.h" #include "fpdfsdk/src/javascript/JS_Context.h" diff --git a/fpdfsdk/src/javascript/util.h b/fpdfsdk/src/javascript/util.h index 9441b11b13..6e3a5d2901 100644 --- a/fpdfsdk/src/javascript/util.h +++ b/fpdfsdk/src/javascript/util.h @@ -7,7 +7,8 @@ #ifndef FPDFSDK_SRC_JAVASCRIPT_UTIL_H_ #define FPDFSDK_SRC_JAVASCRIPT_UTIL_H_ -#include <string> // For std::wstring. +#include <string> +#include <vector> #include "fpdfsdk/src/javascript/JS_Define.h" diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index 5631ab6258..86f6ced198 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/include/jsapi/fxjs_v8.h" +#include <vector> + #include "core/include/fxcrt/fx_basic.h" const wchar_t kFXJSValueNameString[] = L"string"; @@ -745,9 +747,8 @@ v8::Local<v8::Value> FXJS_NewObject2(v8::Isolate* pIsolate, return pObj->Clone(); } -v8::Local<v8::Value> FXJS_NewString(v8::Isolate* pIsolate, - const wchar_t* string) { - return FXJS_WSToJSString(pIsolate, string); +v8::Local<v8::Value> FXJS_NewString(v8::Isolate* pIsolate, const wchar_t* str) { + return FXJS_WSToJSString(pIsolate, str); } v8::Local<v8::Value> FXJS_NewNull() { diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp index bdc6724f65..6edd6bdd85 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp @@ -239,9 +239,9 @@ void CPWL_ComboBox::SetText(const FX_WCHAR* text) { m_pEdit->SetText(text); } -void CPWL_ComboBox::AddString(const FX_WCHAR* string) { +void CPWL_ComboBox::AddString(const FX_WCHAR* str) { if (m_pList) - m_pList->AddString(string); + m_pList->AddString(str); } int32_t CPWL_ComboBox::GetSelect() const { diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp index 0b3887b413..c4a5bf03fd 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp @@ -6,6 +6,8 @@ #include "fpdfsdk/include/pdfwindow/PWL_Edit.h" +#include <vector> + #include "core/include/fxcrt/fx_safe_types.h" #include "core/include/fxcrt/fx_xml.h" #include "fpdfsdk/include/pdfwindow/PWL_Caret.h" diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp index c8e738a7ca..2c0b79d2f1 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp @@ -391,9 +391,9 @@ CFX_FloatRect CPWL_ListBox::GetFocusRect() const { return CPWL_Wnd::GetFocusRect(); } -void CPWL_ListBox::AddString(const FX_WCHAR* string) { +void CPWL_ListBox::AddString(const FX_WCHAR* str) { if (m_pList) { - m_pList->AddString(string); + m_pList->AddString(str); } } diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp index 1933d564f4..7ba6f6ad66 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp @@ -1507,6 +1507,6 @@ CFX_WideString CPWL_Note::GetReplyString() const { return m_sReplyString; } -void CPWL_Note::SetReplyString(const CFX_WideString& string) { - m_sReplyString = string; +void CPWL_Note::SetReplyString(const CFX_WideString& str) { + m_sReplyString = str; } diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp index 6b3940de28..ffb4461878 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp @@ -4,9 +4,10 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include "fpdfsdk/include/pdfwindow/PWL_Signature.h" + #include "fpdfsdk/include/pdfwindow/PWL_Icon.h" #include "fpdfsdk/include/pdfwindow/PWL_Label.h" -#include "fpdfsdk/include/pdfwindow/PWL_Signature.h" #include "fpdfsdk/include/pdfwindow/PWL_Utils.h" #include "fpdfsdk/include/pdfwindow/PWL_Wnd.h" @@ -86,8 +87,8 @@ void CPWL_Signature::SetText(const FX_WCHAR* sText) { RePosChildWnd(); } -void CPWL_Signature::SetDescription(const FX_WCHAR* string) { - m_pDescription->SetText(string); +void CPWL_Signature::SetDescription(const FX_WCHAR* str) { + m_pDescription->SetText(str); RePosChildWnd(); } |