diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-06-10 14:33:37 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-06-10 14:33:37 -0700 |
commit | d7e5cc754a937605d1f73db5e7967c58ddd80742 (patch) | |
tree | ed28e012c4d6a46b7f29f15a0c060474c27d4286 /fpdfsdk | |
parent | bfa9a824a20f37c2dd7111012b46c929cf2ed8a0 (diff) | |
download | pdfium-d7e5cc754a937605d1f73db5e7967c58ddd80742.tar.xz |
Merge to XFA: Remove typdefs for pointer types in fx_system.h.
Original Review URL: https://codereview.chromium.org/1171733003
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1178613002.
Diffstat (limited to 'fpdfsdk')
61 files changed, 266 insertions, 272 deletions
diff --git a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h index a51e9efbe1..687cd6f207 100644 --- a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h +++ b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h @@ -20,7 +20,7 @@ public: virtual ~CBA_FontMap(); - virtual void Initial(FX_LPCSTR fontname = NULL); + virtual void Initial(const FX_CHAR* fontname = NULL); public: void SetDefaultFont(CPDF_Font * pFont, const CFX_ByteString & sFontName); diff --git a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h index d8cda3953f..163120b928 100644 --- a/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h +++ b/fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h @@ -56,7 +56,7 @@ public: //dwFlags XFA_PAGEVIEWEVENT_Added, XFA_PAGEVIEWEVENT_Removing
virtual void PageViewEvent(IXFA_PageView* pPageView, FX_DWORD dwFlags);
//dwEvent refer to XFA_WIDGETEVENT_XXX
- virtual void WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam = NULL, FX_LPVOID pAdditional = NULL);
+ virtual void WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, void* pParam = NULL, void* pAdditional = NULL);
//return true if render it.
virtual FX_BOOL RenderCustomWidget(IXFA_Widget* hWidget, CFX_Graphics* pGS, CFX_Matrix* pMatrix, const CFX_RectF& rtUI){return FALSE;}
diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h index 88192aad31..2091376c9c 100644 --- a/fpdfsdk/include/fsdk_baseform.h +++ b/fpdfsdk/include/fsdk_baseform.h @@ -136,7 +136,7 @@ public: void SetTopVisibleIndex(int index); void ResetAppearance(FX_BOOL bValueChanged); - void ResetAppearance(FX_LPCWSTR sValue, FX_BOOL bValueChanged); + void ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged); void ResetFieldAppearance(FX_BOOL bValueChanged); void UpdateField(); CFX_WideString OnFormat(int nCommitKey, FX_BOOL& bFormated); @@ -163,9 +163,9 @@ private: void ResetAppearance_PushButton(); void ResetAppearance_CheckBox(); void ResetAppearance_RadioButton(); - void ResetAppearance_ComboBox(FX_LPCWSTR sValue); + void ResetAppearance_ComboBox(const FX_WCHAR* sValue); void ResetAppearance_ListBox(); - void ResetAppearance_TextField(FX_LPCWSTR sValue); + void ResetAppearance_TextField(const FX_WCHAR* sValue); CPDF_Rect GetClientRect() const; CPDF_Rect GetRotatedRect() const; @@ -266,7 +266,7 @@ public: void OnCalculate(CPDF_FormField* pFormField = NULL); CFX_WideString OnFormat(CPDF_FormField* pFormField, int nCommitKey, FX_BOOL& bFormated); - void ResetFieldAppearance(CPDF_FormField* pFormField, FX_LPCWSTR sValue, FX_BOOL bValueChanged); + void ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, FX_BOOL bValueChanged); void UpdateField(CPDF_FormField* pFormField); public: @@ -299,7 +299,7 @@ private: private: FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile); - FX_BOOL FDFToURLEncodedData(FX_LPBYTE& pBuf, FX_STRSIZE& nBufSize); + FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); int GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const; void DoFDFBuffer(CFX_ByteString sBuffer); diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h index 12ef8133a2..c21dd88ca9 100644 --- a/fpdfsdk/include/fsdk_define.h +++ b/fpdfsdk/include/fsdk_define.h @@ -85,7 +85,7 @@ public: virtual CFX_ByteString GetFullPath() { return ""; } virtual FX_FILESIZE GetSize() override { return m_FileAccess.m_FileLen; } virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch); - virtual FX_BOOL GetBlock(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size); + virtual FX_BOOL GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size); virtual void Release() override { delete this; } virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) override; diff --git a/fpdfsdk/include/fsdk_mgr.h b/fpdfsdk/include/fsdk_mgr.h index d90ab3be4f..b0ff5a7599 100644 --- a/fpdfsdk/include/fsdk_mgr.h +++ b/fpdfsdk/include/fsdk_mgr.h @@ -129,7 +129,7 @@ public: return FALSE; } - int JS_appAlert(FX_LPCWSTR Msg, FX_LPCWSTR Title, FX_UINT Type, FX_UINT Icon) + int JS_appAlert(const FX_WCHAR* Msg, const FX_WCHAR* Title, FX_UINT Type, FX_UINT Icon) { if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert) { @@ -145,7 +145,7 @@ public: return -1; } - int JS_appResponse(FX_LPCWSTR Question, FX_LPCWSTR Title, FX_LPCWSTR Default, FX_LPCWSTR cLabel, FPDF_BOOL bPassword, void* response, int length) + int JS_appResponse(const FX_WCHAR* Question, const FX_WCHAR* Title, const FX_WCHAR* Default, const FX_WCHAR* cLabel, FPDF_BOOL bPassword, void* response, int length) { if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_response) { @@ -230,7 +230,7 @@ public: return L""; } - void JS_docSubmitForm(void* formData, int length, FX_LPCWSTR URL) + void JS_docSubmitForm(void* formData, int length, const FX_WCHAR* URL) { if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_submitForm) { @@ -241,7 +241,7 @@ public: } } - void JS_docmailForm(void* mailData, int length, FPDF_BOOL bUI,FX_LPCWSTR To, FX_LPCWSTR Subject, FX_LPCWSTR CC, FX_LPCWSTR BCC, FX_LPCWSTR Msg) + void JS_docmailForm(void* mailData, int length, FPDF_BOOL bUI,const FX_WCHAR* To, const FX_WCHAR* Subject, const FX_WCHAR* CC, const FX_WCHAR* BCC, const FX_WCHAR* Msg) { if(m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->Doc_mail) { @@ -306,7 +306,7 @@ public: } return 0; } - void FFI_ExecuteNamedAction(FX_LPCSTR namedAction) + void FFI_ExecuteNamedAction(const FX_CHAR* namedAction) { if(m_pInfo && m_pInfo->FFI_ExecuteNamedAction) { @@ -321,7 +321,7 @@ public: } } - void FFI_DoURIAction(FX_LPCSTR bsURI) + void FFI_DoURIAction(const FX_CHAR* bsURI) { if(m_pInfo && m_pInfo->FFI_DoURIAction) { @@ -554,7 +554,7 @@ public: return 0; } - IFX_FileRead* FFI_DownloadFromURL(FX_LPCWSTR url) + IFX_FileRead* FFI_DownloadFromURL(const FX_WCHAR* url) { if (m_pInfo && m_pInfo->FFI_DownloadFromURL) { @@ -569,7 +569,7 @@ public: return NULL; } - CFX_WideString FFI_PostRequestURL(FX_LPCWSTR wsURL, FX_LPCWSTR wsData, FX_LPCWSTR wsContentType, FX_LPCWSTR wsEncode, FX_LPCWSTR wsHeader) + CFX_WideString FFI_PostRequestURL(const FX_WCHAR* wsURL, const FX_WCHAR* wsData, const FX_WCHAR* wsContentType, const FX_WCHAR* wsEncode, const FX_WCHAR* wsHeader) { if (m_pInfo && m_pInfo->FFI_PostRequestURL) { @@ -600,7 +600,7 @@ public: return L""; } - FPDF_BOOL FFI_PutRequestURL(FX_LPCWSTR wsURL, FX_LPCWSTR wsData, FX_LPCWSTR wsEncode) + FPDF_BOOL FFI_PutRequestURL(const FX_WCHAR* wsURL, const FX_WCHAR* wsData, const FX_WCHAR* wsEncode) { if (m_pInfo && m_pInfo->FFI_PutRequestURL) { @@ -618,7 +618,7 @@ public: return FALSE; } - FPDF_BOOL FFI_ShowFileDialog(FX_LPCWSTR wsTitle, FX_LPCWSTR wsFilter, CFX_WideStringArray &wsPathArr, FX_BOOL bOpen) + FPDF_BOOL FFI_ShowFileDialog(const FX_WCHAR* wsTitle, const FX_WCHAR* wsFilter, CFX_WideStringArray &wsPathArr, FX_BOOL bOpen) { /*CFX_ByteString bsTitle = CFX_WideString(wsTitle).UTF16LE_Encode(); FPDF_WIDESTRING title = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength()); @@ -779,7 +779,7 @@ public: FX_BOOL Annot_HasAppearance(CPDF_Annot* pAnnot); CPDFSDK_Annot* AddAnnot(CPDF_Dictionary * pDict); - CPDFSDK_Annot* AddAnnot(FX_LPCSTR lpSubType,CPDF_Dictionary * pDict); + CPDFSDK_Annot* AddAnnot(const FX_CHAR* lpSubType,CPDF_Dictionary * pDict); CPDFSDK_Annot* AddAnnot(CPDF_Annot * pPDFAnnot); CPDFSDK_Annot* AddAnnot(IXFA_Widget* pPDFAnnot); FX_BOOL DeleteAnnot(CPDFSDK_Annot* pAnnot); @@ -802,7 +802,7 @@ public: FX_BOOL OnMouseMove(const CPDF_Point & point, int nFlag); FX_BOOL OnMouseWheel(double deltaX, double deltaY,const CPDF_Point& point, int nFlag); - FX_BOOL IsValidAnnot(FX_LPVOID p); + FX_BOOL IsValidAnnot(void* p); void GetCurrentMatrix(CPDF_Matrix& matrix) {matrix = m_curMatrix;} void UpdateRects(CFX_RectArray& rects); void UpdateView(CPDFSDK_Annot* pAnnot); diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h index 276019eae5..e398f78b88 100644 --- a/fpdfsdk/include/fx_systemhandler.h +++ b/fpdfsdk/include/fx_systemhandler.h @@ -7,8 +7,8 @@ #ifndef FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ #define FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ -typedef FX_LPVOID FX_HWND; -typedef FX_LPVOID FX_HMENU; +typedef void* FX_HWND; +typedef void* FX_HMENU; typedef void (*TimerCallback)(int32_t idEvent); typedef struct _FX_SYSTEMTIME diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index 0da6fe6f9e..f710cddaa7 100644 --- a/fpdfsdk/include/fxedit/fx_edit.h +++ b/fpdfsdk/include/fxedit/fx_edit.h @@ -309,14 +309,14 @@ public: virtual void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) = 0; //put text into edit. - virtual void SetText(FX_LPCWSTR text,int32_t charset = DEFAULT_CHARSET, + virtual void SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert a word into the edit. virtual FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL) = 0; //insert a return into the edit. virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert text into the edit. - virtual FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset = DEFAULT_CHARSET, + virtual FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //do backspace operation. virtual FX_BOOL Backspace() = 0; @@ -468,7 +468,7 @@ public: virtual int32_t GetItemIndex(const CPDF_Point & point) const = 0; virtual int32_t GetFirstSelected() const = 0; - virtual void AddString(FX_LPCWSTR string) = 0; + virtual void AddString(const FX_WCHAR* string) = 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_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h index 6fd7b9a4ee..0a3617f4e4 100644 --- a/fpdfsdk/include/fxedit/fxet_edit.h +++ b/fpdfsdk/include/fxedit/fxet_edit.h @@ -618,7 +618,7 @@ public: void OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl); void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl); - void SetText(FX_LPCWSTR text,int32_t charset = DEFAULT_CHARSET, + void SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); FX_BOOL InsertWord(FX_WORD word, int32_t charset = DEFAULT_CHARSET, const CPVT_WordProps * pWordProps = NULL); FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); @@ -626,11 +626,11 @@ public: FX_BOOL Delete(); FX_BOOL Clear(); FX_BOOL Empty(); - FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset = DEFAULT_CHARSET, + FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset = DEFAULT_CHARSET, const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); FX_BOOL Redo(); FX_BOOL Undo(); - CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, int32_t charset, + CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place, const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); int32_t GetCharSetFromUnicode(FX_WORD word, int32_t nOldCharset); @@ -679,14 +679,14 @@ private: void SetContentChanged(); void EnableNotify(FX_BOOL bNotify); - void SetText(FX_LPCWSTR text,int32_t charset, + void SetText(const FX_WCHAR* text,int32_t charset, const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL Delete(FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint); - FX_BOOL InsertText(FX_LPCWSTR text, int32_t charset, + FX_BOOL InsertText(const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps); diff --git a/fpdfsdk/include/fxedit/fxet_list.h b/fpdfsdk/include/fxedit/fxet_list.h index b7888eaf3b..02028f2cff 100644 --- a/fpdfsdk/include/fxedit/fxet_list.h +++ b/fpdfsdk/include/fxedit/fxet_list.h @@ -163,7 +163,7 @@ public: void SetRect(const CLST_Rect & rect); void SetSelect(FX_BOOL bSelected); void SetCaret(FX_BOOL bCaret); - void SetText(FX_LPCWSTR text); + void SetText(const FX_WCHAR* text); void SetFontSize(FX_FLOAT fFontSize); CFX_WideString GetText() const; @@ -240,7 +240,7 @@ public: protected: virtual void Empty(); - void AddItem(FX_LPCWSTR str); + void AddItem(const FX_WCHAR* str); virtual void ReArrange(int32_t nItemIndex); virtual CPDF_Rect GetItemRect(int32_t nIndex) const; @@ -331,7 +331,7 @@ public: virtual CPDF_Rect GetContentRect() const; virtual int32_t GetItemIndex(const CPDF_Point & point) const; - void AddString(FX_LPCWSTR string); + void AddString(const FX_WCHAR* string); void SetTopItem(int32_t nIndex); void Select(int32_t nItemIndex); virtual void SetCaret(int32_t nItemIndex); diff --git a/fpdfsdk/include/javascript/JS_EventHandler.h b/fpdfsdk/include/javascript/JS_EventHandler.h index d6cdbe81bc..a99030734b 100644 --- a/fpdfsdk/include/javascript/JS_EventHandler.h +++ b/fpdfsdk/include/javascript/JS_EventHandler.h @@ -126,8 +126,8 @@ public: FX_BOOL FieldFull(); FX_BOOL KeyDown(); FX_BOOL Modifier(); - FX_LPCWSTR Name(); - FX_LPCWSTR Type(); + const FX_WCHAR* Name(); + const FX_WCHAR* Type(); FX_BOOL& Rc(); int& SelEnd(); int& SelStart(); diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h index 4e1073d15a..fea082d811 100644 --- a/fpdfsdk/include/javascript/JS_GlobalData.h +++ b/fpdfsdk/include/javascript/JS_GlobalData.h @@ -66,14 +66,14 @@ public: virtual ~CJS_GlobalData(); public: - void SetGlobalVariableNumber(FX_LPCSTR propname, double dData); - void SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData); - void SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteString& sData); - void SetGlobalVariableObject(FX_LPCSTR propname, const CJS_GlobalVariableArray& array); - void SetGlobalVariableNull(FX_LPCSTR propname); - - FX_BOOL SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent); - FX_BOOL DeleteGlobalVariable(FX_LPCSTR propname); + void SetGlobalVariableNumber(const FX_CHAR* propname, double dData); + void SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData); + void SetGlobalVariableString(const FX_CHAR* propname, const CFX_ByteString& sData); + void SetGlobalVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array); + void SetGlobalVariableNull(const FX_CHAR* propname); + + FX_BOOL SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent); + FX_BOOL DeleteGlobalVariable(const FX_CHAR* propname); int32_t GetSize() const; CJS_GlobalData_Element* GetAt(int index) const; @@ -82,11 +82,11 @@ private: void LoadGlobalPersistentVariables(); void SaveGlobalPersisitentVariables(); - CJS_GlobalData_Element* GetGlobalVariable(FX_LPCSTR propname); - int FindGlobalVariable(FX_LPCSTR propname); + CJS_GlobalData_Element* GetGlobalVariable(const FX_CHAR* propname); + int FindGlobalVariable(const FX_CHAR* propname); - void LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, int32_t& nLength); - void WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, int32_t nLength); + void LoadFileBuffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, int32_t& nLength); + void WriteFileBuffer(const FX_WCHAR* sFilePath, const FX_CHAR* pBuffer, int32_t nLength); void MakeByteString(const CFX_ByteString& name, CJS_KeyValue* pData, CFX_BinaryBuf& sData); private: diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/include/javascript/JS_Object.h index 3b97677fa6..803f6ba35e 100644 --- a/fpdfsdk/include/javascript/JS_Object.h +++ b/fpdfsdk/include/javascript/JS_Object.h @@ -32,8 +32,8 @@ public: operator CJS_Object* (){return m_pJSObject;}; CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc); - int MsgBox(CPDFDoc_Environment * pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle = NULL, FX_UINT nType = 0, FX_UINT nIcon = 0); - void Alert(CJS_Context* pContext, FX_LPCWSTR swMsg); + int MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* swTitle = NULL, FX_UINT nType = 0, FX_UINT nIcon = 0); + void Alert(CJS_Context* pContext, const FX_WCHAR* swMsg); protected: CJS_Object* m_pJSObject; @@ -48,7 +48,7 @@ public: void MakeWeak(); void Dispose(); - virtual FX_BOOL IsType(FX_LPCSTR sClassName){return TRUE;}; + virtual FX_BOOL IsType(const FX_CHAR* sClassName){return TRUE;}; virtual CFX_ByteString GetClassName(){return "";}; virtual FX_BOOL InitInstance(IFXJS_Context* cc){return TRUE;}; @@ -61,8 +61,8 @@ public: CJS_EmbedObj * GetEmbedObject(){return m_pEmbedObj;}; static CPDFSDK_PageView * JSGetPageView(IFXJS_Context* cc); - static int MsgBox(CPDFDoc_Environment * pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle = NULL, FX_UINT nType = 0,FX_UINT nIcon = 0); - static void Alert(CJS_Context* pContext, FX_LPCWSTR swMsg); + static int MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* swTitle = NULL, FX_UINT nType = 0,FX_UINT nIcon = 0); + static void Alert(CJS_Context* pContext, const FX_WCHAR* swMsg); v8::Isolate* GetIsolate() {return m_pIsolate;} protected: diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/include/javascript/JS_Value.h index 245b736cdf..4381bd55a6 100644 --- a/fpdfsdk/include/javascript/JS_Value.h +++ b/fpdfsdk/include/javascript/JS_Value.h @@ -27,8 +27,8 @@ public: CJS_Value(v8::Isolate* isolate, JSFXObject); CJS_Value(v8::Isolate* isolate, CJS_Object*); CJS_Value(v8::Isolate* isolate, CJS_Document*); - CJS_Value(v8::Isolate* isolate, FX_LPCSTR pStr); - CJS_Value(v8::Isolate* isolate, FX_LPCWSTR pWstr); + CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr); + CJS_Value(v8::Isolate* isolate, const FX_WCHAR* pWstr); CJS_Value(v8::Isolate* isolate, CJS_Array& array); ~CJS_Value(); @@ -59,8 +59,8 @@ public: void operator = (v8::Local<v8::Object>); void operator = (CJS_Array &); void operator = (CJS_Date &); - void operator = (FX_LPCWSTR pWstr); - void operator = (FX_LPCSTR pStr); + void operator = (const FX_WCHAR* pWstr); + void operator = (const FX_CHAR* pStr); void operator = (CJS_Value value); FX_BOOL IsArrayObject() const; @@ -111,7 +111,7 @@ public: void operator>>(CFX_ByteString&) const; void operator<<(CFX_WideString); void operator>>(CFX_WideString&) const; - void operator<<(FX_LPCWSTR c_string); + void operator<<(const FX_WCHAR* c_string); void operator<<(JSFXObject); void operator>>(JSFXObject&) const; void operator>>(CJS_Array& array) const; diff --git a/fpdfsdk/include/javascript/PublicMethods.h b/fpdfsdk/include/javascript/PublicMethods.h index 375ae1fcfe..ba38503017 100644 --- a/fpdfsdk/include/javascript/PublicMethods.h +++ b/fpdfsdk/include/javascript/PublicMethods.h @@ -70,23 +70,23 @@ public: static CFX_WideString ParseStringString(const CFX_WideString& string, int nStart, int& nSkip); static double MakeRegularDate(const CFX_WideString & value,const CFX_WideString & format, FX_BOOL& bWrongFormat); static CFX_WideString MakeFormatDate(double dDate,const CFX_WideString & format); - static FX_BOOL ConvertStringToNumber(FX_LPCWSTR swSource, double & dRet, FX_BOOL & bDot); - static double ParseStringToNumber(FX_LPCWSTR swSource); + static FX_BOOL ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot); + static double ParseStringToNumber(const FX_WCHAR* swSource); static double ParseNormalDate(const CFX_WideString & value, FX_BOOL& bWrongFormat); static double MakeInterDate(CFX_WideString strValue); - static double ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS); + static double ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS); public: - static CFX_WideString StrLTrim(FX_LPCWSTR pStr); - static CFX_WideString StrRTrim(FX_LPCWSTR pStr); - static CFX_WideString StrTrim(FX_LPCWSTR pStr); + static CFX_WideString StrLTrim(const FX_WCHAR* pStr); + static CFX_WideString StrRTrim(const FX_WCHAR* pStr); + static CFX_WideString StrTrim(const FX_WCHAR* pStr); - static CFX_ByteString StrLTrim(FX_LPCSTR pStr); - static CFX_ByteString StrRTrim(FX_LPCSTR pStr); - static CFX_ByteString StrTrim(FX_LPCSTR pStr); + static CFX_ByteString StrLTrim(const FX_CHAR* pStr); + static CFX_ByteString StrRTrim(const FX_CHAR* pStr); + static CFX_ByteString StrTrim(const FX_CHAR* pStr); - static FX_BOOL IsNumber(FX_LPCSTR string); - static FX_BOOL IsNumber(FX_LPCWSTR string); + static FX_BOOL IsNumber(const FX_CHAR* string); + static FX_BOOL IsNumber(const FX_WCHAR* string); static FX_BOOL IsDigit(char ch); static FX_BOOL IsDigit(wchar_t ch); @@ -96,7 +96,7 @@ public: static FX_BOOL maskSatisfied(wchar_t c_Change,wchar_t c_Mask); static FX_BOOL isReservedMaskChar(wchar_t ch); - static double AF_Simple(FX_LPCWSTR sFuction, double dValue1, double dValue2); + static double AF_Simple(const FX_WCHAR* sFuction, double dValue1, double dValue2); static CJS_Array AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Value val); }; diff --git a/fpdfsdk/include/javascript/global.h b/fpdfsdk/include/javascript/global.h index fac93d8e5b..3c8972c67c 100644 --- a/fpdfsdk/include/javascript/global.h +++ b/fpdfsdk/include/javascript/global.h @@ -48,9 +48,9 @@ public: FX_BOOL setPersistent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); public: - FX_BOOL QueryProperty(FX_LPCWSTR propname); - FX_BOOL DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue & vp, CFX_WideString & sError); - FX_BOOL DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CFX_WideString & sError); + FX_BOOL QueryProperty(const FX_WCHAR* propname); + FX_BOOL DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue & vp, CFX_WideString & sError); + FX_BOOL DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString & sError); void Initial(CPDFDoc_Environment* pApp); @@ -58,7 +58,7 @@ private: void UpdateGlobalPersistentVariables(); void CommitGlobalPersisitentVariables(); void DestroyGlobalPersisitentVariables(); - FX_BOOL SetGlobalVariables(FX_LPCSTR propname, int nType, + FX_BOOL SetGlobalVariables(const FX_CHAR* propname, int nType, double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent); void ObjectToArray(v8::Local<v8::Object> pObj, CJS_GlobalVariableArray& array); diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h index 7abdeeffce..b82330c6b9 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h @@ -77,9 +77,9 @@ public: void SetFillerNotify(IPWL_Filler_Notify* pNotify); CFX_WideString GetText() const; - void SetText(FX_LPCWSTR text); + void SetText(const FX_WCHAR* text); - void AddString(FX_LPCWSTR string); + void AddString(const FX_WCHAR* string); int32_t GetSelect() const; void SetSelect(int32_t nItemIndex); diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h index 93db6f09bd..81500e90ad 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Edit.h +++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h @@ -81,8 +81,8 @@ public: virtual void PasteText(); virtual void CutText(); - virtual void SetText(FX_LPCWSTR csText); - void ReplaceSel(FX_LPCWSTR csText); + virtual void SetText(const FX_WCHAR* csText); + void ReplaceSel(const FX_WCHAR* csText); CFX_ByteString GetTextAppearanceStream(const CPDF_Point & ptOffset) const; CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset) const; diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h index 2eb779ddc8..bfa1868b9e 100644 --- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h +++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h @@ -81,7 +81,7 @@ public: virtual FX_FLOAT GetFontSize() const; public: - virtual void SetText(FX_LPCWSTR csText); + virtual void SetText(const FX_WCHAR* csText); virtual void CopyText(); virtual void PasteText(); @@ -131,7 +131,7 @@ protected: virtual void InsertWord(FX_WORD word, int32_t nCharset); virtual void InsertReturn(); - virtual void InsertText(FX_LPCWSTR csText); + virtual void InsertText(const FX_WCHAR* csText); virtual void SetCursor(); FX_BOOL IsWndHorV(); diff --git a/fpdfsdk/include/pdfwindow/PWL_FontMap.h b/fpdfsdk/include/pdfwindow/PWL_FontMap.h index 4f44660cb2..f83575b66f 100644 --- a/fpdfsdk/include/pdfwindow/PWL_FontMap.h +++ b/fpdfsdk/include/pdfwindow/PWL_FontMap.h @@ -72,7 +72,7 @@ public: virtual int32_t CharSetFromUnicode(FX_WORD word, int32_t nOldCharset); public: - virtual void Initial(FX_LPCSTR fontname = NULL); + virtual void Initial(const FX_CHAR* fontname = NULL); void SetSystemHandler(IFX_SystemHandler* pSystemHandler); int32_t GetFontMapCount() const; diff --git a/fpdfsdk/include/pdfwindow/PWL_Icon.h b/fpdfsdk/include/pdfwindow/PWL_Icon.h index c09f7a9fe8..1a2adf6469 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Icon.h +++ b/fpdfsdk/include/pdfwindow/PWL_Icon.h @@ -27,7 +27,7 @@ public: void GetImageSize(FX_FLOAT & fWidth,FX_FLOAT & fHeight); CPDF_Matrix GetImageMatrix(); CFX_ByteString GetImageAlias(); - void SetImageAlias(FX_LPCSTR sImageAlias); + void SetImageAlias(const FX_CHAR* sImageAlias); protected: CPDF_Stream* m_pPDFStream; diff --git a/fpdfsdk/include/pdfwindow/PWL_Label.h b/fpdfsdk/include/pdfwindow/PWL_Label.h index be083db486..6d9754dd80 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Label.h +++ b/fpdfsdk/include/pdfwindow/PWL_Label.h @@ -21,7 +21,7 @@ public: virtual void SetFontSize(FX_FLOAT fFontSize); virtual FX_FLOAT GetFontSize() const; - void SetText(FX_LPCWSTR csText); + void SetText(const FX_WCHAR* csText); CFX_WideString GetText() const; void SetLimitChar(int32_t nLimitChar); void SetHorzScale(int32_t nHorzScale); diff --git a/fpdfsdk/include/pdfwindow/PWL_ListBox.h b/fpdfsdk/include/pdfwindow/PWL_ListBox.h index c5a6df76dd..bbb9f35125 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ListBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ListBox.h @@ -59,7 +59,7 @@ public: virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void RePosChildWnd(); - virtual void SetText(FX_LPCWSTR csText,FX_BOOL bRefresh = TRUE); + virtual void SetText(const FX_WCHAR* csText,FX_BOOL bRefresh = TRUE); virtual CFX_WideString GetText() const; virtual CPDF_Rect GetFocusRect() const; virtual void SetFontSize(FX_FLOAT fFontSize); @@ -67,7 +67,7 @@ public: void OnNotifySelChanged(FX_BOOL bKeyDown, FX_BOOL & bExit , FX_DWORD nFlag); - void AddString(FX_LPCWSTR string); + void AddString(const FX_WCHAR* string); 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 a9e6dda05b..ee6ec6ff02 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Note.h +++ b/fpdfsdk/include/pdfwindow/PWL_Note.h @@ -145,7 +145,7 @@ public: FX_FLOAT GetItemLeftMargin(); FX_FLOAT GetItemRightMargin(); - virtual void SetText(FX_LPCWSTR csText); + virtual void SetText(const FX_WCHAR* csText); protected: virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); diff --git a/fpdfsdk/include/pdfwindow/PWL_Signature.h b/fpdfsdk/include/pdfwindow/PWL_Signature.h index bdc1406a3d..be5ec58d1f 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Signature.h +++ b/fpdfsdk/include/pdfwindow/PWL_Signature.h @@ -38,10 +38,10 @@ public: CPWL_Signature(); virtual ~CPWL_Signature(); - void SetText(FX_LPCWSTR sText); - void SetDescription(FX_LPCWSTR string); + void SetText(const FX_WCHAR* sText); + void SetDescription(const FX_WCHAR* string); void SetImage(CFX_DIBSource* pImage); - void SetImageStream(CPDF_Stream * pStream, FX_LPCSTR sImageAlias); + void SetImageStream(CPDF_Stream * pStream, const FX_CHAR* sImageAlias); void SetTextFlag(FX_BOOL bTextExist); void SetImageFlag(FX_BOOL bImageExist); diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h index 970480f14a..9f089e6fa4 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h +++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h @@ -173,8 +173,8 @@ class IPWL_SpellCheck { public: virtual ~IPWL_SpellCheck() { } - virtual FX_BOOL CheckWord(FX_LPCSTR sWord) = 0; - virtual void SuggestWords(FX_LPCSTR sWord, CFX_ByteStringArray & sSuggest) = 0; + virtual FX_BOOL CheckWord(const FX_CHAR* sWord) = 0; + virtual void SuggestWords(const FX_CHAR* sWord, CFX_ByteStringArray & sSuggest) = 0; }; class IPWL_Provider diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index d73fbf45b0..abe30d85af 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -43,7 +43,7 @@ void CBA_FontMap::Reset() m_sDefaultFontName = ""; } -void CBA_FontMap::Initial(FX_LPCSTR fontname) +void CBA_FontMap::Initial(const FX_CHAR* fontname) { int32_t nCharset = DEFAULT_CHARSET; diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp index a87ebecf90..d0f0a4ac90 100644 --- a/fpdfsdk/src/fpdf_dataavail.cpp +++ b/fpdfsdk/src/fpdf_dataavail.cpp @@ -53,7 +53,7 @@ public: virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { - return m_pFileAccess->m_GetBlock(m_pFileAccess->m_Param, offset, (FX_LPBYTE)buffer, size); + return m_pFileAccess->m_GetBlock(m_pFileAccess->m_Param, offset, (uint8_t*)buffer, size); } virtual void Release() diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp index 6d846dfb67..c258b93c7d 100644 --- a/fpdfsdk/src/fpdf_ext.cpp +++ b/fpdfsdk/src/fpdf_ext.cpp @@ -29,7 +29,7 @@ void CFSDK_UnsupportInfo_Adapter::ReportError(int nErrorType) } } -void FreeUnsupportInfo(FX_LPVOID pData) +void FreeUnsupportInfo(void* pData) { CFSDK_UnsupportInfo_Adapter * pAdapter = (CFSDK_UnsupportInfo_Adapter *)pData; delete pAdapter; diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp index 3dd768742f..742aeda72f 100644 --- a/fpdfsdk/src/fpdf_flatten.cpp +++ b/fpdfsdk/src/fpdf_flatten.cpp @@ -220,7 +220,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* CFX_ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); - pNewContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE); + pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE); } return; } @@ -238,9 +238,9 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* CPDF_StreamAcc acc; acc.LoadAllData(pContents); CFX_ByteString sStream = "q\n"; - CFX_ByteString sBody = CFX_ByteString((FX_LPCSTR)acc.GetData(), acc.GetSize()); + CFX_ByteString sBody = CFX_ByteString((const FX_CHAR*)acc.GetData(), acc.GetSize()); sStream = sStream + sBody + "\nQ"; - pContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE); + pContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE); pContentsArray->AddReference(pDocument, dwObjNum); break; } @@ -267,7 +267,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* CFX_ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); - pNewContents->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE); + pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE); } } @@ -529,7 +529,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) CPDF_StreamAcc acc; acc.LoadAllData(pNewXObject); - FX_LPCBYTE pData = acc.GetData(); + const uint8_t* pData = acc.GetData(); CFX_ByteString sStream(pData, acc.GetSize()); CFX_ByteString sTemp; @@ -547,7 +547,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, sFormName.c_str()); sStream += sTemp; - pNewXObject->SetData((FX_LPCBYTE)sStream, sStream.GetLength(), FALSE, FALSE); + pNewXObject->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE); } pPageDict->RemoveAt( "Annots" ); diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp index 4d77794768..c1c6417ca6 100644 --- a/fpdfsdk/src/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp @@ -29,21 +29,21 @@ public: return FALSE; } - virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, FX_LPCSTR family, FX_BOOL& bExact) override + virtual void* MapFont(int weight, FX_BOOL bItalic, int charset, int pitch_family, const FX_CHAR* family, FX_BOOL& bExact) override { if (m_pInfo->MapFont) return m_pInfo->MapFont(m_pInfo, weight, bItalic, charset, pitch_family, family, &bExact); return NULL; } - virtual void* GetFont(FX_LPCSTR family) override + virtual void* GetFont(const FX_CHAR* family) override { if (m_pInfo->GetFont) return m_pInfo->GetFont(m_pInfo, family); return NULL; } - virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, FX_LPBYTE buffer, FX_DWORD size) override + virtual FX_DWORD GetFontData(void* hFont, FX_DWORD table, uint8_t* buffer, FX_DWORD size) override { if (m_pInfo->GetFontData) return m_pInfo->GetFontData(m_pInfo, hFont, table, buffer, size); diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp index 592b5f4e64..a6caf78e6e 100644 --- a/fpdfsdk/src/fpdf_transformpage.cpp +++ b/fpdfsdk/src/fpdf_transformpage.cpp @@ -119,9 +119,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX return FALSE; pDoc->AddIndirectObject(pStream); - pDic = FX_NEW CPDF_Dictionary; - CPDF_Stream* pEndStream = FX_NEW CPDF_Stream(NULL,0, pDic); - pEndStream->SetData((FX_LPCBYTE)" Q", 2, FALSE, FALSE); + pDic = new CPDF_Dictionary; + CPDF_Stream* pEndStream = new CPDF_Stream(NULL,0, pDic); + pEndStream->SetData((const uint8_t*)" Q", 2, FALSE, FALSE); pDoc->AddIndirectObject(pEndStream); CPDF_Array* pContentArray = NULL; diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index d662699dbf..e874e815e1 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -161,7 +161,7 @@ DLLEXPORT unsigned long STDCALL FPDFDest_GetPageIndex(FPDF_DOCUMENT document, FP return dest.GetPageIndex(pDoc); } -static void ReleaseLinkList(FX_LPVOID data) +static void ReleaseLinkList(void* data) { delete (CPDF_LinkList*)data; } diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index 0ae2237d29..e4b7de4426 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -529,7 +529,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE int real_size = len < *size ? len : *size; if (real_size > 0) - FXSYS_memcpy((void*)bsText, (FX_LPCSTR)(sSuggestWords[index]), real_size); + FXSYS_memcpy((void*)bsText, (const FX_CHAR*)(sSuggestWords[index]), real_size); *size = real_size; return TRUE; diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp index 5c66e4bb69..3e8de3fe42 100644 --- a/fpdfsdk/src/fpdfppo.cpp +++ b/fpdfsdk/src/fpdfppo.cpp @@ -179,7 +179,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* FX_DWORD dwOldPageObj = pSrcPageDict->GetObjNum(); FX_DWORD dwNewPageObj = pCurPageDict->GetObjNum(); - pMapPtrToPtr->SetAt((FX_LPVOID)(uintptr_t)dwOldPageObj, (FX_LPVOID)(uintptr_t)dwNewPageObj); + pMapPtrToPtr->SetAt((void*)(uintptr_t)dwOldPageObj, (void*)(uintptr_t)dwNewPageObj); this->UpdateReference(pCurPageDict, pDestPDFDoc, pMapPtrToPtr); curpage++; @@ -302,7 +302,7 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt size_t dwNewObjNum = 0; - pMapPtrToPtr->Lookup((FX_LPVOID)dwObjnum, (FX_LPVOID&)dwNewObjNum); + pMapPtrToPtr->Lookup((void*)dwObjnum, (void*&)dwNewObjNum); if(dwNewObjNum) { return (int)dwNewObjNum; @@ -340,7 +340,7 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt } } dwNewObjNum = pDoc->AddIndirectObject(pClone);//, onum, gnum); - pMapPtrToPtr->SetAt((FX_LPVOID)dwObjnum, (FX_LPVOID)dwNewObjNum); + pMapPtrToPtr->SetAt((void*)dwObjnum, (void*)dwNewObjNum); if(!UpdateReference(pClone, pDoc, pMapPtrToPtr)) { diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp index db9e289d9e..34cf381555 100644 --- a/fpdfsdk/src/fpdfsave.cpp +++ b/fpdfsdk/src/fpdfsave.cpp @@ -124,7 +124,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList CPDF_Stream *pTemplateStream = pArray->GetStream(iTemplate); CPDF_StreamAcc streamAcc; streamAcc.LoadAllData(pTemplateStream); - FX_LPBYTE pData = (FX_LPBYTE)streamAcc.GetData(); + uint8_t* pData = (uint8_t*)streamAcc.GetData(); FX_DWORD dwSize2 = streamAcc.GetSize(); IFX_FileStream *pTemplate = FX_CreateMemoryStream(pData, dwSize2); pContext->UpdateChecksum((IFX_FileRead*)pTemplate); diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index fa6bb2ef53..a86d54f3af 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -120,7 +120,7 @@ FX_BOOL CPDF_CustomAccess::GetByte(FX_DWORD pos, uint8_t& ch) return TRUE; } -FX_BOOL CPDF_CustomAccess::GetBlock(FX_DWORD pos, FX_LPBYTE pBuf, FX_DWORD size) +FX_BOOL CPDF_CustomAccess::GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size) { if (pos + size > m_FileAccess.m_FileLen) return FALSE; return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, pos, pBuf, size); @@ -136,7 +136,7 @@ FX_BOOL CPDF_CustomAccess::ReadBlock(void* buffer, FX_FILESIZE offset, size_t si if (!newPos.IsValid() || newPos.ValueOrDie() > m_FileAccess.m_FileLen) { return FALSE; } - return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, offset,(FX_LPBYTE) buffer, size); + return m_FileAccess.m_GetBlock(m_FileAccess.m_Param, offset,(uint8_t*) buffer, size); } //0 bit: FPDF_POLICY_MACHINETIME_ACCESS @@ -245,7 +245,7 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_LoadDocument(FPDF_STRING file_path, FPDF_BY CPDF_Parser* pParser = FX_NEW CPDF_Parser; pParser->SetPassword(password); - FX_DWORD err_code = pParser->StartParse((FX_LPCSTR)file_path); + FX_DWORD err_code = pParser->StartParse((const FX_CHAR*)file_path); if (err_code) { delete pParser; ProcessParseError(err_code); @@ -560,9 +560,9 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int #endif // Create a device with this external buffer - pContext->m_pBitmap = FX_NEW CFX_DIBitmap; - pContext->m_pBitmap->Create(width, height, FXDIB_Rgb, (FX_LPBYTE)pBuffer); - pContext->m_pDevice = FX_NEW CPDF_FxgeDevice; + pContext->m_pBitmap = new CFX_DIBitmap; + pContext->m_pBitmap->Create(width, height, FXDIB_Rgb, (uint8_t*)pBuffer); + pContext->m_pDevice = new CPDF_FxgeDevice; ((CPDF_FxgeDevice*)pContext->m_pDevice)->Attach(pContext->m_pBitmap); #ifdef DEBUG_TRACE @@ -649,15 +649,9 @@ DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, DLLEXPORT void STDCALL FPDF_ClosePage(FPDF_PAGE page) { if (!page) return; + CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; - pPage->Release(); -// CPDFXFA_Document* pDoc = pPage->GetDocument(); -// if (pDoc) { -// pDoc->RemovePage(pPage); -// } -// delete (CPDFXFA_Page*)page; - } DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document) @@ -727,8 +721,8 @@ DLLEXPORT FPDF_BITMAP STDCALL FPDFBitmap_CreateEx(int width, int height, int for default: return NULL; } - CFX_DIBitmap* pBitmap = FX_NEW CFX_DIBitmap; - pBitmap->Create(width, height, fx_format, (FX_LPBYTE)first_scan, stride); + CFX_DIBitmap* pBitmap = new CFX_DIBitmap; + pBitmap->Create(width, height, fx_format, (uint8_t*)first_scan, stride); return pBitmap; } diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index 106e3cbc12..c1f402e393 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -573,7 +573,7 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView, FX_DWORD dwFlags) }
}
-void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, FX_LPVOID pParam, FX_LPVOID pAdditional)
+void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget, CXFA_WidgetAcc* pWidgetData, FX_DWORD dwEvent, void* pParam, void* pAdditional)
{
if (m_iDocType != DOCTYPE_DYNIMIC_XFA || NULL == hWidget)
return;
@@ -745,7 +745,7 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath, FX_BOOL bX if (fileType == FXFA_SAVEAS_XML)
{
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
- fileWrite.WriteBlock((FX_LPCSTR)content, fileWrite.GetSize(), content.GetLength());
+ fileWrite.WriteBlock((const FX_CHAR*)content, fileWrite.GetSize(), content.GetLength());
CFX_WideStringC data(L"data");
if( pXFADocHander->SavePackage(m_pXFADocView->GetDoc(),data, &fileWrite))
{
@@ -755,7 +755,7 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath, FX_BOOL bX /*else if (fileType == FXFA_FILE_STATIC_XDP)
{
content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
- fileWrite.WriteBlock((FX_LPCSTR)content, fileWrite.GetSize(), content.GetLength());
+ fileWrite.WriteBlock((const FX_CHAR*)content, fileWrite.GetSize(), content.GetLength());
CFX_WideStringC data(L"data");
if( pXFADocHander->SavePackage(m_pXFADocView->GetDoc(), data, &fileWrite))
{
@@ -766,8 +766,8 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath, FX_BOOL bX // wPath.FromUTF16LE(filePath);
CFX_ByteString bPath = wPath.UTF8Encode();
CFX_ByteString szFormat = "\n<pdf href=\"%s\" xmlns=\"http://ns.adobe.com/xdp/pdf/\"/>";
- content.Format(szFormat,(char*)(FX_LPCSTR)bPath);
- fileWrite.WriteBlock((FX_LPCSTR)content,fileWrite.GetSize(), content.GetLength());
+ content.Format(szFormat,(char*)(const FX_CHAR*)bPath);
+ fileWrite.WriteBlock((const FX_CHAR*)content,fileWrite.GetSize(), content.GetLength());
}
*/
else if (fileType == FXFA_SAVEAS_XDP)
@@ -817,11 +817,11 @@ void CPDFXFA_Document::ExportData(IXFA_Doc* hDoc, FX_WSTR wsFilePath, FX_BOOL bX if (i == size-1)
{
//CFX_WideString wPath = pEnv->FFI_GetFilePath(pFileHandler);
- CFX_WideString wPath = CFX_WideString::FromUTF16LE((unsigned short*)(FX_LPCSTR)bs, bs.GetLength()/sizeof(unsigned short));
+ CFX_WideString wPath = CFX_WideString::FromUTF16LE((unsigned short*)(const FX_CHAR*)bs, bs.GetLength()/sizeof(unsigned short));
CFX_ByteString bPath = wPath.UTF8Encode();
CFX_ByteString szFormat = "\n<pdf href=\"%s\" xmlns=\"http://ns.adobe.com/xdp/pdf/\"/>";
- content.Format(szFormat,(char*)(FX_LPCSTR)bPath);
- fileWrite.WriteBlock((FX_LPCSTR)content,fileWrite.GetSize(), content.GetLength());
+ content.Format(szFormat,(char*)(const FX_CHAR*)bPath);
+ fileWrite.WriteBlock((const FX_CHAR*)content,fileWrite.GetSize(), content.GetLength());
}
CPDF_Stream* pStream = (CPDF_Stream*)pDirectObj;
@@ -1085,7 +1085,7 @@ FX_BOOL CPDFXFA_Document::_ExportSubmitFile(FPDF_FILEHANDLER* pFileHandler, int CFX_WideString ws;
ws.FromLocal("data");
CFX_ByteString content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n";
- fileStream.WriteBlock((FX_LPCSTR)content,0,content.GetLength());
+ fileStream.WriteBlock((const FX_CHAR*)content,0,content.GetLength());
pDocHandler->SavePackage(m_pXFADoc, ws, &fileStream);
}
else if (fileType == FXFA_SAVEAS_XDP)
diff --git a/fpdfsdk/src/fsdk_actionhandler.cpp b/fpdfsdk/src/fsdk_actionhandler.cpp index 25f39ff8c7..d4276866d3 100644 --- a/fpdfsdk/src/fsdk_actionhandler.cpp +++ b/fpdfsdk/src/fsdk_actionhandler.cpp @@ -599,8 +599,9 @@ void CPDFSDK_ActionHandler::DoAction_URI(CPDFSDK_Document* pDocument, const CPDF CPDFDoc_Environment* pApp = pDocument->GetEnv(); ASSERT(pApp != NULL); + CFX_ByteString sURI = action.GetURI(pDocument->GetDocument()->GetPDFDoc()); - pApp->FFI_DoURIAction(FX_LPCSTR(sURI)); + pApp->FFI_DoURIAction(sURI.c_str()); } void CPDFSDK_ActionHandler::DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action) diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index 5f9df4852b..037339f4ff 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -986,7 +986,7 @@ void CPDFSDK_Widget::ResetAppearance(FX_BOOL bValueChanged) } } -void CPDFSDK_Widget::ResetAppearance(FX_LPCWSTR sValue, FX_BOOL bValueChanged) +void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChanged) { SetAppModified(); @@ -1661,7 +1661,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() SetAppState("Off"); } -void CPDFSDK_Widget::ResetAppearance_ComboBox(FX_LPCWSTR sValue) +void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) { CPDF_FormControl* pControl = GetFormControl(); ASSERT(pControl != NULL); @@ -1835,7 +1835,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() WriteAppearance("N", GetRotatedRect(), GetMatrix(), sAP); } -void CPDFSDK_Widget::ResetAppearance_TextField(FX_LPCWSTR sValue) +void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) { CPDF_FormControl* pControl = GetFormControl(); ASSERT(pControl != NULL); @@ -2810,7 +2810,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, int nComm return sValue; } -void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, FX_LPCWSTR sValue, FX_BOOL bValueChanged) +void CPDFSDK_InterForm::ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, FX_BOOL bValueChanged) { ASSERT(pFormField != NULL); @@ -3023,7 +3023,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, con CFX_ByteTextBuf textBuf; ExportFieldsToFDFTextBuf(fields, bIncludeOrExclude, textBuf); - FX_LPBYTE pBuffer = textBuf.GetBuffer(); + uint8_t* pBuffer = textBuf.GetBuffer(); FX_STRSIZE nBufSize = textBuf.GetLength(); if (bUrlEncoded) @@ -3078,7 +3078,7 @@ FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_Wid return TRUE; } -FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(FX_LPBYTE& pBuf, FX_STRSIZE& nBufSize) +FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize) { CFDF_Document* pFDF = CFDF_Document::ParseMemory(pBuf, nBufSize); if (pFDF) @@ -3178,7 +3178,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOO delete pFDFDoc; if (!bRet) return FALSE; - FX_LPBYTE pBuffer = FdfBuffer.GetBuffer(); + uint8_t* pBuffer = FdfBuffer.GetBuffer(); FX_STRSIZE nBufSize = FdfBuffer.GetLength(); if (bUrlEncoded) diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index dc454ee160..4f457bd86a 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -614,7 +614,6 @@ CPDFSDK_PageView::CPDFSDK_PageView(CPDFSDK_Document* pSDKDoc,CPDFXFA_Page* page) if (page->GetPDFPage()) pPDFInterForm->FixPageFields(page->GetPDFPage()); } - m_fxAnnotArray.RemoveAll(); m_bEnterWidget = FALSE; @@ -838,7 +837,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(CPDF_Dictionary * pDict) return NULL; } -CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(FX_LPCSTR lpSubType,CPDF_Dictionary * pDict) +CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(const FX_CHAR* lpSubType,CPDF_Dictionary * pDict) { return NULL; } @@ -1211,7 +1210,7 @@ int CPDFSDK_PageView::GetPageIndex() return -1; } -FX_BOOL CPDFSDK_PageView::IsValidAnnot(FX_LPVOID p) +FX_BOOL CPDFSDK_PageView::IsValidAnnot(void* p) { if (p == NULL) return FALSE; int iCount = m_pAnnotList->Count(); diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp index 9415cefbe3..b45fc69780 100644 --- a/fpdfsdk/src/fxedit/fxet_edit.cpp +++ b/fpdfsdk/src/fxedit/fxet_edit.cpp @@ -1921,7 +1921,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place return FALSE; } -void CFX_Edit::SetText(FX_LPCWSTR text,int32_t charset /*= DEFAULT_CHARSET*/, +void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/) { SetText(text,charset,pSecProps,pWordProps,TRUE,TRUE); @@ -1952,7 +1952,7 @@ FX_BOOL CFX_Edit::Clear() return Clear(TRUE,TRUE); } -FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, int32_t charset /*= DEFAULT_CHARSET*/, +FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset /*= DEFAULT_CHARSET*/, const CPVT_SecProps * pSecProps /*= NULL*/,const CPVT_WordProps * pWordProps /*= NULL*/) { return InsertText(text,charset,pSecProps,pWordProps,TRUE,TRUE); @@ -2962,7 +2962,7 @@ void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) } } -void CFX_Edit::SetText(FX_LPCWSTR text,int32_t charset, +void CFX_Edit::SetText(const FX_WCHAR* text,int32_t charset, const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) { Empty(); @@ -3264,7 +3264,7 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) return FALSE; } -FX_BOOL CFX_Edit::InsertText(FX_LPCWSTR text, int32_t charset, +FX_BOOL CFX_Edit::InsertText(const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) { if (IsTextOverflow()) return FALSE; @@ -3510,7 +3510,7 @@ FX_FLOAT CFX_Edit::GetLineBottom(const CPVT_WordPlace& place) const return 0.0f; } -CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, FX_LPCWSTR text, int32_t charset, +CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, const FX_WCHAR* text, int32_t charset, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps) { CPVT_WordPlace wp = place; diff --git a/fpdfsdk/src/fxedit/fxet_list.cpp b/fpdfsdk/src/fxedit/fxet_list.cpp index 03b23020b4..6d48b30269 100644 --- a/fpdfsdk/src/fxedit/fxet_list.cpp +++ b/fpdfsdk/src/fxedit/fxet_list.cpp @@ -76,7 +76,7 @@ void CFX_ListItem::SetCaret(FX_BOOL bCaret) m_bCaret = bCaret; } -void CFX_ListItem::SetText(FX_LPCWSTR text) +void CFX_ListItem::SetText(const FX_WCHAR* text) { if (m_pEdit) m_pEdit->SetText(text); @@ -146,7 +146,7 @@ void CFX_List::SetFontSize(FX_FLOAT fFontSize) m_fFontSize = fFontSize; } -void CFX_List::AddItem(FX_LPCWSTR str) +void CFX_List::AddItem(const FX_WCHAR* str) { if (CFX_ListItem * pListItem = new CFX_ListItem()) { @@ -733,7 +733,7 @@ CPDF_Rect CFX_ListCtrl::GetItemRect(int32_t nIndex) const return InToOut(CFX_List::GetItemRect(nIndex)); } -void CFX_ListCtrl::AddString(FX_LPCWSTR string) +void CFX_ListCtrl::AddString(const FX_WCHAR* string) { AddItem(string); ReArrange(GetCount() - 1); diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp index 1b1c8babcb..cea9f9a4c9 100644 --- a/fpdfsdk/src/javascript/Consts.cpp +++ b/fpdfsdk/src/javascript/Consts.cpp @@ -151,14 +151,14 @@ int CJS_GlobalConsts::Init(IJS_Runtime* pRuntime) int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime) { { - FX_LPCWSTR ArrayName = L"RE_NUMBER_ENTRY_DOT_SEP"; - FX_LPCWSTR ArrayContent[] = {L"[+-]?\\d*\\.?\\d*"}; + const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_DOT_SEP"; + const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*\\.?\\d*"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = L"RE_NUMBER_COMMIT_DOT_SEP"; - FX_LPCWSTR ArrayContent[] = { L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */ + const FX_WCHAR* ArrayName = L"RE_NUMBER_COMMIT_DOT_SEP"; + const FX_WCHAR* ArrayContent[] = { L"[+-]?\\d+(\\.\\d+)?", /* -1.0 or -1 */ L"[+-]?\\.\\d+", /* -.1 */ L"[+-]?\\d+\\." /* -1. */ }; @@ -166,15 +166,15 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime) } { - FX_LPCWSTR ArrayName = L"RE_NUMBER_ENTRY_COMMA_SEP"; - FX_LPCWSTR ArrayContent[] = {L"[+-]?\\d*,?\\d*"}; + const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_COMMA_SEP"; + const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*,?\\d*"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = L"RE_NUMBER_COMMIT_COMMA_SEP"; - FX_LPCWSTR ArrayContent[] = { L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */ + const FX_WCHAR* ArrayName = L"RE_NUMBER_COMMIT_COMMA_SEP"; + const FX_WCHAR* ArrayContent[] = { L"[+-]?\\d+([.,]\\d+)?", /* -1,0 or -1 */ L"[+-]?[.,]\\d+", /* -,1 */ L"[+-]?\\d+[.,]" /* -1, */ }; @@ -182,32 +182,32 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime) } { - FX_LPCWSTR ArrayName = L"RE_ZIP_ENTRY"; - FX_LPCWSTR ArrayContent[] = {L"\\d{0,5}"}; + const FX_WCHAR* ArrayName = L"RE_ZIP_ENTRY"; + const FX_WCHAR* ArrayContent[] = {L"\\d{0,5}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = L"RE_ZIP_COMMIT"; - FX_LPCWSTR ArrayContent[] = {L"\\d{5}"}; + const FX_WCHAR* ArrayName = L"RE_ZIP_COMMIT"; + const FX_WCHAR* ArrayContent[] = {L"\\d{5}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = L"RE_ZIP4_ENTRY"; - FX_LPCWSTR ArrayContent[] = {L"\\d{0,5}(\\.|[- ])?\\d{0,4}"}; + const FX_WCHAR* ArrayName = L"RE_ZIP4_ENTRY"; + const FX_WCHAR* ArrayContent[] = {L"\\d{0,5}(\\.|[- ])?\\d{0,4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = L"RE_ZIP4_COMMIT"; - FX_LPCWSTR ArrayContent[] = {L"\\d{5}(\\.|[- ])?\\d{4}"}; + const FX_WCHAR* ArrayName = L"RE_ZIP4_COMMIT"; + const FX_WCHAR* ArrayContent[] = {L"\\d{5}(\\.|[- ])?\\d{4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = L"RE_PHONE_ENTRY"; - FX_LPCWSTR ArrayContent[] = { + const FX_WCHAR* ArrayName = L"RE_PHONE_ENTRY"; + const FX_WCHAR* ArrayContent[] = { L"\\d{0,3}(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* 555-1234 or 408 555-1234 */ L"\\(\\d{0,3}", /* (408 */ L"\\(\\d{0,3}\\)(\\.|[- ])?\\d{0,3}(\\.|[- ])?\\d{0,4}", /* (408) 555-1234 */ @@ -220,8 +220,8 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime) } { - FX_LPCWSTR ArrayName = L"RE_PHONE_COMMIT"; - FX_LPCWSTR ArrayContent[] = { + const FX_WCHAR* ArrayName = L"RE_PHONE_COMMIT"; + const FX_WCHAR* ArrayContent[] = { L"\\d{3}(\\.|[- ])?\\d{4}", /* 555-1234 */ L"\\d{3}(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* 408 555-1234 */ L"\\(\\d{3}\\)(\\.|[- ])?\\d{3}(\\.|[- ])?\\d{4}", /* (408) 555-1234 */ @@ -231,14 +231,14 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime) } { - FX_LPCWSTR ArrayName = L"RE_SSN_ENTRY"; - FX_LPCWSTR ArrayContent[] = {L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"}; + const FX_WCHAR* ArrayName = L"RE_SSN_ENTRY"; + const FX_WCHAR* ArrayContent[] = {L"\\d{0,3}(\\.|[- ])?\\d{0,2}(\\.|[- ])?\\d{0,4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } { - FX_LPCWSTR ArrayName = L"RE_SSN_COMMIT"; - FX_LPCWSTR ArrayContent[] = {L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"}; + const FX_WCHAR* ArrayName = L"RE_SSN_COMMIT"; + const FX_WCHAR* ArrayContent[] = {L"\\d{3}(\\.|[- ])?\\d{2}(\\.|[- ])?\\d{4}"}; DEFINE_GLOBAL_ARRAY(pRuntime); } diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp index cf59ed9c86..fe4f6b2d4c 100644 --- a/fpdfsdk/src/javascript/JS_EventHandler.cpp +++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp @@ -461,7 +461,7 @@ FX_BOOL CJS_EventHandler::Modifier() return m_bModifier; } -FX_LPCWSTR CJS_EventHandler::Name() +const FX_WCHAR* CJS_EventHandler::Name() { switch (m_eEventType) { @@ -509,7 +509,7 @@ FX_LPCWSTR CJS_EventHandler::Name() return L""; } -FX_LPCWSTR CJS_EventHandler::Type() +const FX_WCHAR* CJS_EventHandler::Type() { switch (m_eEventType) { diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp index c4166762ee..0fa2189453 100644 --- a/fpdfsdk/src/javascript/JS_GlobalData.cpp +++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp @@ -138,7 +138,7 @@ CJS_GlobalData::~CJS_GlobalData() m_arrayGlobalData.RemoveAll(); } -int CJS_GlobalData::FindGlobalVariable(FX_LPCSTR propname) +int CJS_GlobalData::FindGlobalVariable(const FX_CHAR* propname) { ASSERT(propname != NULL); @@ -157,7 +157,7 @@ int CJS_GlobalData::FindGlobalVariable(FX_LPCSTR propname) return nRet; } -CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(FX_LPCSTR propname) +CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(const FX_CHAR* propname) { ASSERT(propname != NULL); @@ -169,7 +169,7 @@ CJS_GlobalData_Element* CJS_GlobalData::GetGlobalVariable(FX_LPCSTR propname) return NULL; } -void CJS_GlobalData::SetGlobalVariableNumber(FX_LPCSTR propname, double dData) +void CJS_GlobalData::SetGlobalVariableNumber(const FX_CHAR* propname, double dData) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -195,7 +195,7 @@ void CJS_GlobalData::SetGlobalVariableNumber(FX_LPCSTR propname, double dData) } } -void CJS_GlobalData::SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData) +void CJS_GlobalData::SetGlobalVariableBoolean(const FX_CHAR* propname, bool bData) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -221,7 +221,7 @@ void CJS_GlobalData::SetGlobalVariableBoolean(FX_LPCSTR propname, bool bData) } } -void CJS_GlobalData::SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteString& sData) +void CJS_GlobalData::SetGlobalVariableString(const FX_CHAR* propname, const CFX_ByteString& sData) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -247,7 +247,7 @@ void CJS_GlobalData::SetGlobalVariableString(FX_LPCSTR propname, const CFX_ByteS } } -void CJS_GlobalData::SetGlobalVariableObject(FX_LPCSTR propname, const CJS_GlobalVariableArray& array) +void CJS_GlobalData::SetGlobalVariableObject(const FX_CHAR* propname, const CJS_GlobalVariableArray& array) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -273,7 +273,7 @@ void CJS_GlobalData::SetGlobalVariableObject(FX_LPCSTR propname, const CJS_Globa } } -void CJS_GlobalData::SetGlobalVariableNull(FX_LPCSTR propname) +void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -297,7 +297,7 @@ void CJS_GlobalData::SetGlobalVariableNull(FX_LPCSTR propname) } } -FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL bPersistent) +FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(const FX_CHAR* propname, FX_BOOL bPersistent) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -316,7 +316,7 @@ FX_BOOL CJS_GlobalData::SetGlobalVariablePersistent(FX_LPCSTR propname, FX_BOOL return FALSE; } -FX_BOOL CJS_GlobalData::DeleteGlobalVariable(FX_LPCSTR propname) +FX_BOOL CJS_GlobalData::DeleteGlobalVariable(const FX_CHAR* propname) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; @@ -350,7 +350,7 @@ CJS_GlobalData_Element* CJS_GlobalData::GetAt(int index) const void CJS_GlobalData::LoadGlobalPersistentVariables() { - FX_LPBYTE pBuffer = NULL; + uint8_t* pBuffer = NULL; int32_t nLength = 0; LoadFileBuffer(m_sFilePath.c_str(), pBuffer, nLength); @@ -358,7 +358,7 @@ void CJS_GlobalData::LoadGlobalPersistentVariables() if (pBuffer) { - FX_LPBYTE p = pBuffer; + uint8_t* p = pBuffer; FX_WORD wType = *((FX_WORD*)p); p += sizeof(FX_WORD); @@ -508,15 +508,15 @@ void CJS_GlobalData::SaveGlobalPersisitentVariables() sFile.AppendBlock(sData.GetBuffer(), sData.GetSize()); CRYPT_ArcFourCryptBlock(sFile.GetBuffer(), sFile.GetSize(), JS_RC4KEY, sizeof(JS_RC4KEY)); - WriteFileBuffer(m_sFilePath.c_str(), (FX_LPCSTR)sFile.GetBuffer(), sFile.GetSize()); + WriteFileBuffer(m_sFilePath.c_str(), (const FX_CHAR*)sFile.GetBuffer(), sFile.GetSize()); } -void CJS_GlobalData::LoadFileBuffer(FX_LPCWSTR sFilePath, FX_LPBYTE& pBuffer, int32_t& nLength) +void CJS_GlobalData::LoadFileBuffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, int32_t& nLength) { //UnSupport. } -void CJS_GlobalData::WriteFileBuffer(FX_LPCWSTR sFilePath, FX_LPCSTR pBuffer, int32_t nLength) +void CJS_GlobalData::WriteFileBuffer(const FX_WCHAR* sFilePath, const FX_CHAR* pBuffer, int32_t nLength) { //UnSupport. } diff --git a/fpdfsdk/src/javascript/JS_Object.cpp b/fpdfsdk/src/javascript/JS_Object.cpp index 96c5307e63..9f2d0f8258 100644 --- a/fpdfsdk/src/javascript/JS_Object.cpp +++ b/fpdfsdk/src/javascript/JS_Object.cpp @@ -19,7 +19,7 @@ JS_TIMER_MAPARRAY& GetTimeMap() return *timeMap; } -int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon) +int FXJS_MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* swTitle, FX_UINT nType, FX_UINT nIcon) { int nRet = 0; @@ -62,12 +62,12 @@ CPDFSDK_PageView* CJS_EmbedObj::JSGetPageView(IFXJS_Context* cc) return FXJS_GetPageView(cc); } -int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView,FX_LPCWSTR swMsg,FX_LPCWSTR swTitle,FX_UINT nType,FX_UINT nIcon) +int CJS_EmbedObj::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView,const FX_WCHAR* swMsg,const FX_WCHAR* swTitle,FX_UINT nType,FX_UINT nIcon) { return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon); } -void CJS_EmbedObj::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg) +void CJS_EmbedObj::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) { CJS_Object::Alert(pContext, swMsg); } @@ -134,12 +134,12 @@ CPDFSDK_PageView* CJS_Object::JSGetPageView(IFXJS_Context* cc) return FXJS_GetPageView(cc); } -int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, FX_LPCWSTR swMsg, FX_LPCWSTR swTitle, FX_UINT nType, FX_UINT nIcon) +int CJS_Object::MsgBox(CPDFDoc_Environment* pApp, CPDFSDK_PageView* pPageView, const FX_WCHAR* swMsg, const FX_WCHAR* swTitle, FX_UINT nType, FX_UINT nIcon) { return FXJS_MsgBox(pApp, pPageView, swMsg, swTitle, nType, nIcon); } -void CJS_Object::Alert(CJS_Context* pContext, FX_LPCWSTR swMsg) +void CJS_Object::Alert(CJS_Context* pContext, const FX_WCHAR* swMsg) { ASSERT(pContext != NULL); diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index 9450a6400a..e3e38bcf3d 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -361,7 +361,7 @@ CFX_WideString ChangeObjName(const CFX_WideString& str) } FX_BOOL CJS_Runtime::GetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue) { - FX_LPCSTR name = utf8Name.GetCStr(); + const FX_CHAR* name = utf8Name.GetCStr(); v8::Locker lock(GetIsolate()); v8::Isolate::Scope isolate_scope(GetIsolate()); @@ -386,7 +386,7 @@ FX_BOOL CJS_Runtime::SetHValueByName(FX_BSTR utf8Name, FXJSE_HVALUE hValue) { if (utf8Name.IsEmpty() || hValue == NULL) return FALSE; - FX_LPCSTR name = utf8Name.GetCStr(); + const FX_CHAR* name = utf8Name.GetCStr(); v8::Isolate* pIsolate = GetIsolate(); v8::Locker lock(pIsolate); v8::Isolate::Scope isolate_scope(pIsolate); diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp index 0943802508..5bca831710 100644 --- a/fpdfsdk/src/javascript/JS_Value.cpp +++ b/fpdfsdk/src/javascript/JS_Value.cpp @@ -57,12 +57,12 @@ CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isola m_pValue = (JSFXObject)*pJsDoc; } -CJS_Value::CJS_Value(v8::Isolate* isolate, FX_LPCWSTR 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, FX_LPCSTR pStr):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr):m_isolate(isolate) { operator = (pStr); } @@ -200,7 +200,7 @@ void CJS_Value::operator = (CJS_Document* pJsDoc) } } -void CJS_Value::operator =(FX_LPCWSTR pWstr) +void CJS_Value::operator =(const FX_WCHAR* pWstr) { m_pValue = JS_NewString(m_isolate,(wchar_t *)pWstr); @@ -214,7 +214,7 @@ void CJS_Value::SetNull() m_eType = VT_null; } -void CJS_Value::operator = (FX_LPCSTR pStr) +void CJS_Value::operator = (const FX_CHAR* pStr) { operator = (CFX_WideString::FromLocal(pStr).c_str()); } @@ -419,7 +419,7 @@ void CJS_PropValue::operator >>(CFX_ByteString &string) const string = CJS_Value::ToCFXByteString(); } -void CJS_PropValue::operator <<(FX_LPCWSTR c_string) +void CJS_PropValue::operator <<(const FX_WCHAR* c_string) { ASSERT(!m_bIsSetting); CJS_Value::operator =(c_string); diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index 539d7c780a..c3fb8c3b2e 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -64,8 +64,8 @@ IMPLEMENT_JS_STATIC_GLOBAL_FUN(CJS_PublicMethods) struct stru_TbConvert { - FX_LPCSTR lpszJSMark; - FX_LPCSTR lpszCppMark; + const FX_CHAR* lpszJSMark; + const FX_CHAR* lpszCppMark; }; static const stru_TbConvert fcTable[] = { @@ -91,21 +91,21 @@ static const stru_TbConvert fcTable[] = { //"t" }; -static FX_LPCWSTR months[] = +static const FX_WCHAR* months[] = { L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" }; -static FX_LPCWSTR fullmonths[] = -{ - L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December" +static const FX_WCHAR* const fullmonths[] = +{ + L"January", L"February", L"March", L"April", L"May", L"June", L"July", L"August", L"September", L"October", L"November", L"December" }; -FX_BOOL CJS_PublicMethods::IsNumber(FX_LPCWSTR string) +FX_BOOL CJS_PublicMethods::IsNumber(const FX_WCHAR* string) { CFX_WideString sTrim = StrTrim(string); - FX_LPCWSTR pTrim = sTrim.c_str(); - FX_LPCWSTR p = pTrim; + const FX_WCHAR* pTrim = sTrim.c_str(); + const FX_WCHAR* p = pTrim; FX_BOOL bDot = FALSE; @@ -191,7 +191,7 @@ FX_BOOL CJS_PublicMethods::isReservedMaskChar(wchar_t ch) return ch == L'9' || ch == L'A' || ch == L'O' || ch == L'X'; } -double CJS_PublicMethods::AF_Simple(FX_LPCWSTR sFuction, double dValue1, double dValue2) +double CJS_PublicMethods::AF_Simple(const FX_WCHAR* sFuction, double dValue1, double dValue2) { if (FXSYS_wcsicmp(sFuction,L"AVG") == 0 || FXSYS_wcsicmp(sFuction,L"SUM") == 0) { @@ -213,49 +213,49 @@ double CJS_PublicMethods::AF_Simple(FX_LPCWSTR sFuction, double dValue1, double return dValue1; } -CFX_WideString CJS_PublicMethods::StrLTrim(FX_LPCWSTR pStr) +CFX_WideString CJS_PublicMethods::StrLTrim(const FX_WCHAR* pStr) { while (*pStr && *pStr == L' ') pStr++; return pStr; } -CFX_WideString CJS_PublicMethods::StrRTrim(FX_LPCWSTR pStr) +CFX_WideString CJS_PublicMethods::StrRTrim(const FX_WCHAR* pStr) { - FX_LPCWSTR p = pStr; + const FX_WCHAR* p = pStr; while (*p) p++; while (p > pStr && *(p - 1) == L' ') p--; return CFX_WideString(pStr, p - pStr); } -CFX_WideString CJS_PublicMethods::StrTrim(FX_LPCWSTR pStr) +CFX_WideString CJS_PublicMethods::StrTrim(const FX_WCHAR* pStr) { return StrRTrim(StrLTrim(pStr).c_str()); } -CFX_ByteString CJS_PublicMethods::StrLTrim(FX_LPCSTR pStr) +CFX_ByteString CJS_PublicMethods::StrLTrim(const FX_CHAR* pStr) { while (*pStr && *pStr == ' ') pStr++; return pStr; } -CFX_ByteString CJS_PublicMethods::StrRTrim(FX_LPCSTR pStr) +CFX_ByteString CJS_PublicMethods::StrRTrim(const FX_CHAR* pStr) { - FX_LPCSTR p = pStr; + const FX_CHAR* p = pStr; while (*p) p++; while (p > pStr && *(p - 1) == L' ') p--; return CFX_ByteString(pStr,p-pStr); } -CFX_ByteString CJS_PublicMethods::StrTrim(FX_LPCSTR pStr) +CFX_ByteString CJS_PublicMethods::StrTrim(const FX_CHAR* pStr) { return StrRTrim(StrLTrim(pStr)); } -double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS) +double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDigits, FX_BOOL& bDot, FX_BOOL& bSign, FX_BOOL& bKXJS) { bDot = FALSE; bSign = FALSE; @@ -263,11 +263,11 @@ double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, FX_BOOL bDigitExist = FALSE; - FX_LPCWSTR p = swSource; + const FX_WCHAR* p = swSource; wchar_t c; - FX_LPCWSTR pStart = NULL; - FX_LPCWSTR pEnd = NULL; + const FX_WCHAR* pStart = NULL; + const FX_WCHAR* pEnd = NULL; while ((c = *p)) { @@ -401,7 +401,7 @@ double CJS_PublicMethods::ParseNumber(FX_LPCWSTR swSource, FX_BOOL& bAllDigits, return dRet; } -double CJS_PublicMethods::ParseStringToNumber(FX_LPCWSTR swSource) +double CJS_PublicMethods::ParseStringToNumber(const FX_WCHAR* swSource) { FX_BOOL bAllDigits = FALSE; FX_BOOL bDot = FALSE; @@ -411,7 +411,7 @@ double CJS_PublicMethods::ParseStringToNumber(FX_LPCWSTR swSource) return ParseNumber(swSource, bAllDigits, bDot, bSign, bKXJS); } -FX_BOOL CJS_PublicMethods::ConvertStringToNumber(FX_LPCWSTR swSource, double & dRet, FX_BOOL & bDot) +FX_BOOL CJS_PublicMethods::ConvertStringToNumber(const FX_WCHAR* swSource, double & dRet, FX_BOOL & bDot) { FX_BOOL bAllDigits = FALSE; FX_BOOL bSign = FALSE; @@ -1662,7 +1662,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Format(IFXJS_Context* cc, const CJS_Parameters } int iIndex = params[0].ToInt(); - FX_LPCWSTR cFormats[] = {L"m/d", L"m/d/yy", L"mm/dd/yy", L"mm/yy", L"d-mmm", L"d-mmm-yy", L"dd-mmm-yy", + const FX_WCHAR* cFormats[] = {L"m/d", L"m/d/yy", L"mm/dd/yy", L"mm/yy", L"d-mmm", L"d-mmm-yy", L"dd-mmm-yy", L"yy-mm-dd", L"mmm-yy", L"mmmm-yy", L"mmm d, yyyy", L"mmmm d, yyyy", L"m/d/yy h:MM tt", L"m/d/yy HH:MM" }; @@ -1693,7 +1693,7 @@ FX_BOOL CJS_PublicMethods::AFDate_Keystroke(IFXJS_Context* cc, const CJS_Paramet } int iIndex = params[0].ToInt(); - FX_LPCWSTR cFormats[] = {L"m/d", L"m/d/yy", L"mm/dd/yy", L"mm/yy", L"d-mmm", L"d-mmm-yy", L"dd-mmm-yy", + const FX_WCHAR* cFormats[] = {L"m/d", L"m/d/yy", L"mm/dd/yy", L"mm/yy", L"d-mmm", L"d-mmm-yy", L"dd-mmm-yy", L"yy-mm-dd", L"mmm-yy", L"mmmm-yy", L"mmm d, yyyy", L"mmmm d, yyyy", L"m/d/yy h:MM tt", L"m/d/yy HH:MM" }; @@ -1723,7 +1723,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Format(IFXJS_Context* cc, const CJS_Parameters } int iIndex = params[0].ToInt(); - FX_LPCWSTR cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"}; + const FX_WCHAR* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"}; ASSERT(iIndex<FX_ArraySize(cFormats)); @@ -1749,7 +1749,7 @@ FX_BOOL CJS_PublicMethods::AFTime_Keystroke(IFXJS_Context* cc, const CJS_Paramet } int iIndex = params[0].ToInt(); - FX_LPCWSTR cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"}; + const FX_WCHAR* cFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"}; ASSERT(iIndex<FX_ArraySize(cFormats)); diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index f139380b20..06e147eb15 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -134,17 +134,17 @@ void global_alternate::Initial(CPDFDoc_Environment* pApp) UpdateGlobalPersistentVariables(); } -FX_BOOL global_alternate::QueryProperty(FX_LPCWSTR propname) +FX_BOOL global_alternate::QueryProperty(const FX_WCHAR* propname) { return CFX_WideString(propname) != L"setPersistent"; } -FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CFX_WideString& sError) +FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CFX_WideString& sError) { js_global_data* pData = NULL; CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname); - if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData)) + if (m_mapGlobal.Lookup(sPropName, (void*&)pData)) { pData->bDeleted = TRUE; return TRUE; @@ -153,7 +153,7 @@ FX_BOOL global_alternate::DelProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CF return FALSE; } -FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS_PropValue& vp, CFX_WideString& sError) +FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, const FX_WCHAR* propname, CJS_PropValue& vp, CFX_WideString& sError) { if (vp.IsSetting()) { @@ -202,7 +202,7 @@ FX_BOOL global_alternate::DoProperty(IFXJS_Context* cc, FX_LPCWSTR propname, CJS js_global_data* pData = NULL; CFX_ByteString sPropName = CFX_ByteString::FromUnicode(propname); - if (m_mapGlobal.Lookup(sPropName, (FX_LPVOID&)pData)) + if (m_mapGlobal.Lookup(sPropName, (void*&)pData)) { if (pData) { @@ -266,7 +266,7 @@ FX_BOOL global_alternate::setPersistent(IFXJS_Context* cc, const CJS_Parameters& CFX_ByteString sName = params[0].ToCFXByteString(); js_global_data* pData = NULL; - if (m_mapGlobal.Lookup(sName, (FX_LPVOID&)pData)) + if (m_mapGlobal.Lookup(sName, (void*&)pData)) { if (pData && !pData->bDeleted) { @@ -337,7 +337,7 @@ void global_alternate::CommitGlobalPersisitentVariables() { CFX_ByteString name; js_global_data* pData = NULL; - m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData); + m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData); if (pData) { @@ -491,7 +491,7 @@ void global_alternate::DestroyGlobalPersisitentVariables() { CFX_ByteString name; js_global_data* pData = NULL; - m_mapGlobal.GetNextAssoc(pos, name, (FX_LPVOID&)pData); + m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData); delete pData; } @@ -499,13 +499,13 @@ void global_alternate::DestroyGlobalPersisitentVariables() } -FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR 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; js_global_data* pTemp = NULL; - m_mapGlobal.Lookup(propname, (FX_LPVOID&)pTemp); + m_mapGlobal.Lookup(propname, (void*&)pTemp); if (pTemp) { @@ -597,7 +597,7 @@ FX_BOOL global_alternate::SetGlobalVariables(FX_LPCSTR propname, int nType, return FALSE; } - m_mapGlobal.SetAt(propname, (FX_LPVOID)pNewData); + m_mapGlobal.SetAt(propname, (void*)pNewData); return TRUE; } diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index e051cda66e..97bddec5c1 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -58,8 +58,8 @@ util::~util(void) struct stru_TbConvert { - FX_LPCWSTR lpszJSMark; - FX_LPCWSTR lpszCppMark; + const FX_WCHAR* lpszJSMark; + const FX_WCHAR* lpszCppMark; }; const stru_TbConvert fcTable[] = { @@ -315,7 +315,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& struct stru_TbConvertAd { - FX_LPCWSTR lpszJSMark; + const FX_WCHAR* lpszJSMark; int iValue; }; @@ -411,7 +411,7 @@ void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPictur struct stru_TbConvertAd { - FX_LPCWSTR lpszJSMark; + const FX_WCHAR* lpszJSMark; int iValue; }; diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index c03c84b7a7..3ab27e2d4a 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -33,7 +33,7 @@ class CJS_PrivateData public: CJS_PrivateData():ObjDefID(-1), pPrivate(NULL) {} int ObjDefID; - FX_LPVOID pPrivate; + void* pPrivate; }; @@ -105,7 +105,7 @@ int JS_DefineObjMethod(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* s if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly); + objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), v8::FunctionTemplate::New(isolate, pMethodCall), v8::ReadOnly); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } @@ -125,7 +125,7 @@ int JS_DefineObjProperty(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate); - objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsPropertyName), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut); + objTemp->SetAccessor(v8::String::NewFromUtf8(isolate, bsPropertyName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pPropGet, pPropPut); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } @@ -162,7 +162,7 @@ int JS_DefineObjConst(IJS_Runtime* pJSRuntime, int nObjDefnID, const wchar_t* sC if(nObjDefnID<0 || nObjDefnID>= pArray->GetSize()) return 0; CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); v8::Local<v8::ObjectTemplate> objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, pObjDef->m_objTemplate); - objTemp->Set(isolate, FX_LPCSTR(bsConstName), pDefault); + objTemp->Set(isolate, bsConstName.c_str(), pDefault); pObjDef->m_objTemplate.Reset(isolate,objTemp); return 0; } @@ -202,7 +202,7 @@ int JS_DefineGlobalMethod(IJS_Runtime* pJSRuntime, const wchar_t* sMethodName, v objTemp = v8::ObjectTemplate::New(isolate); else objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsMethodName), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly); + objTemp->Set(v8::String::NewFromUtf8(isolate, bsMethodName.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), funTempl, v8::ReadOnly); globalObjTemp.Reset(isolate,objTemp); @@ -225,7 +225,7 @@ int JS_DefineGlobalConst(IJS_Runtime* pJSRuntime, const wchar_t* sConstName, v8: objTemp = v8::ObjectTemplate::New(isolate); else objTemp = v8::Local<v8::ObjectTemplate>::New(isolate, globalObjTemp); - objTemp->Set(v8::String::NewFromUtf8(isolate, FX_LPCSTR(bsConst), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly); + objTemp->Set(v8::String::NewFromUtf8(isolate, bsConst.c_str(), v8::NewStringType::kNormal).ToLocalChecked(), pDefault, v8::ReadOnly); globalObjTemp.Reset(isolate,objTemp); @@ -473,12 +473,12 @@ void JS_Error(v8::Isolate* isolate, const CFX_WideString& message) unsigned JS_CalcHash(const wchar_t* main, unsigned nLen) { - return (unsigned)FX_HashCode_String_GetW((FX_LPCWSTR)main, nLen); + return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main, nLen); } unsigned JS_CalcHash(const wchar_t* main) { - return (unsigned)FX_HashCode_String_GetW((FX_LPCWSTR)main, FXSYS_wcslen(main)); + return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main, FXSYS_wcslen(main)); } const wchar_t* JS_GetTypeof(v8::Local<v8::Value> pObj) { diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp index cbc2ba46ba..f3dce6ad72 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp @@ -244,13 +244,13 @@ CFX_WideString CPWL_ComboBox::GetText() const return CFX_WideString(); } -void CPWL_ComboBox::SetText(FX_LPCWSTR text) +void CPWL_ComboBox::SetText(const FX_WCHAR* text) { if (m_pEdit) m_pEdit->SetText(text); } -void CPWL_ComboBox::AddString(FX_LPCWSTR string) +void CPWL_ComboBox::AddString(const FX_WCHAR* string) { if (m_pList) m_pList->AddString(string); diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp index f50233ff1c..62f09eff2b 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp @@ -37,7 +37,7 @@ void CPWL_Edit::OnDestroy() { } -void CPWL_Edit::SetText(FX_LPCWSTR csText) +void CPWL_Edit::SetText(const FX_WCHAR* csText) { CFX_WideString swText = csText; @@ -865,7 +865,7 @@ void CPWL_Edit::SetLimitChar(int32_t nLimitChar) m_pEdit->SetLimitChar(nLimitChar); } -void CPWL_Edit::ReplaceSel(FX_LPCWSTR csText) +void CPWL_Edit::ReplaceSel(const FX_WCHAR* csText) { m_pEdit->Clear(); m_pEdit->InsertText(csText); diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp index a38371c326..57b0c01782 100644 --- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp @@ -561,7 +561,7 @@ FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const return fFontSize; } -void CPWL_EditCtrl::SetText(FX_LPCWSTR csText) +void CPWL_EditCtrl::SetText(const FX_WCHAR* csText) { m_pEdit->SetText(csText); } @@ -582,7 +582,7 @@ void CPWL_EditCtrl::ShowVScrollBar(FX_BOOL bShow) { } -void CPWL_EditCtrl::InsertText(FX_LPCWSTR csText) +void CPWL_EditCtrl::InsertText(const FX_WCHAR* csText) { if (!IsReadOnly()) m_pEdit->InsertText(csText); diff --git a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp index 085159f5f3..bd01eab3da 100644 --- a/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_FontMap.cpp @@ -195,7 +195,7 @@ void CPWL_FontMap::Empty() } } -void CPWL_FontMap::Initial(FX_LPCSTR fontname) +void CPWL_FontMap::Initial(const FX_CHAR* fontname) { CFX_ByteString sFontName = fontname; diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp index 9426824c8e..f85156da0c 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp @@ -109,7 +109,7 @@ CFX_ByteString CPWL_Image::GetImageAlias() return CFX_ByteString(); } -void CPWL_Image::SetImageAlias(FX_LPCSTR sImageAlias) +void CPWL_Image::SetImageAlias(const FX_CHAR* sImageAlias) { m_sImageAlias = sImageAlias; } diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp index f2f3929e3f..9875002437 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp @@ -43,7 +43,7 @@ void CPWL_Label::OnCreated() } } -void CPWL_Label::SetText(FX_LPCWSTR csText) +void CPWL_Label::SetText(const FX_WCHAR* csText) { m_pEdit->SetText(csText); } diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp index 47c1c86123..ecf9e1231f 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp @@ -462,7 +462,7 @@ CPDF_Rect CPWL_ListBox::GetFocusRect() const return CPWL_Wnd::GetFocusRect(); } -void CPWL_ListBox::AddString(FX_LPCWSTR string) +void CPWL_ListBox::AddString(const FX_WCHAR* string) { if (m_pList) { @@ -470,7 +470,7 @@ void CPWL_ListBox::AddString(FX_LPCWSTR string) } } -void CPWL_ListBox::SetText(FX_LPCWSTR csText,FX_BOOL bRefresh) +void CPWL_ListBox::SetText(const FX_WCHAR* csText,FX_BOOL bRefresh) { //return CPDF_List::SetText(csText,bRefresh); } diff --git a/fpdfsdk/src/pdfwindow/PWL_Note.cpp b/fpdfsdk/src/pdfwindow/PWL_Note.cpp index 6e8ffcd546..13e15a0518 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Note.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Note.cpp @@ -143,7 +143,7 @@ void CPWL_Note_Edit::RePosChildWnd() m_fOldItemHeight = this->GetContentRect().Height(); } -void CPWL_Note_Edit::SetText(FX_LPCWSTR csText) +void CPWL_Note_Edit::SetText(const FX_WCHAR* csText) { m_bEnableNotify = FALSE; CPWL_Edit::SetText(csText); diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp index fe07630057..4864cabc11 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp @@ -99,14 +99,14 @@ void CPWL_Signature::SetFoxitFlag(FX_BOOL bFlagExist) m_bFlagExist = bFlagExist; } -void CPWL_Signature::SetText(FX_LPCWSTR sText) +void CPWL_Signature::SetText(const FX_WCHAR* sText) { m_pText->SetText(sText); RePosChildWnd(); } -void CPWL_Signature::SetDescription(FX_LPCWSTR string) +void CPWL_Signature::SetDescription(const FX_WCHAR* string) { m_pDescription->SetText(string); @@ -120,7 +120,7 @@ void CPWL_Signature::SetImage(CFX_DIBSource* pImage) RePosChildWnd(); } -void CPWL_Signature::SetImageStream(CPDF_Stream * pStream, FX_LPCSTR sImageAlias) +void CPWL_Signature::SetImageStream(CPDF_Stream * pStream, const FX_CHAR* sImageAlias) { m_pImage->SetPDFStream(pStream); m_pImage->SetImageAlias(sImageAlias); |