diff options
Diffstat (limited to 'fpdfsdk')
119 files changed, 1929 insertions, 1929 deletions
diff --git a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h index 687cd6f207..3be49fc2de 100644 --- a/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h +++ b/fpdfsdk/include/formfiller/FFL_CBA_Fontmap.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_CBA_FONTMAP_H_ @@ -43,7 +43,7 @@ private: CPDF_Dictionary* m_pAnnotDict; CPDF_Font* m_pDefaultFont; CFX_ByteString m_sDefaultFontName; - + CFX_ByteString m_sAPType; }; diff --git a/fpdfsdk/include/formfiller/FFL_CheckBox.h b/fpdfsdk/include/formfiller/FFL_CheckBox.h index bac1b9394b..3deeae8aa7 100644 --- a/fpdfsdk/include/formfiller/FFL_CheckBox.h +++ b/fpdfsdk/include/formfiller/FFL_CheckBox.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_CHECKBOX_H_ diff --git a/fpdfsdk/include/formfiller/FFL_ComboBox.h b/fpdfsdk/include/formfiller/FFL_ComboBox.h index 5f0aaa1440..0ade1bcdb0 100644 --- a/fpdfsdk/include/formfiller/FFL_ComboBox.h +++ b/fpdfsdk/include/formfiller/FFL_ComboBox.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_COMBOBOX_H_ @@ -26,43 +26,43 @@ class CFFL_ComboBox : public CFFL_FormFiller, public IPWL_FocusHandler, public I public: CFFL_ComboBox(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pWidget); virtual ~CFFL_ComboBox(); - + virtual PWL_CREATEPARAM GetCreateParam(); virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView); - + virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); - + virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); virtual void SaveData(CPDFSDK_PageView* pPageView); - + virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa); virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa); virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew); virtual void SaveState(CPDFSDK_PageView* pPageView); virtual void RestoreState(CPDFSDK_PageView* pPageView); - + virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue); virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag); - + virtual FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView); - + public: virtual void OnSetFocus(CPWL_Wnd* pWnd); virtual void OnKillFocus(CPWL_Wnd* pWnd); - + public: virtual void OnAddUndo(CPWL_Edit* pEdit); - + public: - virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); - virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); - virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); - - virtual void DoCopy(CPDFSDK_Document* pDocument); - virtual void DoCut(CPDFSDK_Document* pDocument); - virtual void DoPaste(CPDFSDK_Document* pDocument); - + virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); + virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); + virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); + + virtual void DoCopy(CPDFSDK_Document* pDocument); + virtual void DoCut(CPDFSDK_Document* pDocument); + virtual void DoPaste(CPDFSDK_Document* pDocument); + private: CFX_WideString GetSelectExportText(); diff --git a/fpdfsdk/include/formfiller/FFL_FormFiller.h b/fpdfsdk/include/formfiller/FFL_FormFiller.h index 08dd25b27f..226766ceed 100644 --- a/fpdfsdk/include/formfiller/FFL_FormFiller.h +++ b/fpdfsdk/include/formfiller/FFL_FormFiller.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_FORMFILLER_H_ @@ -38,10 +38,10 @@ public: virtual ~CFFL_FormFiller(); virtual FX_RECT GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot); - virtual void OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, + virtual void OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow, */FX_DWORD dwFlags); - virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, + virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow, */FX_DWORD dwFlags); @@ -70,13 +70,13 @@ public: virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); - virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); - virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); - virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); + virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); + virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); + virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); - virtual void DoCopy(CPDFSDK_Document* pDocument); - virtual void DoCut(CPDFSDK_Document* pDocument); - virtual void DoPaste(CPDFSDK_Document* pDocument); + virtual void DoCopy(CPDFSDK_Document* pDocument); + virtual void DoCut(CPDFSDK_Document* pDocument); + virtual void DoPaste(CPDFSDK_Document* pDocument); public: //CPWL_TimerHandler virtual void TimerProc(); @@ -88,9 +88,9 @@ public: virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa); - virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, + virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa); - virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, + virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew); virtual void SaveState(CPDFSDK_PageView* pPageView); @@ -140,7 +140,7 @@ public: virtual void InvalidateRect(double left, double top, double right, double bottom); CPDFDoc_Environment* GetApp(){return m_pApp;} - CPDFSDK_Annot* GetSDKAnnot() {return m_pAnnot;} + CPDFSDK_Annot* GetSDKAnnot() {return m_pAnnot;} protected: CPDFDoc_Environment* m_pApp; CPDFSDK_Widget* m_pWidget; @@ -162,11 +162,11 @@ public: virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); virtual FX_BOOL OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point); - virtual void OnDraw(CPDFSDK_PageView *pPageView/*, HDC hDC*/, CPDFSDK_Annot* pAnnot, + virtual void OnDraw(CPDFSDK_PageView *pPageView/*, HDC hDC*/, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow,*/ FX_DWORD dwFlags); - virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, + virtual void OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow, */FX_DWORD dwFlags); protected: diff --git a/fpdfsdk/include/formfiller/FFL_ListBox.h b/fpdfsdk/include/formfiller/FFL_ListBox.h index b95ad725c2..81abec1cad 100644 --- a/fpdfsdk/include/formfiller/FFL_ListBox.h +++ b/fpdfsdk/include/formfiller/FFL_ListBox.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_LISTBOX_H_ @@ -27,7 +27,7 @@ public: virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa); - virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, + virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa); virtual void SaveState(CPDFSDK_PageView* pPageView); diff --git a/fpdfsdk/include/formfiller/FFL_Notify.h b/fpdfsdk/include/formfiller/FFL_Notify.h index ae7b3dcf9b..051a25069f 100644 --- a/fpdfsdk/include/formfiller/FFL_Notify.h +++ b/fpdfsdk/include/formfiller/FFL_Notify.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_NOTIFY_H_ @@ -16,25 +16,25 @@ class CPDF_FormField; class CFFL_Notify { public: - CFFL_Notify(CFFL_FormFiller * pFormFiller); + CFFL_Notify(CFFL_FormFiller * pFormFiller); virtual ~CFFL_Notify(); public: FX_BOOL OnSetFocus(FX_BOOL & bExit); FX_BOOL OnMouseEnter(FX_BOOL & bExit); FX_BOOL OnMouseDown(FX_BOOL & bExit); - FX_BOOL OnMouseUp(FX_BOOL & bExit); - FX_BOOL OnMouseExit(FX_BOOL & bExit); + FX_BOOL OnMouseUp(FX_BOOL & bExit); + FX_BOOL OnMouseExit(FX_BOOL & bExit); FX_BOOL OnKillFocus(FX_BOOL & bExit); FX_BOOL OnCalculate(); FX_BOOL OnFormat(int iCommitKey); - FX_BOOL OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange, + FX_BOOL OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, FX_BOOL & bRC); - FX_BOOL OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange, + FX_BOOL OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, - FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull, + FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull, int& nSelStart, int& nSelEnd, FX_BOOL& bRC); void BeforeNotify(); diff --git a/fpdfsdk/include/formfiller/FFL_PushButton.h b/fpdfsdk/include/formfiller/FFL_PushButton.h index 4cf61a82d0..3cfaefb9bd 100644 --- a/fpdfsdk/include/formfiller/FFL_PushButton.h +++ b/fpdfsdk/include/formfiller/FFL_PushButton.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_PUSHBUTTON_H_ @@ -18,7 +18,7 @@ public: virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView); virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); - virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, + virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_DWORD dwFlags); }; diff --git a/fpdfsdk/include/formfiller/FFL_RadioButton.h b/fpdfsdk/include/formfiller/FFL_RadioButton.h index 8dba93307a..46332e07fd 100644 --- a/fpdfsdk/include/formfiller/FFL_RadioButton.h +++ b/fpdfsdk/include/formfiller/FFL_RadioButton.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_RADIOBUTTON_H_ @@ -14,7 +14,7 @@ class CFFL_RadioButton : public CFFL_Button public: CFFL_RadioButton(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot); virtual ~CFFL_RadioButton(); - + virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView); virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_UINT nFlags); virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); diff --git a/fpdfsdk/include/formfiller/FFL_TextField.h b/fpdfsdk/include/formfiller/FFL_TextField.h index fc7a2f8f34..cb8df3f9c4 100644 --- a/fpdfsdk/include/formfiller/FFL_TextField.h +++ b/fpdfsdk/include/formfiller/FFL_TextField.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_TEXTFIELD_H_ @@ -27,45 +27,45 @@ class CFFL_TextField : public CFFL_FormFiller, public IPWL_FocusHandler, public public: CFFL_TextField(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnnot); virtual ~CFFL_TextField(); - + virtual PWL_CREATEPARAM GetCreateParam(); virtual CPWL_Wnd* NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView); - + virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFlags); - + virtual FX_BOOL IsDataChanged(CPDFSDK_PageView* pPageView); virtual void SaveData(CPDFSDK_PageView* pPageView); - + virtual void GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, PDFSDK_FieldAction& fa); - virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, + virtual void SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa); - virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, + virtual FX_BOOL IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew); virtual void SaveState(CPDFSDK_PageView* pPageView); virtual void RestoreState(CPDFSDK_PageView* pPageView); - + virtual CPWL_Wnd* ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue); - + virtual FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView); - + public: virtual void OnSetFocus(CPWL_Wnd* pWnd); virtual void OnKillFocus(CPWL_Wnd* pWnd); - + public: virtual void OnAddUndo(CPWL_Edit* pEdit); - + public: - virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); - virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); - virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); - - virtual void DoCopy(CPDFSDK_Document* pDocument); - virtual void DoCut(CPDFSDK_Document* pDocument); - virtual void DoPaste(CPDFSDK_Document* pDocument); - + virtual FX_BOOL CanCopy(CPDFSDK_Document* pDocument); + virtual FX_BOOL CanCut(CPDFSDK_Document* pDocument); + virtual FX_BOOL CanPaste(CPDFSDK_Document* pDocument); + + virtual void DoCopy(CPDFSDK_Document* pDocument); + virtual void DoCut(CPDFSDK_Document* pDocument); + virtual void DoPaste(CPDFSDK_Document* pDocument); + private: CBA_FontMap* m_pFontMap; FFL_TextFieldState m_State; diff --git a/fpdfsdk/include/formfiller/FFL_Utils.h b/fpdfsdk/include/formfiller/FFL_Utils.h index ff06a347e8..de9afafb56 100644 --- a/fpdfsdk/include/formfiller/FFL_Utils.h +++ b/fpdfsdk/include/formfiller/FFL_Utils.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FORMFILLER_FFL_UTILS_H_ diff --git a/fpdfsdk/include/fsdk_actionhandler.h b/fpdfsdk/include/fsdk_actionhandler.h index 2b38a5d5f6..311380ec98 100644 --- a/fpdfsdk/include/fsdk_actionhandler.h +++ b/fpdfsdk/include/fsdk_actionhandler.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FSDK_ACTIONHANDLER_H_ @@ -41,13 +41,13 @@ class CPDFSDK_ActionHandler /*: public CReader_ActionHandler*/ public: CPDFSDK_ActionHandler(CPDFDoc_Environment* pEvi); virtual ~CPDFSDK_ActionHandler(); - + virtual void Destroy(); virtual FX_BOOL DoAction_DocOpen(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CPDFSDK_DocView *pDocView*/); virtual FX_BOOL DoAction_JavaScript(const CPDF_Action& JsAction,CFX_WideString csJSName, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/); virtual FX_BOOL DoAction_Page(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/); virtual FX_BOOL DoAction_Document(const CPDF_Action& action, enum CPDF_AAction::AActionType eType, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/); - virtual FX_BOOL DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/); + virtual FX_BOOL DoAction_BookMark(CPDF_Bookmark *pBookMark, const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/); virtual FX_BOOL DoAction_Screen(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument,/* CReader_DocView *pDocView,*/ CPDFSDK_Annot* pScreen); virtual FX_BOOL DoAction_Link(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView *pDocView*/); virtual FX_BOOL DoAction_Field(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CPDF_FormField* pFormField, PDFSDK_FieldAction& data); @@ -55,7 +55,7 @@ public: public: void SetFormActionHandler(CPDFSDK_FormActionHandler* pHandler); void SetMediaActionHandler(CPDFSDK_MediaActionHandler* pHandler); - + private: FX_BOOL ExecuteDocumentOpenAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CFX_PtrList& list); FX_BOOL ExecuteDocumentPageAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ CFX_PtrList& list); @@ -63,23 +63,23 @@ private: FX_BOOL ExecuteScreenAction(const CPDF_Action& action, CPDF_AAction::AActionType type, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDFSDK_Annot* pScreen, CFX_PtrList& list); FX_BOOL ExecuteBookMark(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CPDF_Bookmark* pBookmark, CFX_PtrList& list); FX_BOOL ExecuteLinkAction(const CPDF_Action& action, CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ CFX_PtrList& list); - + void DoAction_NoJs(const CPDF_Action& action, CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/); void RunDocumentPageJavaScript(CPDFSDK_Document* pDocument, CPDF_AAction::AActionType type, const CFX_WideString& script); void RunDocumentOpenJavaScript(CPDFSDK_Document* pDocument, const CFX_WideString& sScriptName, const CFX_WideString& script); void RunFieldJavaScript(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, const CFX_WideString& script); - + private: FX_BOOL IsValidField(CPDFSDK_Document* pDocument, CPDF_Dictionary* pFieldDict); FX_BOOL IsValidDocView(CPDFSDK_Document* pDocument/*, CReader_DocView* pDocView*/); - + void DoAction_GoTo(CPDFSDK_Document* pDocument, /*CReader_DocView *pDocView,*/ const CPDF_Action& action); void DoAction_GoToR(CPDFSDK_Document* pDocument, const CPDF_Action& action); void DoAction_Launch(CPDFSDK_Document* pDocument, const CPDF_Action& action); void DoAction_URI(CPDFSDK_Document* pDocument, const CPDF_Action& action); void DoAction_Named(CPDFSDK_Document* pDocument, const CPDF_Action& action); void DoAction_SetOCGState(CPDFSDK_Document* pDocument, /*CReader_DocView* pDocView,*/ const CPDF_Action& action); - + private: CPDFSDK_FormActionHandler* m_pFormActionHandler; CPDFSDK_MediaActionHandler* m_pMediaActionHandler; diff --git a/fpdfsdk/include/fsdk_annothandler.h b/fpdfsdk/include/fsdk_annothandler.h index be7b4650e7..ce3c20d0e0 100644 --- a/fpdfsdk/include/fsdk_annothandler.h +++ b/fpdfsdk/include/fsdk_annothandler.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FSDK_ANNOTHANDLER_H_ @@ -32,7 +32,7 @@ public: virtual CFX_ByteString GetName() = 0; virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot) = 0; - + virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage) = 0; @@ -41,23 +41,23 @@ public: virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) = 0; virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) = 0; - + virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) = 0; - + virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point) = 0; - - virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, + + virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_DWORD dwFlags) = 0; - - virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, + + virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, const CPDF_Rect& rcWindow, FX_DWORD dwFlags) = 0; - - + + virtual void OnCreate(CPDFSDK_Annot* pAnnot) = 0; @@ -66,11 +66,11 @@ public: virtual void OnDelete(CPDFSDK_Annot* pAnnot) = 0; virtual void OnRelease(CPDFSDK_Annot* pAnnot) = 0; - + virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0; virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) = 0; - + virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0; virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) = 0; @@ -105,7 +105,7 @@ public: virtual CFX_ByteString GetType() {return CFX_ByteString("Widget");} virtual CFX_ByteString GetName() {return CFX_ByteString("WidgetHandler");} - + virtual FX_BOOL CanAnswer(CPDFSDK_Annot* pAnnot); virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPage); @@ -115,21 +115,21 @@ public: virtual void ReleaseAnnot(CPDFSDK_Annot* pAnnot) ; virtual void DeleteAnnot(CPDFSDK_Annot* pAnnot) {} - + virtual CPDF_Rect GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot) ; - + virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point); - - virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, + + virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_DWORD dwFlags) ; - - virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, + + virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, const CPDF_Rect& rcWindow, FX_DWORD dwFlags) {} - + virtual void OnCreate(CPDFSDK_Annot* pAnnot) ; @@ -138,11 +138,11 @@ public: virtual void OnDelete(CPDFSDK_Annot* pAnnot) {} virtual void OnRelease(CPDFSDK_Annot* pAnnot) {} - + virtual void OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) ; virtual void OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) ; - + virtual FX_BOOL OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ; virtual FX_BOOL OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ; @@ -152,7 +152,7 @@ public: virtual FX_BOOL OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ; virtual FX_BOOL OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) ; virtual FX_BOOL OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point) {return FALSE;} - + //by wjm. virtual FX_BOOL OnChar(CPDFSDK_Annot* pAnnot, FX_DWORD nChar, FX_DWORD nFlags); virtual FX_BOOL OnKeyDown(CPDFSDK_Annot* pAnnot, int nKeyCode, int nFlag); @@ -201,11 +201,11 @@ public: virtual FX_BOOL HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, const CPDF_Point& point); - virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, + virtual void OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_DWORD dwFlags); - virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, + virtual void OnDrawSleep(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, const CPDF_Rect& rcWindow, FX_DWORD dwFlags) {} @@ -268,7 +268,7 @@ public: virtual CPDFSDK_Annot* NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_PageView *pPageView); virtual CPDFSDK_Annot* NewAnnot(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPageView); virtual void ReleaseAnnot(CPDFSDK_Annot * pAnnot); - + virtual void Annot_OnCreate(CPDFSDK_Annot* pAnnot); virtual void Annot_OnLoad(CPDFSDK_Annot* pAnnot); public: @@ -282,7 +282,7 @@ public: virtual FX_BOOL Annot_OnLButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point); virtual FX_BOOL Annot_OnLButtonUp(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point); virtual FX_BOOL Annot_OnLButtonDblClk(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point); - + virtual FX_BOOL Annot_OnMouseMove(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point); virtual FX_BOOL Annot_OnMouseWheel(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, short zDelta, const CPDF_Point& point); virtual FX_BOOL Annot_OnRButtonDown(CPDFSDK_PageView * pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlags, const CPDF_Point& point); @@ -321,7 +321,7 @@ public: virtual ~CPDFSDK_AnnotIterator() { } virtual CPDFSDK_Annot* Next (const CPDFSDK_Annot* pCurrent) ; - virtual CPDFSDK_Annot* Prev (const CPDFSDK_Annot* pCurrent) ; + virtual CPDFSDK_Annot* Prev (const CPDFSDK_Annot* pCurrent) ; virtual CPDFSDK_Annot* Next(int& index ) ; virtual CPDFSDK_Annot* Prev(int& index ) ; virtual int Count(){return m_pIteratorAnnotList.GetSize();} diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h index 04b384d596..b71e128cfb 100644 --- a/fpdfsdk/include/fsdk_baseannot.h +++ b/fpdfsdk/include/fsdk_baseannot.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FSDK_BASEANNOT_H_ @@ -27,15 +27,15 @@ class CFX_RenderDevice; #define CFX_IntArray CFX_ArrayTemplate<int> -class CPDFSDK_DateTime +class CPDFSDK_DateTime { public: CPDFSDK_DateTime(); CPDFSDK_DateTime(const CFX_ByteString& dtStr); CPDFSDK_DateTime(const CPDFSDK_DateTime& datetime); CPDFSDK_DateTime(const FX_SYSTEMTIME& st); - - + + CPDFSDK_DateTime& operator = (const CPDFSDK_DateTime& datetime); CPDFSDK_DateTime& operator = (const FX_SYSTEMTIME& st); FX_BOOL operator == (CPDFSDK_DateTime& datetime); @@ -43,9 +43,9 @@ public: FX_BOOL operator > (CPDFSDK_DateTime& datetime); FX_BOOL operator >= (CPDFSDK_DateTime& datetime); FX_BOOL operator < (CPDFSDK_DateTime& datetime); - FX_BOOL operator <= (CPDFSDK_DateTime& datetime); + FX_BOOL operator <= (CPDFSDK_DateTime& datetime); operator time_t(); - + CPDFSDK_DateTime& FromPDFDateTimeString(const CFX_ByteString& dtStr); CFX_ByteString ToCommonDateTimeString(); CFX_ByteString ToPDFDateTimeString(); @@ -53,9 +53,9 @@ public: CPDFSDK_DateTime ToGMT(); CPDFSDK_DateTime& AddDays(short days); CPDFSDK_DateTime& AddSeconds(int seconds); - + void ResetDateTime(); - + struct FX_DATETIME { int16_t year; @@ -84,7 +84,7 @@ public: virtual CPDF_Annot* GetPDFAnnot() { return NULL; } virtual IXFA_Widget* GetXFAWidget() { return NULL; } - + virtual CFX_ByteString GetType() const { return ""; } virtual CFX_ByteString GetSubType() const { return ""; } @@ -96,24 +96,24 @@ public: public: CPDF_Page* GetPDFPage(); CPDFXFA_Page* GetPDFXFAPage(); - + void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } CPDFSDK_PageView* GetPageView() { return m_pPageView; } - - // Tab Order + + // Tab Order int GetTabOrder(); void SetTabOrder(int iTabOrder); - + // Selection FX_BOOL IsSelected(); void SetSelected(FX_BOOL bSelected); - + protected: CPDF_Annot* m_pAnnot; CPDFSDK_PageView* m_pPageView; FX_BOOL m_bSelected; int m_nTabOrder; - + }; class CPDFSDK_BAAnnot : public CPDFSDK_Annot @@ -136,13 +136,13 @@ public: virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device,CPDF_RenderOptions* pOptions); public: CPDF_Dictionary* GetAnnotDict() const; - + void SetContents(const CFX_WideString& sContents); CFX_WideString GetContents() const; - + void SetAnnotName(const CFX_WideString& sName); CFX_WideString GetAnnotName() const; - + void SetModifiedDate(const FX_SYSTEMTIME& st); FX_SYSTEMTIME GetModifiedDate() const; @@ -151,47 +151,47 @@ public: void SetAppState(const CFX_ByteString& str); CFX_ByteString GetAppState() const; - + void SetStructParent(int key); int GetStructParent() const; - + //border void SetBorderWidth(int nWidth); int GetBorderWidth() const; - + //BBS_SOLID //BBS_DASH //BBS_BEVELED //BBS_INSET //BBS_UNDERLINE - + void SetBorderStyle(int nStyle); int GetBorderStyle() const; - + void SetBorderDash(const CFX_IntArray& array); void GetBorderDash(CFX_IntArray& array) const; - + //The background of the annotation's icon when closed //The title bar of the annotation's pop-up window //The border of a link annotation - + void SetColor(FX_COLORREF color); void RemoveColor(); FX_BOOL GetColor(FX_COLORREF& color) const; - + FX_BOOL IsVisible() const; //action CPDF_Action GetAction() const; void SetAction(const CPDF_Action& a); void RemoveAction(); - + CPDF_AAction GetAAction() const; void SetAAction(const CPDF_AAction& aa); void RemoveAAction(); - + virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); - + public: virtual FX_BOOL IsAppearanceValid(); virtual FX_BOOL IsAppearanceValid(CPDF_Annot::AppearanceMode mode); @@ -199,11 +199,11 @@ public: CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions); void DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device, const CPDF_RenderOptions* pOptions); - + void ClearCachedAP(); - + virtual void ResetAppearance(); - void WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox, + void WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox, const CPDF_Matrix& matrix, const CFX_ByteString& sContents, const CFX_ByteString& sAPState = ""); diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h index 88b3b1d42e..7d9b01e587 100644 --- a/fpdfsdk/include/fsdk_baseform.h +++ b/fpdfsdk/include/fsdk_baseform.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FSDK_BASEFORM_H_ @@ -50,7 +50,7 @@ typedef struct _PDFSDK_FieldAction bFieldFull = FALSE; bRC = TRUE; } - + FX_BOOL bModifier; //in FX_BOOL bShift; //in int nCommitKey; //in @@ -78,9 +78,9 @@ public: void SynchronizeXFAValue(); void SynchronizeXFAItems(); - static void SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, + static void SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, CPDF_FormField* pFormField, CPDF_FormControl* pFormControl); - static void SynchronizeXFAItems(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, + static void SynchronizeXFAItems(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, CPDF_FormField* pFormField, CPDF_FormControl* pFormControl); public: @@ -88,7 +88,7 @@ public: virtual ~CPDFSDK_Widget(); virtual CFX_ByteString GetSubType() const; - + virtual CPDF_Action GetAAction(CPDF_AAction::AActionType eAAT); int GetFieldType() const; @@ -100,7 +100,7 @@ public: FIELDFLAG_REQUIRED FIELDFLAG_NOEXPORT */ - + int GetFieldFlags() const; int GetRotate() const; @@ -140,9 +140,9 @@ public: void ResetFieldAppearance(FX_BOOL bValueChanged); void UpdateField(); CFX_WideString OnFormat(FX_BOOL& bFormated); - + //Message. - FX_BOOL OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, + FX_BOOL OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAction& data, CPDFSDK_PageView* pPageView); CPDFSDK_InterForm* GetInterForm() const {return m_pInterForm;} @@ -151,14 +151,14 @@ public: static CPDF_FormControl* GetFormControl(CPDF_InterForm* pInterForm, CPDF_Dictionary* pAnnotDict); void DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView); - + void SetAppModified(); void ClearAppModified(); FX_BOOL IsAppModified() const; - + int32_t GetAppearanceAge() const; int32_t GetValueAge() const; - + private: void ResetAppearance_PushButton(); void ResetAppearance_CheckBox(); @@ -166,18 +166,18 @@ private: void ResetAppearance_ComboBox(const FX_WCHAR* sValue); void ResetAppearance_ListBox(); void ResetAppearance_TextField(const FX_WCHAR* sValue); - + CPDF_Rect GetClientRect() const; CPDF_Rect GetRotatedRect() const; - + CFX_ByteString GetBackgroundAppStream() const; CFX_ByteString GetBorderAppStream() const; CPDF_Matrix GetMatrix() const; - + CPWL_Color GetTextPWLColor() const; CPWL_Color GetBorderPWLColor() const; CPWL_Color GetFillPWLColor() const; - + void AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_Stream* pImage); void RemoveAppearance(const CFX_ByteString& sAPType); public: @@ -228,26 +228,26 @@ class CPDFSDK_InterForm : public CPDF_FormNotify public: CPDFSDK_InterForm(CPDFSDK_Document* pDocument); virtual ~CPDFSDK_InterForm(); - + public: virtual void Destroy(); virtual CPDF_InterForm* GetInterForm(); - + CPDFSDK_Document* GetDocument(); FX_BOOL HighlightWidgets(); - + CPDFSDK_Widget* GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const; CPDFSDK_Widget* GetWidget(CPDF_FormControl* pControl) const; void GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArray& widgets); void GetWidgets(CPDF_FormField* pField, CFX_PtrArray& widgets); - + void AddMap(CPDF_FormControl* pControl, CPDFSDK_Widget* pWidget); void RemoveMap(CPDF_FormControl* pControl); - + void AddXFAMap(IXFA_Widget* hWidget, CPDFSDK_XFAWidget* pWidget); void RemoveXFAMap(IXFA_Widget* hWidget); CPDFSDK_XFAWidget* GetXFAWidget(IXFA_Widget* hWidget); - + void EnableCalculate(FX_BOOL bEnabled); FX_BOOL IsCalculateEnabled() const; @@ -265,27 +265,27 @@ public: void OnValidate(CPDF_FormField* pFormField, CFX_WideString& csValue, FX_BOOL& bRC); void OnCalculate(CPDF_FormField* pFormField = NULL); CFX_WideString OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormated); - + void ResetFieldAppearance(CPDF_FormField* pFormField, const FX_WCHAR* sValue, FX_BOOL bValueChanged); void UpdateField(CPDF_FormField* pFormField); - + public: FX_BOOL DoAction_Hide(const CPDF_Action& action); FX_BOOL DoAction_SubmitForm(const CPDF_Action& action); FX_BOOL DoAction_ResetForm(const CPDF_Action& action); FX_BOOL DoAction_ImportData(const CPDF_Action& action); - + void GetFieldFromObjects(const CFX_PtrArray& objects, CFX_PtrArray& fields); FX_BOOL IsValidField(CPDF_Dictionary* pFieldDict); - FX_BOOL SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields, + FX_BOOL SubmitFields(const CFX_WideString& csDestination, const CFX_PtrArray& fields, FX_BOOL bIncludeOrExclude, FX_BOOL bUrlEncoded); FX_BOOL SubmitForm(const CFX_WideString& sDestination, FX_BOOL bUrlEncoded); FX_BOOL ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf); FX_BOOL ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,FX_BOOL bIncludeOrExclude, CFX_ByteTextBuf& textBuf); CFX_WideString GetTemporaryFileName(const CFX_WideString& sFileExt); - + void SynchronizeField(CPDF_FormField* pFormField, FX_BOOL bSynchronizeElse); - + private: virtual int BeforeValueChange(const CPDF_FormField* pField, CFX_WideString& csValue); virtual int AfterValueChange(const CPDF_FormField* pField); @@ -296,13 +296,13 @@ private: virtual int AfterFormReset(const CPDF_InterForm* pForm); virtual int BeforeFormImportData(const CPDF_InterForm* pForm); virtual int AfterFormImportData(const CPDF_InterForm* pForm); - + private: FX_BOOL FDFToURLEncodedData(CFX_WideString csFDFFile, CFX_WideString csTxtFile); FX_BOOL FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufSize); int GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict) const; void DoFDFBuffer(CFX_ByteString sBuffer); - + private: CPDFSDK_Document* m_pDocument; CPDF_InterForm* m_pInterForm; diff --git a/fpdfsdk/include/fsdk_common.h b/fpdfsdk/include/fsdk_common.h index bc7cbcb711..b243cd4ab7 100644 --- a/fpdfsdk/include/fsdk_common.h +++ b/fpdfsdk/include/fsdk_common.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FSDK_COMMON_H_ diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h index c21dd88ca9..5c0e88a44a 100644 --- a/fpdfsdk/include/fsdk_define.h +++ b/fpdfsdk/include/fsdk_define.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_ @@ -12,13 +12,13 @@ #include <math.h> #endif -#include "../../core/include/fpdfapi/fpdf_parser.h" -#include "../../core/include/fpdfapi/fpdfapi.h" -#include "../../core/include/fpdfapi/fpdf_parser.h" -#include "../../core/include/fpdfapi/fpdf_module.h" -#include "../../core/include/fpdfapi/fpdf_render.h" -#include "../../core/include/fpdfapi/fpdf_pageobj.h" -#include "../../core/include/fpdfapi/fpdf_serial.h" +#include "../../core/include/fpdfapi/fpdf_parser.h" +#include "../../core/include/fpdfapi/fpdfapi.h" +#include "../../core/include/fpdfapi/fpdf_parser.h" +#include "../../core/include/fpdfapi/fpdf_module.h" +#include "../../core/include/fpdfapi/fpdf_render.h" +#include "../../core/include/fpdfapi/fpdf_pageobj.h" +#include "../../core/include/fpdfapi/fpdf_serial.h" #include "../../core/include/fpdftext/fpdf_text.h" @@ -27,10 +27,10 @@ #include "../../core/include/fxcodec/fx_codec.h" -#include "../../core/include/fpdfdoc/fpdf_doc.h" -#include "../../core/include/fpdfdoc/fpdf_vt.h" +#include "../../core/include/fpdfdoc/fpdf_doc.h" +#include "../../core/include/fpdfdoc/fpdf_vt.h" -#include "../../core/include/fxcrt/fx_xml.h" +#include "../../core/include/fxcrt/fx_xml.h" #include "../../xfa/include/fxbarcode/BC_BarCode.h" #include "../../xfa/include/fxjse/fxjse.h" #include "../../xfa/include/fxgraphics/fx_graphics.h" @@ -71,7 +71,7 @@ #define FX_COLORREFTOARGB(rgb) ((FX_DWORD)0xFF000000|(((FX_DWORD)rgb & 0x000000FF) << 16)|((FX_DWORD)rgb & 0x0000FF00)|(((FX_DWORD)rgb & 0x00FF0000) >> 16)) #endif -typedef unsigned int FX_UINT; +typedef unsigned int FX_UINT; #include "../../public/fpdfview.h" diff --git a/fpdfsdk/include/fsdk_rendercontext.h b/fpdfsdk/include/fsdk_rendercontext.h index fff7031b55..b2bc163b49 100644 --- a/fpdfsdk/include/fsdk_rendercontext.h +++ b/fpdfsdk/include/fsdk_rendercontext.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FSDK_RENDERCONTEXT_H_ @@ -11,14 +11,14 @@ #include "fsdk_define.h" // Everything about rendering is put here: for OOM recovery -class CRenderContext +class CRenderContext { public: CRenderContext() { Clear(); } ~CRenderContext(); - + void Clear(); - + CFX_RenderDevice* m_pDevice; CPDF_RenderContext* m_pContext; CPDF_ProgressiveRenderer* m_pRenderer; @@ -35,7 +35,7 @@ class IFSDK_PAUSE_Adapter : public IFX_Pause public: IFSDK_PAUSE_Adapter(IFSDK_PAUSE* IPause ); FX_BOOL NeedToPauseNow(); - + private: IFSDK_PAUSE* m_IPause; }; diff --git a/fpdfsdk/include/fx_systemhandler.h b/fpdfsdk/include/fx_systemhandler.h index e398f78b88..bf59e452ea 100644 --- a/fpdfsdk/include/fx_systemhandler.h +++ b/fpdfsdk/include/fx_systemhandler.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FX_SYSTEMHANDLER_H_ @@ -11,7 +11,7 @@ typedef void* FX_HWND; typedef void* FX_HMENU; typedef void (*TimerCallback)(int32_t idEvent); -typedef struct _FX_SYSTEMTIME +typedef struct _FX_SYSTEMTIME { _FX_SYSTEMTIME() : wYear(0), @@ -51,16 +51,16 @@ public: virtual CFX_WideString GetClipboardText(FX_HWND hWnd) = 0; virtual FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) = 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; /*cursor style - FXCT_ARROW - FXCT_NESW - FXCT_NWSE - FXCT_VBEAM - FXCT_HBEAM + FXCT_ARROW + FXCT_NESW + FXCT_NWSE + FXCT_VBEAM + FXCT_HBEAM FXCT_HAND */ virtual void SetCursor(int32_t nCursorType) = 0; @@ -86,7 +86,7 @@ public: virtual FX_SYSTEMTIME GetLocalTime() = 0; - virtual int32_t GetCharSet() = 0; + virtual int32_t GetCharSet() = 0; virtual void SetCharSet(int32_t nCharSet) = 0; }; diff --git a/fpdfsdk/include/fxedit/fx_edit.h b/fpdfsdk/include/fxedit/fx_edit.h index f710cddaa7..bf46e91819 100644 --- a/fpdfsdk/include/fxedit/fx_edit.h +++ b/fpdfsdk/include/fxedit/fx_edit.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FXEDIT_FX_EDIT_H_ @@ -58,7 +58,7 @@ struct CPVT_WordRange; #ifndef DEFAULT_CHARSET #define DEFAULT_CHARSET 1 -#endif +#endif class IFX_Edit_FontMap { @@ -81,12 +81,12 @@ class IFX_Edit_Notify public: virtual ~IFX_Edit_Notify() { } //set the horizontal scrollbar information. - virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, - FX_FLOAT fContentMin, FX_FLOAT fContentMax, + virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, + FX_FLOAT fContentMin, FX_FLOAT fContentMax, FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; //set the vertical scrollbar information. - virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, - FX_FLOAT fContentMin, FX_FLOAT fContentMax, + virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, + FX_FLOAT fContentMin, FX_FLOAT fContentMax, FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; //set the position of horizontal scrollbar. virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0; @@ -134,14 +134,14 @@ public: virtual FX_BOOL NextWord() = 0; //move the current position to the next line. virtual FX_BOOL NextLine() = 0; - //move the current position to the next section. + //move the current position to the next section. virtual FX_BOOL NextSection() = 0; //move the current position to the previous word. virtual FX_BOOL PrevWord() = 0; //move the current position to the previous line. virtual FX_BOOL PrevLine() = 0; - //move the current position to the previous section. + //move the current position to the previous section. virtual FX_BOOL PrevSection() = 0; //get the information of the current word. @@ -217,7 +217,7 @@ public: virtual void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE) = 0; //if set, CRLF is allowed. virtual void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE) = 0; - //if set, all words auto fit the width of the bounding box. + //if set, all words auto fit the width of the bounding box. virtual void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; //if set, a font size is calculated to full fit the bounding box. virtual void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE) = 0; @@ -233,13 +233,13 @@ public: //set the edit is richedit. virtual void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE) = 0; //set the fontsize of selected text. - virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0; + virtual FX_BOOL SetRichFontSize(FX_FLOAT fFontSize) = 0; //set the fontindex of selected text, user can change the font of selected text. virtual FX_BOOL SetRichFontIndex(int32_t nFontIndex) = 0; //set the textcolor of selected text. virtual FX_BOOL SetRichTextColor(FX_COLORREF dwColor) = 0; //set the text script type of selected text. (0:normal 1:superscript 2:subscript) - virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0; + virtual FX_BOOL SetRichTextScript(int32_t nScriptType) = 0; //set the bold font style of selected text. virtual FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE) = 0; //set the italic font style of selected text. @@ -267,7 +267,7 @@ public: //select all the text. virtual void SelectAll() = 0; //set text is not selected. - virtual void SelectNone() = 0; + virtual void SelectNone() = 0; //get the caret position. virtual int32_t GetCaret() const = 0; virtual CPVT_WordPlace GetCaretWordPlace() const = 0; @@ -276,7 +276,7 @@ public: //get the text conent virtual CFX_WideString GetText() const = 0; //query if any text is selected. - virtual FX_BOOL IsSelected() const = 0; + virtual FX_BOOL IsSelected() const = 0; //get the scroll origin virtual CPDF_Point GetScrollPos() const = 0; //get the bounding box of the text area. @@ -310,18 +310,18 @@ public: //put text into edit. virtual void SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, - const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; + 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; + virtual FX_BOOL InsertReturn(const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL) = 0; //insert text into the edit. 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; //do delete operation. - virtual FX_BOOL Delete() = 0; + virtual FX_BOOL Delete() = 0; //delete the selected text. virtual FX_BOOL Clear() = 0; @@ -334,7 +334,7 @@ public: //arrange all words over again virtual void Paint() = 0; - + //allow to refresh screen? virtual void EnableRefresh(FX_BOOL bRefresh) = 0; @@ -392,15 +392,15 @@ public: virtual void AddUndoItem(IFX_Edit_UndoItem* pUndoItem) = 0; - static CFX_ByteString GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, - const CPVT_WordRange* pRange = NULL, + static CFX_ByteString GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, + const CPVT_WordRange* pRange = NULL, FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); static CFX_ByteString GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange* pRange = NULL); static void DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke, const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData); static void DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF color, const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange); - static void DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, + static void DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange); static void GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEdit, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, FX_COLORREF crText, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); @@ -418,12 +418,12 @@ class IFX_List_Notify public: virtual ~IFX_List_Notify() { } //set the horizontal scrollbar information. - virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, - FX_FLOAT fContentMin, FX_FLOAT fContentMax, + virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, + FX_FLOAT fContentMin, FX_FLOAT fContentMax, FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; //set the vertical scrollbar information. - virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, - FX_FLOAT fContentMin, FX_FLOAT fContentMax, + virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, + FX_FLOAT fContentMin, FX_FLOAT fContentMax, FX_FLOAT fSmallStep, FX_FLOAT fBigStep) = 0; //set the position of horizontal scrollbar. virtual void IOnSetScrollPosX(FX_FLOAT fx) = 0; @@ -453,23 +453,23 @@ public: virtual int32_t GetCount() const = 0; virtual FX_BOOL IsItemSelected(int32_t nIndex) const = 0; virtual FX_FLOAT GetFirstHeight() const = 0; - + virtual void SetMultipleSel(FX_BOOL bMultiple) = 0; - virtual FX_BOOL IsMultipleSel() const = 0; + virtual FX_BOOL IsMultipleSel() const = 0; virtual FX_BOOL IsValid(int32_t nItemIndex) const = 0; - virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const = 0; + virtual int32_t FindNext(int32_t nIndex,FX_WCHAR nChar) const = 0; virtual void SetScrollPos(const CPDF_Point & point) = 0; virtual void ScrollToListItem(int32_t nItemIndex) = 0; virtual CPDF_Rect GetItemRect(int32_t nIndex) const = 0; virtual int32_t GetCaret() const = 0; - virtual int32_t GetSelect() const = 0; + virtual int32_t GetSelect() const = 0; virtual int32_t GetTopItem() const = 0; virtual int32_t GetItemIndex(const CPDF_Point & point) const = 0; virtual int32_t GetFirstSelected() const = 0; virtual void AddString(const FX_WCHAR* string) = 0; - virtual void SetTopItem(int32_t nIndex) = 0; + virtual void SetTopItem(int32_t nIndex) = 0; virtual void Select(int32_t nItemIndex) = 0; virtual void SetCaret(int32_t nItemIndex) = 0; virtual void Empty() = 0; diff --git a/fpdfsdk/include/fxedit/fxet_edit.h b/fpdfsdk/include/fxedit/fxet_edit.h index d92f29067a..7a2742f0ee 100644 --- a/fpdfsdk/include/fxedit/fxet_edit.h +++ b/fpdfsdk/include/fxedit/fxet_edit.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_FXEDIT_FXET_EDIT_H_ @@ -313,10 +313,10 @@ private: private: CFX_ArrayTemplate<IFX_Edit_UndoItem*> m_UndoItemStack; - + int32_t m_nCurUndoPos; int32_t m_nBufSize; - FX_BOOL m_bModified; + FX_BOOL m_bModified; FX_BOOL m_bVirgin; FX_BOOL m_bWorking; }; @@ -507,8 +507,8 @@ private: class CFXEU_SetSecProps : public CFX_Edit_UndoItem { public: - CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, - const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops, + CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, + const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops, const CPVT_SecProps & newsecprops, const CPVT_WordProps & newwordprops, const CPVT_WordRange & range); virtual ~CFXEU_SetSecProps(); @@ -524,13 +524,13 @@ private: CPVT_SecProps m_OldSecProps; CPVT_SecProps m_NewSecProps; CPVT_WordProps m_OldWordProps; - CPVT_WordProps m_NewWordProps; + CPVT_WordProps m_NewWordProps; }; class CFXEU_SetWordProps : public CFX_Edit_UndoItem { public: - CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, + CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, const CPVT_WordProps & oldprops, const CPVT_WordProps & newprops, const CPVT_WordRange & range); virtual ~CFXEU_SetWordProps(); @@ -542,9 +542,9 @@ private: CPVT_WordPlace m_wpPlace; CPVT_WordRange m_wrPlace; EDIT_PROPS_E m_eProps; - + CPVT_WordProps m_OldWordProps; - CPVT_WordProps m_NewWordProps; + CPVT_WordProps m_NewWordProps; }; /* ------------------------- CFX_Edit ---------------------------- */ @@ -559,14 +559,14 @@ class CFX_Edit : public IFX_Edit friend class CFXEU_Clear; friend class CFXEU_ClearRich; friend class CFXEU_SetSecProps; - friend class CFXEU_SetWordProps; + friend class CFXEU_SetWordProps; friend class CFXEU_InsertText; public: CFX_Edit(IPDF_VariableText * pVT); virtual ~CFX_Edit(); - void SetFontMap(IFX_Edit_FontMap * pFontMap); + void SetFontMap(IFX_Edit_FontMap * pFontMap); void SetVTProvider(IPDF_VariableText_Provider* pProvider); void SetNotify(IFX_Edit_Notify * pNotify); void SetOprNotify(IFX_Edit_OprNotify* pOprNotify); @@ -588,18 +588,18 @@ public: void SetLineLeading(FX_FLOAT fLineLeading, FX_BOOL bPaint = TRUE); void SetMultiLine(FX_BOOL bMultiLine = TRUE, FX_BOOL bPaint = TRUE); void SetAutoReturn(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); - void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); - void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); + void SetAutoFontSize(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); + void SetAutoScroll(FX_BOOL bAuto = TRUE, FX_BOOL bPaint = TRUE); void SetFontSize(FX_FLOAT fFontSize, FX_BOOL bPaint = TRUE); void SetTextOverflow(FX_BOOL bAllowed = FALSE, FX_BOOL bPaint = TRUE); FX_BOOL IsRichText() const; void SetRichText(FX_BOOL bRichText = TRUE, FX_BOOL bPaint = TRUE); - FX_BOOL SetRichFontSize(FX_FLOAT fFontSize); + FX_BOOL SetRichFontSize(FX_FLOAT fFontSize); FX_BOOL SetRichFontIndex(int32_t nFontIndex); FX_BOOL SetRichTextColor(FX_COLORREF dwColor); FX_BOOL SetRichTextScript(int32_t nScriptType); - FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE); + FX_BOOL SetRichTextBold(FX_BOOL bBold = TRUE); FX_BOOL SetRichTextItalic(FX_BOOL bItalic = TRUE); FX_BOOL SetRichTextUnderline(FX_BOOL bUnderline = TRUE); FX_BOOL SetRichTextCrossout(FX_BOOL bCrossout = TRUE); @@ -619,23 +619,23 @@ public: void OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl); void SetText(const FX_WCHAR* text,int32_t charset = DEFAULT_CHARSET, - const CPVT_SecProps * pSecProps = NULL,const CPVT_WordProps * pWordProps = NULL); + 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); FX_BOOL Backspace(); - FX_BOOL Delete(); + FX_BOOL Delete(); FX_BOOL Clear(); FX_BOOL Empty(); 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, const FX_WCHAR* text, int32_t charset, + FX_BOOL Undo(); + 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); int32_t WordPlaceToWordIndex(const CPVT_WordPlace & place) const; - CPVT_WordPlace WordIndexToWordPlace(int32_t index) const; + CPVT_WordPlace WordIndexToWordPlace(int32_t index) const; CPVT_WordPlace GetLineBeginPlace(const CPVT_WordPlace & place) const; CPVT_WordPlace GetLineEndPlace(const CPVT_WordPlace & place) const; @@ -680,19 +680,19 @@ private: void EnableNotify(FX_BOOL bNotify); void SetText(const FX_WCHAR* text,int32_t charset, - const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps,FX_BOOL bAddUndo, FX_BOOL bPaint); + 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 Delete(FX_BOOL bAddUndo, FX_BOOL bPaint); FX_BOOL Clear(FX_BOOL bAddUndo, FX_BOOL bPaint); 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); - FX_BOOL SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, + FX_BOOL SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo); - FX_BOOL SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, + FX_BOOL SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo); void PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr); void PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlace & wpNew); @@ -739,7 +739,7 @@ private: FX_FLOAT GetLineTop(const CPVT_WordPlace& place) const; FX_FLOAT GetLineBottom(const CPVT_WordPlace& place) const; -private: +private: IPDF_VariableText* m_pVT; IFX_Edit_Notify* m_pNotify; IFX_Edit_OprNotify* m_pOprNotify; @@ -751,8 +751,8 @@ private: CPDF_Point m_ptScrollPos; CPDF_Point m_ptRefreshScrollPos; - FX_BOOL m_bEnableScroll; - IFX_Edit_Iterator * m_pIterator; + FX_BOOL m_bEnableScroll; + IFX_Edit_Iterator * m_pIterator; CFX_Edit_Refresh m_Refresh; CPDF_Point m_ptCaret; CFX_Edit_Undo m_Undo; diff --git a/fpdfsdk/include/javascript/Consts.h b/fpdfsdk/include/javascript/Consts.h index f7ddc5215b..d04cc6b54c 100644 --- a/fpdfsdk/include/javascript/Consts.h +++ b/fpdfsdk/include/javascript/Consts.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_CONSTS_H_ diff --git a/fpdfsdk/include/javascript/Document.h b/fpdfsdk/include/javascript/Document.h index ab1ddb8633..b3725e77af 100644 --- a/fpdfsdk/include/javascript/Document.h +++ b/fpdfsdk/include/javascript/Document.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_DOCUMENT_H_ @@ -14,7 +14,7 @@ class PrintParamsObj : public CJS_EmbedObj public: PrintParamsObj(CJS_Object* pJSObject); virtual ~PrintParamsObj(){} - + public: FX_BOOL bUI; int nStart; @@ -31,7 +31,7 @@ class CJS_PrintParamsObj : public CJS_Object public: CJS_PrintParamsObj(JSFXObject pObject) : CJS_Object(pObject) {} virtual ~CJS_PrintParamsObj(){} - + DECLARE_JS_CLASS(CJS_PrintParamsObj); }; @@ -158,7 +158,7 @@ public: FX_BOOL submitForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL mailDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL removeIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - + public: void AttachDoc(CPDFSDK_Document* pDoc); CPDFSDK_Document* GetReaderDoc(); @@ -169,7 +169,7 @@ public: void AddDelayAnnotData(CJS_AnnotObj *pData); void DoAnnotDelay(); void SetIsolate(v8::Isolate* isolate) {m_isolate = isolate;} - CJS_Document* GetCJSDoc() const; + CJS_Document* GetCJSDoc() const; private: CFX_WideString ReversalStr(CFX_WideString cbFrom); @@ -194,7 +194,7 @@ public: CJS_Document(JSFXObject pObject) : CJS_Object(pObject) {}; virtual ~CJS_Document(){}; - virtual FX_BOOL InitInstance(IFXJS_Context* cc); + virtual FX_BOOL InitInstance(IFXJS_Context* cc); DECLARE_JS_CLASS(CJS_Document); diff --git a/fpdfsdk/include/javascript/Field.h b/fpdfsdk/include/javascript/Field.h index 573fb392c0..70d1d39b48 100644 --- a/fpdfsdk/include/javascript/Field.h +++ b/fpdfsdk/include/javascript/Field.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_FIELD_H_ @@ -100,7 +100,7 @@ struct CJS_DelayData class Field : public CJS_EmbedObj { public: - Field(CJS_Object* pJSObject); + Field(CJS_Object* pJSObject); virtual ~Field(void); FX_BOOL alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); @@ -221,12 +221,12 @@ public: static void SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CJS_WideStringArray& strArray); public: - static void AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType, + static void AddField(CPDFSDK_Document* pDocument, int nPageIndex, int nFieldType, const CFX_WideString& sName, const CPDF_Rect& rcCoords); public: - static void UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, + static void UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh); - static void UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl, + static void UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl, FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh); static CPDFSDK_Widget* GetWidget(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl); diff --git a/fpdfsdk/include/javascript/IJavaScript.h b/fpdfsdk/include/javascript/IJavaScript.h index ddab4cfde7..a8bdd65468 100644 --- a/fpdfsdk/include/javascript/IJavaScript.h +++ b/fpdfsdk/include/javascript/IJavaScript.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_IJAVASCRIPT_H_ @@ -47,7 +47,7 @@ public: virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit) = 0; virtual void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift, - CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, + CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL &bRc) = 0; virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) = 0; diff --git a/fpdfsdk/include/javascript/Icon.h b/fpdfsdk/include/javascript/Icon.h index 20a3bb8f68..0298005f00 100644 --- a/fpdfsdk/include/javascript/Icon.h +++ b/fpdfsdk/include/javascript/Icon.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_ICON_H_ diff --git a/fpdfsdk/include/javascript/JS_Context.h b/fpdfsdk/include/javascript/JS_Context.h index f63b289992..060bb55937 100644 --- a/fpdfsdk/include/javascript/JS_Context.h +++ b/fpdfsdk/include/javascript/JS_Context.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_CONTEXT_H_ @@ -38,7 +38,7 @@ public: virtual void OnPage_Close(CPDFSDK_Document* pTarget); virtual void OnPage_InView(CPDFSDK_Document* pTarget); virtual void OnPage_OutView(CPDFSDK_Document* pTarget); - + virtual void OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); virtual void OnField_MouseEnter(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); virtual void OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField *pTarget); @@ -50,7 +50,7 @@ public: virtual void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit); virtual void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift, - CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, + CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL &bRc); virtual void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc); @@ -83,14 +83,14 @@ public: FX_BOOL DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info); - CJS_EventHandler* GetEventHandler(){return m_pEventHandler;}; + CJS_EventHandler* GetEventHandler(){return m_pEventHandler;}; CPDFSDK_Document* GetReaderDocument(); private: - CJS_Runtime* m_pRuntime; - CJS_EventHandler* m_pEventHandler; + CJS_Runtime* m_pRuntime; + CJS_EventHandler* m_pEventHandler; - FX_BOOL m_bBusy; + FX_BOOL m_bBusy; FX_BOOL m_bMsgBoxEnable; }; diff --git a/fpdfsdk/include/javascript/JS_Define.h b/fpdfsdk/include/javascript/JS_Define.h index 15f236d681..7ad7f57166 100644 --- a/fpdfsdk/include/javascript/JS_Define.h +++ b/fpdfsdk/include/javascript/JS_Define.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_DEFINE_H_ diff --git a/fpdfsdk/include/javascript/JS_EventHandler.h b/fpdfsdk/include/javascript/JS_EventHandler.h index 8389831970..62afb829e7 100644 --- a/fpdfsdk/include/javascript/JS_EventHandler.h +++ b/fpdfsdk/include/javascript/JS_EventHandler.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_EVENTHANDLER_H_ @@ -78,12 +78,12 @@ public: void OnPage_Close(CPDFSDK_Document* pDoc); void OnPage_InView(CPDFSDK_Document* pTarget); void OnPage_OutView(CPDFSDK_Document* pTarget); - + void OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc); void OnField_Format(CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit); void OnField_Keystroke(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL KeyDown, FX_BOOL bModifier, int &nSelEnd,int &nSelStart, FX_BOOL bShift, - CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, + CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL bWillCommit, FX_BOOL bFieldFull, FX_BOOL &bRc); void OnField_Validate(CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc); @@ -119,7 +119,7 @@ public: void Destroy(); FX_BOOL IsValid(); - + CFX_WideString& Change(); CFX_WideString ChangeEx(); int CommitKey(); @@ -138,7 +138,7 @@ public: FX_BOOL WillCommit(); CFX_WideString TargetName(); - JS_EVENT_T EventType() {return m_eEventType;}; + JS_EVENT_T EventType() {return m_eEventType;}; public: CJS_Context* m_pJSContext; diff --git a/fpdfsdk/include/javascript/JS_GlobalData.h b/fpdfsdk/include/javascript/JS_GlobalData.h index fea082d811..bbc0b12173 100644 --- a/fpdfsdk/include/javascript/JS_GlobalData.h +++ b/fpdfsdk/include/javascript/JS_GlobalData.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_GLOBALDATA_H_ @@ -74,15 +74,15 @@ public: 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; private: void LoadGlobalPersistentVariables(); void SaveGlobalPersisitentVariables(); - - CJS_GlobalData_Element* GetGlobalVariable(const FX_CHAR* propname); + + CJS_GlobalData_Element* GetGlobalVariable(const FX_CHAR* propname); int FindGlobalVariable(const FX_CHAR* propname); void LoadFileBuffer(const FX_WCHAR* sFilePath, uint8_t*& pBuffer, int32_t& nLength); diff --git a/fpdfsdk/include/javascript/JS_Object.h b/fpdfsdk/include/javascript/JS_Object.h index 803f6ba35e..abfc818079 100644 --- a/fpdfsdk/include/javascript/JS_Object.h +++ b/fpdfsdk/include/javascript/JS_Object.h @@ -17,7 +17,7 @@ class CJS_Object; class CJS_Timer; class CJS_Context; -class CJS_EmbedObj +class CJS_EmbedObj { public: CJS_EmbedObj(CJS_Object* pJSObject); @@ -39,7 +39,7 @@ protected: CJS_Object* m_pJSObject; }; -class CJS_Object +class CJS_Object { public: CJS_Object(JSFXObject pObject); diff --git a/fpdfsdk/include/javascript/JS_Runtime.h b/fpdfsdk/include/javascript/JS_Runtime.h index 950d43fa47..a5c98ee0dd 100644 --- a/fpdfsdk/include/javascript/JS_Runtime.h +++ b/fpdfsdk/include/javascript/JS_Runtime.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_RUNTIME_H_ diff --git a/fpdfsdk/include/javascript/JS_Value.h b/fpdfsdk/include/javascript/JS_Value.h index 4381bd55a6..6186817fa5 100644 --- a/fpdfsdk/include/javascript/JS_Value.h +++ b/fpdfsdk/include/javascript/JS_Value.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_JS_VALUE_H_ diff --git a/fpdfsdk/include/javascript/PublicMethods.h b/fpdfsdk/include/javascript/PublicMethods.h index ba38503017..cff9e11479 100644 --- a/fpdfsdk/include/javascript/PublicMethods.h +++ b/fpdfsdk/include/javascript/PublicMethods.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_PUBLICMETHODS_H_ @@ -35,7 +35,7 @@ public: static FX_BOOL AFMakeNumber(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFSimple_Calculate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); - static FX_BOOL AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); + static FX_BOOL AFMergeChange(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFParseDateEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); static FX_BOOL AFExtractNums(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); @@ -56,7 +56,7 @@ public: JS_STATIC_GLOBAL_FUN(AFSpecial_Keystroke); JS_STATIC_GLOBAL_FUN(AFSpecial_KeystrokeEx); JS_STATIC_GLOBAL_FUN(AFSimple); - JS_STATIC_GLOBAL_FUN(AFMakeNumber); + JS_STATIC_GLOBAL_FUN(AFMakeNumber); JS_STATIC_GLOBAL_FUN(AFSimple_Calculate); JS_STATIC_GLOBAL_FUN(AFRange_Validate); JS_STATIC_GLOBAL_FUN(AFMergeChange); @@ -64,7 +64,7 @@ public: JS_STATIC_GLOBAL_FUN(AFExtractNums); JS_STATIC_DECLARE_GLOBAL_FUN(); - + public: static int ParseStringInteger(const CFX_WideString & string,int nStart,int & nSkip, int nMaxStep); static CFX_WideString ParseStringString(const CFX_WideString& string, int nStart, int& nSkip); diff --git a/fpdfsdk/include/javascript/app.h b/fpdfsdk/include/javascript/app.h index 7e51f73135..ac90e62b0d 100644 --- a/fpdfsdk/include/javascript/app.h +++ b/fpdfsdk/include/javascript/app.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_APP_H_ @@ -20,11 +20,11 @@ class TimerObj : public CJS_EmbedObj public: TimerObj(CJS_Object* pJSObject); virtual ~TimerObj(); - + public: void SetTimer(CJS_Timer* pTimer); CJS_Timer* GetTimer() const; - + private: CJS_Timer* m_pTimer; }; @@ -34,13 +34,13 @@ class CJS_TimerObj : public CJS_Object public: CJS_TimerObj(JSFXObject pObject) : CJS_Object(pObject) {} virtual ~CJS_TimerObj(){} - + DECLARE_JS_CLASS(CJS_TimerObj); }; // struct APP_MENUITEM_ARRAY; -// +// // struct APP_MENUITEM // { // APP_MENUITEM() : oSubMenu(NULL), cName(L""), cReturn(L""), bMarked(false), bEnabled(true) @@ -57,7 +57,7 @@ public: // { // APP_MENUITEM_ARRAY() : m_hMenu(NULL), pContents(NULL), nSize(0) // { -// +// // } // APP_MENUITEM * pContents; // HMENU m_hMenu; @@ -71,21 +71,21 @@ public: // pContent(NULL) // { // } -// +// // APP_MENU* pContent; // }; // struct APP_MENU // { -// APP_MENU():bSubMenu(false), +// APP_MENU():bSubMenu(false), // SubMenuItems(NULL), // cwMenuItemName(L""), // hMenu(NULL), // iSize(0) // { -// +// // } -// +// // APP_MENU(CFX_WideString &cwName): // cwMenuItemName(cwName), // bSubMenu(false), @@ -93,11 +93,11 @@ public: // hMenu(NULL), // iSize(0) // { -// +// // } -// +// // CFX_WideString cwMenuItemName; -// bool bSubMenu; +// bool bSubMenu; // APP_MENU_ARRAY* SubMenuItems; // int iSize; // HMENU hMenu; @@ -121,7 +121,7 @@ public: FX_BOOL runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); @@ -147,7 +147,7 @@ public: FX_BOOL setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); private: -// FX_DWORD AppGetTickCount(); +// FX_DWORD AppGetTickCount(); void TimerProc(CJS_Timer* pTimer); void RunJsScript(CJS_Runtime * pRuntime,const CFX_WideString & wsScript); // void ParsePopupMenuObj(APP_MENUITEM * ppMenuItem,JSObject * pObj); @@ -165,12 +165,12 @@ public: private: - bool m_bCalculate; + bool m_bCalculate; bool m_bRuntimeHighLight; CFX_ArrayTemplate<CJS_Timer*> m_aTimer; // APP_MENU* m_pMenuHead; - + public: // static CReader_App* s_App; }; @@ -194,7 +194,7 @@ public: JS_STATIC_PROP(runtimeHighlight, app); JS_STATIC_PROP(viewerType, app); JS_STATIC_PROP(viewerVariation, app); - JS_STATIC_PROP(viewerVersion, app); + JS_STATIC_PROP(viewerVersion, app); JS_STATIC_METHOD(alert, app); JS_STATIC_METHOD(beep, app); diff --git a/fpdfsdk/include/javascript/color.h b/fpdfsdk/include/javascript/color.h index 8aab76fffe..df863b552f 100644 --- a/fpdfsdk/include/javascript/color.h +++ b/fpdfsdk/include/javascript/color.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_COLOR_H_ @@ -18,13 +18,13 @@ public: FX_BOOL black(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL blue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL cyan(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL dkGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL gray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL green(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL ltGray(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL magenta(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); - FX_BOOL red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); + FX_BOOL red(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL transparent(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL white(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); FX_BOOL yellow(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError); @@ -32,7 +32,7 @@ public: FX_BOOL convert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); FX_BOOL equal(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); -public: +public: static void ConvertPWLColorToArray(const CPWL_Color& color, CJS_Array& array); static void ConvertArrayToPWLColor(CJS_Array& array, CPWL_Color& color); @@ -61,13 +61,13 @@ public: JS_STATIC_PROP(black, color); JS_STATIC_PROP(blue, color); - JS_STATIC_PROP(cyan, color); + JS_STATIC_PROP(cyan, color); JS_STATIC_PROP(dkGray, color); JS_STATIC_PROP(gray, color); JS_STATIC_PROP(green, color); JS_STATIC_PROP(ltGray, color); JS_STATIC_PROP(magenta, color); - JS_STATIC_PROP(red, color); + JS_STATIC_PROP(red, color); JS_STATIC_PROP(transparent, color); JS_STATIC_PROP(white, color); JS_STATIC_PROP(yellow, color); diff --git a/fpdfsdk/include/javascript/console.h b/fpdfsdk/include/javascript/console.h index d49ea418eb..0cbc291b44 100644 --- a/fpdfsdk/include/javascript/console.h +++ b/fpdfsdk/include/javascript/console.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_CONSOLE_H_ @@ -22,7 +22,7 @@ public: FX_BOOL show(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError); }; -class CJS_Console : public CJS_Object +class CJS_Console : public CJS_Object { public: CJS_Console(JSFXObject pObject) : CJS_Object(pObject) {}; diff --git a/fpdfsdk/include/javascript/event.h b/fpdfsdk/include/javascript/event.h index f43def973a..91a38ba487 100644 --- a/fpdfsdk/include/javascript/event.h +++ b/fpdfsdk/include/javascript/event.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_EVENT_H_ diff --git a/fpdfsdk/include/javascript/global.h b/fpdfsdk/include/javascript/global.h index 3c8972c67c..83e07f67c3 100644 --- a/fpdfsdk/include/javascript/global.h +++ b/fpdfsdk/include/javascript/global.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_GLOBAL_H_ @@ -58,7 +58,7 @@ private: void UpdateGlobalPersistentVariables(); void CommitGlobalPersisitentVariables(); void DestroyGlobalPersisitentVariables(); - FX_BOOL SetGlobalVariables(const FX_CHAR* 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); @@ -78,7 +78,7 @@ public: CJS_Global(JSFXObject pObject) : CJS_Object(pObject) {}; virtual ~CJS_Global(void){}; - virtual FX_BOOL InitInstance(IFXJS_Context* cc); + virtual FX_BOOL InitInstance(IFXJS_Context* cc); DECLARE_SPECIAL_JS_CLASS(CJS_Global); diff --git a/fpdfsdk/include/javascript/report.h b/fpdfsdk/include/javascript/report.h index 9705adac88..56f742ce08 100644 --- a/fpdfsdk/include/javascript/report.h +++ b/fpdfsdk/include/javascript/report.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_REPORT_H_ diff --git a/fpdfsdk/include/javascript/util.h b/fpdfsdk/include/javascript/util.h index 07f52ab8ce..ca4db349da 100644 --- a/fpdfsdk/include/javascript/util.h +++ b/fpdfsdk/include/javascript/util.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_JAVASCRIPT_UTIL_H_ diff --git a/fpdfsdk/include/pdfwindow/IPDFWindow.h b/fpdfsdk/include/pdfwindow/IPDFWindow.h index 0191cac639..2774f70e7c 100644 --- a/fpdfsdk/include/pdfwindow/IPDFWindow.h +++ b/fpdfsdk/include/pdfwindow/IPDFWindow.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_IPDFWINDOW_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_Button.h b/fpdfsdk/include/pdfwindow/PWL_Button.h index 9141cf047c..2bf2eea865 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Button.h +++ b/fpdfsdk/include/pdfwindow/PWL_Button.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_BUTTON_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_Caret.h b/fpdfsdk/include/pdfwindow/PWL_Caret.h index 8efbf79341..6838bc49e7 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Caret.h +++ b/fpdfsdk/include/pdfwindow/PWL_Caret.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_CARET_H_ @@ -34,7 +34,7 @@ public: virtual void InvalidateRect(CPDF_Rect * pRect = NULL); virtual void SetVisible(FX_BOOL bVisible) {} virtual void TimerProc(); - void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot); + void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot); CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset); void SetInvalidRect(CPDF_Rect rc) {m_rcInvalid = rc;} diff --git a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h index b82330c6b9..3f8604fb62 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ComboBox.h +++ b/fpdfsdk/include/pdfwindow/PWL_ComboBox.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_COMBOBOX_H_ @@ -48,7 +48,7 @@ public: }; -class PWL_CLASS CPWL_ComboBox : public CPWL_Wnd +class PWL_CLASS CPWL_ComboBox : public CPWL_Wnd { public: CPWL_ComboBox(); @@ -58,7 +58,7 @@ public: virtual CFX_ByteString GetClassName() const; virtual void OnCreate(PWL_CREATEPARAM & cp); - virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag); + virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag); virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag); virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); @@ -67,13 +67,13 @@ public: virtual void RePosChildWnd(); virtual CPDF_Rect GetFocusRect() const; - + virtual void SetFocus(); virtual void KillFocus(); FX_BOOL IsModified() const; -public: +public: void SetFillerNotify(IPWL_Filler_Notify* pNotify); CFX_WideString GetText() const; @@ -91,13 +91,13 @@ public: void SetSelectText(); -private: +private: void CreateEdit(const PWL_CREATEPARAM & cp); void CreateButton(const PWL_CREATEPARAM & cp); void CreateListBox(const PWL_CREATEPARAM & cp); void SetPopup(FX_BOOL bPopup); - + private: CPWL_CBEdit* m_pEdit; CPWL_CBButton* m_pButton; diff --git a/fpdfsdk/include/pdfwindow/PWL_Edit.h b/fpdfsdk/include/pdfwindow/PWL_Edit.h index 81500e90ad..6b31b9230d 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Edit.h +++ b/fpdfsdk/include/pdfwindow/PWL_Edit.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDIT_H_ @@ -19,10 +19,10 @@ class IPWL_Filler_Notify { public: virtual ~IPWL_Filler_Notify() { } - virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, + virtual void QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX_FLOAT fPopupMax, int32_t & nRet, FX_FLOAT & fPopupRet) = 0; //nRet: (0:bottom 1:top) virtual void OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, - CFX_WideString & strChange, const CFX_WideString& strChangeEx, + CFX_WideString & strChange, const CFX_WideString& strChangeEx, int nSelStart, int nSelEnd, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) = 0; virtual void OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit, FX_DWORD nFlag) = 0; @@ -57,8 +57,8 @@ public: virtual CPDF_Rect GetFocusRect() const; -public: - void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, FX_BOOL bPaint = TRUE); //0:left 1:right 2:middle +public: + void SetAlignFormatH(PWL_EDIT_ALIGNFORMAT_H nFormat = PEAH_LEFT, FX_BOOL bPaint = TRUE); //0:left 1:right 2:middle void SetAlignFormatV(PWL_EDIT_ALIGNFORMAT_V nFormat = PEAV_TOP, FX_BOOL bPaint = TRUE); //0:top 1:bottom 2:center void SetCharArray(int32_t nCharArray); @@ -85,18 +85,18 @@ public: void ReplaceSel(const FX_WCHAR* csText); CFX_ByteString GetTextAppearanceStream(const CPDF_Point & ptOffset) const; - CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset) const; + CFX_ByteString GetCaretAppearanceStream(const CPDF_Point & ptOffset) const; CFX_ByteString GetSelectAppearanceStream(const CPDF_Point & ptOffset) const; - FX_BOOL IsTextFull() const; + FX_BOOL IsTextFull() const; static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont, const CPDF_Rect& rcPlate, int32_t nCharArray); void SetFillerNotify(IPWL_Filler_Notify* pNotify) {m_pFillerNotify = pNotify;} - void GeneratePageObjects(CPDF_PageObjects* pPageObjects, + void GeneratePageObjects(CPDF_PageObjects* pPageObjects, const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray); - void GeneratePageObjects(CPDF_PageObjects* pPageObjects, + void GeneratePageObjects(CPDF_PageObjects* pPageObjects, const CPDF_Point& ptOffset); protected: @@ -113,7 +113,7 @@ protected: virtual void OnInsertText(const CPVT_WordPlace& place, const CPVT_WordPlace& oldplace); virtual void OnAddUndo(IFX_Edit_UndoItem* pUndoItem); -private: +private: CPVT_WordRange GetSelectWordRange() const; virtual void ShowVScrollBar(FX_BOOL bShow); FX_BOOL IsVScrollBarVisible() const; diff --git a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h index bfa1868b9e..9b088b1162 100644 --- a/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h +++ b/fpdfsdk/include/pdfwindow/PWL_EditCtrl.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_EDITCTRL_H_ @@ -70,16 +70,16 @@ public: virtual FX_BOOL OnKeyDown(FX_WORD nChar, FX_DWORD nFlag); virtual FX_BOOL OnChar(FX_WORD nChar, FX_DWORD nFlag); - virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag); - virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag); + virtual FX_BOOL OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag); + virtual FX_BOOL OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag); virtual FX_BOOL OnMouseMove(const CPDF_Point & point, FX_DWORD nFlag); virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); - virtual void RePosChildWnd(); + virtual void RePosChildWnd(); virtual void SetFontSize(FX_FLOAT fFontSize); virtual FX_FLOAT GetFontSize() const; - + public: virtual void SetText(const FX_WCHAR* csText); @@ -105,11 +105,11 @@ public: void Paint(); - void EnableRefresh(FX_BOOL bRefresh); + void EnableRefresh(FX_BOOL bRefresh); CPDF_Point GetScrollPos() const; void SetScrollPos(const CPDF_Point& point); - void SetEditNotify(IPWL_Edit_Notify* pNotify) {m_pEditNotify = pNotify;} + void SetEditNotify(IPWL_Edit_Notify* pNotify) {m_pEditNotify = pNotify;} void SetCharSet(uint8_t nCharSet){m_nCharSet = nCharSet;} int32_t GetCharSet() const; @@ -142,15 +142,15 @@ protected: protected: void GetCaretInfo(CPDF_Point & ptHead, CPDF_Point & ptFoot) const; void SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot); - + void SetEditCaret(FX_BOOL bVisible); protected: - virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, - FX_FLOAT fContentMin, FX_FLOAT fContentMax, + virtual void IOnSetScrollInfoX(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, + FX_FLOAT fContentMin, FX_FLOAT fContentMax, FX_FLOAT fSmallStep, FX_FLOAT fBigStep){} - virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, - FX_FLOAT fContentMin, FX_FLOAT fContentMax, + virtual void IOnSetScrollInfoY(FX_FLOAT fPlateMin, FX_FLOAT fPlateMax, + FX_FLOAT fContentMin, FX_FLOAT fContentMax, FX_FLOAT fSmallStep, FX_FLOAT fBigStep); virtual void IOnSetScrollPosX(FX_FLOAT fx){} virtual void IOnSetScrollPosY(FX_FLOAT fy); @@ -166,7 +166,7 @@ protected: IFX_Edit* m_pEdit; CPWL_Caret* m_pEditCaret; FX_BOOL m_bMouseDown; - IPWL_Edit_Notify* m_pEditNotify; + IPWL_Edit_Notify* m_pEditNotify; private: int32_t m_nCharSet; diff --git a/fpdfsdk/include/pdfwindow/PWL_FontMap.h b/fpdfsdk/include/pdfwindow/PWL_FontMap.h index f83575b66f..d32cc93078 100644 --- a/fpdfsdk/include/pdfwindow/PWL_FontMap.h +++ b/fpdfsdk/include/pdfwindow/PWL_FontMap.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_FONTMAP_H_ @@ -85,9 +85,9 @@ public: static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset); CPDF_Font* AddFontToDocument(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_t nCharset); - static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName); + static FX_BOOL IsStandardFont(const CFX_ByteString& sFontName); CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName); - CPDF_Font* AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, + CPDF_Font* AddSystemFont(CPDF_Document* pDoc, CFX_ByteString& sFontName, uint8_t nCharset); protected: diff --git a/fpdfsdk/include/pdfwindow/PWL_Icon.h b/fpdfsdk/include/pdfwindow/PWL_Icon.h index 1a2adf6469..44a5c0cbaf 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Icon.h +++ b/fpdfsdk/include/pdfwindow/PWL_Icon.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICON_H_ @@ -23,7 +23,7 @@ public: virtual CPDF_Stream * GetPDFStream(); public: - void SetPDFStream(CPDF_Stream* pStream); + void SetPDFStream(CPDF_Stream* pStream); void GetImageSize(FX_FLOAT & fWidth,FX_FLOAT & fHeight); CPDF_Matrix GetImageMatrix(); CFX_ByteString GetImageAlias(); @@ -34,7 +34,7 @@ protected: CFX_ByteString m_sImageAlias; }; -class PWL_CLASS CPWL_Icon : public CPWL_Image +class PWL_CLASS CPWL_Icon : public CPWL_Image { public: CPWL_Icon(); diff --git a/fpdfsdk/include/pdfwindow/PWL_IconList.h b/fpdfsdk/include/pdfwindow/PWL_IconList.h index 74438c2afd..2f6b323773 100644 --- a/fpdfsdk/include/pdfwindow/PWL_IconList.h +++ b/fpdfsdk/include/pdfwindow/PWL_IconList.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_ICONLIST_H_ @@ -86,7 +86,7 @@ private: CPWL_IconList_Item* GetListItem(int32_t nItemIndex) const; void SelectItem(int32_t nItemIndex, FX_BOOL bSelect); int32_t FindItemIndex(const CPDF_Point& point); - + FX_BOOL m_nSelectIndex; IPWL_IconList_Notify* m_pNotify; FX_BOOL m_bEnableNotify; @@ -117,7 +117,7 @@ protected: virtual void OnCreated(); virtual void RePosChildWnd(); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); - + virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); private: diff --git a/fpdfsdk/include/pdfwindow/PWL_Label.h b/fpdfsdk/include/pdfwindow/PWL_Label.h index 6d9754dd80..7f28189199 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Label.h +++ b/fpdfsdk/include/pdfwindow/PWL_Label.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_LABEL_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h index 56a1fbf919..c107a0cf5e 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h +++ b/fpdfsdk/include/pdfwindow/PWL_ListCtrl.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_LISTCTRL_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_Note.h b/fpdfsdk/include/pdfwindow/PWL_Note.h index ee6ec6ff02..a60eba30dd 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Note.h +++ b/fpdfsdk/include/pdfwindow/PWL_Note.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_NOTE_H_ @@ -70,7 +70,7 @@ public: virtual IPWL_NoteItem* GetSubItems(int32_t index) const = 0; virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem) = 0; virtual void SetFocus() = 0; - + virtual IPWL_NoteItem* GetParentItem() const = 0; virtual void* GetPrivateData() const = 0; virtual CFX_WideString GetAuthorName() const = 0; @@ -151,7 +151,7 @@ protected: virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void RePosChildWnd(); virtual void OnSetFocus(); - virtual void OnKillFocus(); + virtual void OnKillFocus(); private: FX_BOOL m_bEnableNotify; @@ -213,7 +213,7 @@ private: CPWL_Note_Edit* m_pEdit; }; -class PWL_CLASS CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem +class PWL_CLASS CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem { public: CPWL_NoteItem(); @@ -269,7 +269,7 @@ public: void SetNoteFocus(FX_BOOL bLast); void OnContentsValidate(); - + void OnCreateNoteItem(); protected: @@ -320,7 +320,7 @@ public: CFX_WideString GetReplyString() const; void SetReplyString(const CFX_WideString& string); - //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options + //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close / 5-options int32_t NoteHitTest(const CPDF_Point& point) const; CPDF_Rect GetCaptionRect() const {return m_rcCaption;} IPopup_Note* GetPopupNote() const {return m_pPopupNote;} @@ -346,7 +346,7 @@ private: CPWL_Note_CloseBox* m_pCloseBox; CPWL_Note_LBBox* m_pLBBox; CPWL_Note_RBBox* m_pRBBox; - CPWL_ScrollBar* m_pContentsBar; + CPWL_ScrollBar* m_pContentsBar; CPWL_Note_Options* m_pOptions; IPWL_NoteNotify* m_pNoteNotify; FX_BOOL m_bResizing; diff --git a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h index bf92399e88..0390222545 100644 --- a/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h +++ b/fpdfsdk/include/pdfwindow/PWL_ScrollBar.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_SCROLLBAR_H_ @@ -19,8 +19,8 @@ public: { } FX_FLOAT fContentMin; - FX_FLOAT fContentMax; - FX_FLOAT fPlateWidth; + FX_FLOAT fContentMax; + FX_FLOAT fPlateWidth; FX_FLOAT fBigStep; FX_FLOAT fSmallStep; }; @@ -38,7 +38,7 @@ enum PWL_SBBUTTON_TYPE PSBT_POS }; -class CPWL_SBButton : public CPWL_Wnd +class CPWL_SBButton : public CPWL_Wnd { public: CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,PWL_SBBUTTON_TYPE eButtonType); @@ -97,7 +97,7 @@ public: FX_FLOAT fSmallStep; }; -class CPWL_ScrollBar : public CPWL_Wnd +class CPWL_ScrollBar : public CPWL_Wnd { public: CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType = SBT_HSCROLL); @@ -115,13 +115,13 @@ public: virtual void OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam = 0, intptr_t lParam = 0); virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); - - FX_FLOAT GetScrollBarWidth() const; + + FX_FLOAT GetScrollBarWidth() const; PWL_SCROLLBAR_TYPE GetScrollBarType() const {return m_sbType;}; void SetNotifyForever(FX_BOOL bForever) {m_bNotifyForever = bForever;} -protected: +protected: void SetScrollRange(FX_FLOAT fMin,FX_FLOAT fMax,FX_FLOAT fClientWidth); void SetScrollPos(FX_FLOAT fPos); void MovePosButton(FX_BOOL bRefresh); @@ -156,7 +156,7 @@ private: CPWL_SBButton* m_pMaxButton; CPWL_SBButton* m_pPosButton; PWL_SCROLL_PRIVATEDATA m_sData; - FX_BOOL m_bMouseDown; + FX_BOOL m_bMouseDown; FX_BOOL m_bMinOrMax; FX_BOOL m_bNotifyForever; FX_FLOAT m_nOldPos; diff --git a/fpdfsdk/include/pdfwindow/PWL_Signature.h b/fpdfsdk/include/pdfwindow/PWL_Signature.h index be5ec58d1f..c94527772e 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Signature.h +++ b/fpdfsdk/include/pdfwindow/PWL_Signature.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_SIGNATURE_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h index 9b4ffd2341..f6659dfb00 100644 --- a/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h +++ b/fpdfsdk/include/pdfwindow/PWL_SpecialButton.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_SPECIALBUTTON_H_ diff --git a/fpdfsdk/include/pdfwindow/PWL_Utils.h b/fpdfsdk/include/pdfwindow/PWL_Utils.h index 9f121e80a8..2da0f42180 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Utils.h +++ b/fpdfsdk/include/pdfwindow/PWL_Utils.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_UTILS_H_ @@ -21,7 +21,7 @@ template<class T> T PWL_MAX (const T & i, const T & j) { return ((i > j) ? i : j #define PWL_PDF2WIN(color) (uint8_t(color*255)) #define PWL_WIN2PDF(color) ((FX_FLOAT)((FX_FLOAT)color/255.0f)) -#define PWL_MAKEDWORD(low,high) ((FX_DWORD)((FX_WORD)(low) | (FX_DWORD)(((FX_WORD)(high))<<16))) +#define PWL_MAKEDWORD(low,high) ((FX_DWORD)((FX_WORD)(low) | (FX_DWORD)(((FX_WORD)(high))<<16))) #define PWL_GETLOWWORD(dword) ((FX_WORD)(dword)) #define PWL_GETHIGHWORD(dword) ((FX_WORD)(dword>>16)) @@ -137,7 +137,7 @@ public: IFX_Edit_FontMap * pFontMap, CPDF_Stream * pIconStream, CPDF_IconFit & IconFit, - const CFX_WideString & sLabel, + const CFX_WideString & sLabel, const CPWL_Color & crText, FX_FLOAT fFontSize, int32_t nLayOut); @@ -148,7 +148,7 @@ public: int32_t nStyle, const CPWL_Color & crText); - static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL, + static CFX_ByteString GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL, FX_BOOL bContinuous = TRUE, FX_WORD SubWord = 0); static CFX_ByteString GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange = NULL); @@ -177,13 +177,13 @@ public: static void DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_BOOL bVertical, FX_BOOL bHorizontal, CPDF_Rect rect, int32_t nTransparancy, int32_t nStartGray, int32_t nEndGray); - static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, - const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, + static void DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, + const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IPWL_SpellCheck* pSpellCheck); public: static void ConvertCMYK2RGB(FX_FLOAT dC,FX_FLOAT dM,FX_FLOAT dY,FX_FLOAT dK,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB); static void ConvertRGB2CMYK(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dC,FX_FLOAT &dM,FX_FLOAT &dY,FX_FLOAT &dK); - + static void ConvertRGB2GRAY(FX_FLOAT dR,FX_FLOAT dG,FX_FLOAT dB,FX_FLOAT &dGray); static void ConvertGRAY2RGB(FX_FLOAT dGray,FX_FLOAT &dR,FX_FLOAT &dG,FX_FLOAT &dB); @@ -193,10 +193,10 @@ public: static void PWLColorToARGB(const CPWL_Color& color, int32_t& alpha, FX_FLOAT& red, FX_FLOAT& green, FX_FLOAT& blue); public: - static CFX_ByteString GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill, + static CFX_ByteString GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke = PWL_DEFAULT_BLACKCOLOR); static void DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, - int32_t nType, const CPDF_Rect & rect, const CPWL_Color& crFill, + int32_t nType, const CPDF_Rect & rect, const CPWL_Color& crFill, const CPWL_Color& crStroke, const int32_t nTransparancy); private: diff --git a/fpdfsdk/include/pdfwindow/PWL_Wnd.h b/fpdfsdk/include/pdfwindow/PWL_Wnd.h index e74dc88c5c..3ef4e67620 100644 --- a/fpdfsdk/include/pdfwindow/PWL_Wnd.h +++ b/fpdfsdk/include/pdfwindow/PWL_Wnd.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_INCLUDE_PDFWINDOW_PWL_WND_H_ @@ -24,7 +24,7 @@ class IPWL_SpellCheck; #ifdef FX_READER_DLL #ifdef PWL_EXPORT #define PWL_CLASS __declspec(dllexport) - #define PWL_FUNCTION PWL_CLASS + #define PWL_FUNCTION PWL_CLASS #else #define PWL_CLASS #define PWL_FUNCTION @@ -124,7 +124,7 @@ struct PWL_CLASS CPWL_Color CPWL_Color(int32_t r, int32_t g, int32_t b) : nColorType(COLORTYPE_RGB), fColor1(r/255.0f), fColor2(g/255.0f), fColor3(b/255.0f), fColor4(0) {} - + void ConvertColorType(int32_t other_nColorType); /* @@ -133,13 +133,13 @@ struct PWL_CLASS CPWL_Color COLORTYPE_CMYK COLORTYPE_GRAY */ - int32_t nColorType; + int32_t nColorType; FX_FLOAT fColor1,fColor2,fColor3,fColor4; }; inline FX_BOOL operator == (const CPWL_Color &c1, const CPWL_Color &c2) { - return c1.nColorType == c2.nColorType && + return c1.nColorType == c2.nColorType && c1.fColor1 - c2.fColor1 < 0.0001 && c1.fColor1 - c2.fColor1 > -0.0001 && c1.fColor2 - c2.fColor2 < 0.0001 && c1.fColor2 - c2.fColor2 > -0.0001 && c1.fColor3 - c2.fColor3 < 0.0001 && c1.fColor3 - c2.fColor3 > -0.0001 && @@ -174,7 +174,7 @@ class IPWL_SpellCheck public: virtual ~IPWL_SpellCheck() { } virtual FX_BOOL CheckWord(const FX_CHAR* sWord) = 0; - virtual void SuggestWords(const FX_CHAR* sWord, CFX_ByteStringArray & sSuggest) = 0; + virtual void SuggestWords(const FX_CHAR* sWord, CFX_ByteStringArray & sSuggest) = 0; }; class IPWL_Provider @@ -224,7 +224,7 @@ public: sTextStrokeColor(), nTransparency(255), fFontSize(PWL_DEFAULT_FONTSIZE), - sDash(3,0,0), + sDash(3,0,0), pAttachedData(NULL), pParentWnd(NULL), pMsgControl(NULL), @@ -233,7 +233,7 @@ public: { } - CPDF_Rect rcRectWnd; //required + CPDF_Rect rcRectWnd; //required IFX_SystemHandler* pSystemHandler; //required IFX_Edit_FontMap* pFontMap; //required for text window IPWL_Provider* pProvider; //required for self coordinate @@ -268,7 +268,7 @@ public: static void TimerProc(int32_t idEvent); private: - int32_t m_nTimerID; + int32_t m_nTimerID; CPWL_TimerHandler* m_pAttached; IFX_SystemHandler* m_pSystemHandler; }; @@ -296,7 +296,7 @@ public: virtual ~CPWL_Wnd(); void Create(const PWL_CREATEPARAM & cp); - virtual CFX_ByteString GetClassName() const; + virtual CFX_ByteString GetClassName() const; void Destroy(); void Move(const CPDF_Rect & rcNew,FX_BOOL bReset,FX_BOOL bRefresh); virtual void InvalidateRect(CPDF_Rect* pRect = NULL); @@ -341,13 +341,13 @@ public: virtual FX_BOOL IsModified() const {return FALSE;} - virtual void SetFontSize(FX_FLOAT fFontSize); + virtual void SetFontSize(FX_FLOAT fFontSize); - void SetBackgroundColor(const CPWL_Color & color); + void SetBackgroundColor(const CPWL_Color & color); void SetBorderColor(const CPWL_Color & color); void SetBorderWidth(int32_t nBorderWidth); void SetClipRect(const CPDF_Rect & rect); - void SetBorderStyle(int32_t eBorderStyle); + void SetBorderStyle(int32_t eBorderStyle); void SetBorderDash(const CPWL_Dash & sDash); CPDF_Rect GetOriginWindowRect() const; @@ -355,18 +355,18 @@ public: virtual CPDF_Rect GetClientRect() const; CPDF_Point GetCenterPoint() const; CPDF_Rect GetClientCenterSquare() const; - CPDF_Rect GetWindowCenterSquare() const; - int32_t GetBorderWidth() const; - FX_BOOL IsVisible() const {return m_bVisible;} + CPDF_Rect GetWindowCenterSquare() const; + int32_t GetBorderWidth() const; + FX_BOOL IsVisible() const {return m_bVisible;} FX_BOOL HasFlag(FX_DWORD dwFlags) const; void AddFlag(FX_DWORD dwFlags); void RemoveFlag(FX_DWORD dwFlags); - CPDF_Rect GetClipRect() const; - CPWL_Wnd* GetParentWindow() const; - int32_t GetBorderStyle() const; + CPDF_Rect GetClipRect() const; + CPWL_Wnd* GetParentWindow() const; + int32_t GetBorderStyle() const; CPWL_Dash GetBorderDash() const; void* GetAttachedData() const; - + FX_BOOL WndHitTest(const CPDF_Point & point) const; FX_BOOL ClientHitTest(const CPDF_Point & point) const; FX_BOOL IsCaptureMouse() const; @@ -380,7 +380,7 @@ public: IPWL_Provider* GetProvider() const; virtual IFX_SystemHandler* GetSystemHandler() const; IPWL_FocusHandler* GetFocusHandler() const; - + int32_t GetTransparency(); void SetTransparency(int32_t nTransparency); @@ -395,15 +395,15 @@ public: virtual CPDF_Rect ParentToChild(const CPDF_Rect& rect) const; //those methods only implemented by listctrl item - virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) {return 0;} - virtual FX_FLOAT GetItemLeftMargin() {return 0;} - virtual FX_FLOAT GetItemRightMargin() {return 0;} + virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth) {return 0;} + virtual FX_FLOAT GetItemLeftMargin() {return 0;} + virtual FX_FLOAT GetItemRightMargin() {return 0;} void EnableWindow(FX_BOOL bEnable); FX_BOOL IsEnabled(); virtual void SetCursor(); -protected: +protected: virtual void CreateChildWnd(const PWL_CREATEPARAM & cp); virtual void RePosChildWnd(); void GetAppearanceStream(CFX_ByteTextBuf & sAppStream); @@ -424,20 +424,20 @@ protected: virtual void OnDisabled(); void SetNotifyFlag(FX_BOOL bNotifying = TRUE){m_bNotifying = bNotifying;}; - + FX_BOOL IsValid() const; - PWL_CREATEPARAM GetCreationParam() const; - FX_BOOL IsNotifying() const {return m_bNotifying;} - + PWL_CREATEPARAM GetCreationParam() const; + FX_BOOL IsNotifying() const {return m_bNotifying;} + void InvalidateRectMove(const CPDF_Rect & rcOld, const CPDF_Rect & rcNew); void PWLtoWnd(const CPDF_Point & point, int32_t& x, int32_t& y) const; - FX_RECT PWLtoWnd(const CPDF_Rect & rect) const; + FX_RECT PWLtoWnd(const CPDF_Rect & rect) const; FX_HWND GetAttachedHWnd() const; - + FX_BOOL IsWndCaptureMouse(const CPWL_Wnd * pWnd) const; - FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const; - const CPWL_Wnd* GetRootWnd() const; + FX_BOOL IsWndCaptureKeyboard(const CPWL_Wnd * pWnd) const; + const CPWL_Wnd* GetRootWnd() const; FX_BOOL IsCTRLpressed(FX_DWORD nFlag) const; FX_BOOL IsSHIFTpressed(FX_DWORD nFlag) const; @@ -449,28 +449,28 @@ private: void RemoveChild(CPWL_Wnd * pWnd); void CreateScrollBar(const PWL_CREATEPARAM & cp); - void CreateVScrollBar(const PWL_CREATEPARAM & cp); + void CreateVScrollBar(const PWL_CREATEPARAM & cp); - void AjustStyle(); + void AjustStyle(); void CreateMsgControl(); void DestroyMsgControl(); - - CPWL_MsgControl* GetMsgControl() const; - + + CPWL_MsgControl* GetMsgControl() const; + protected: CFX_ArrayTemplate<CPWL_Wnd*> m_aChildren; private: PWL_CREATEPARAM m_sPrivateParam; - + CPWL_ScrollBar* m_pVScrollBar; CPDF_Rect m_rcWindow; CPDF_Rect m_rcClip; - FX_BOOL m_bCreated; + FX_BOOL m_bCreated; FX_BOOL m_bVisible; - FX_BOOL m_bNotifying; + FX_BOOL m_bNotifying; FX_BOOL m_bEnabled; }; diff --git a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp index abe30d85af..f4eb74bd72 100644 --- a/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp +++ b/fpdfsdk/src/formfiller/FFL_CBA_Fontmap.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FormFiller.h" @@ -22,7 +22,7 @@ CBA_FontMap::CBA_FontMap(CPDFSDK_Annot* pAnnot, IFX_SystemHandler* pSystemHandle m_pAnnotDict = pAnnot->GetPDFAnnot()->GetAnnotDict(); } -CBA_FontMap::CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict, +CBA_FontMap::CBA_FontMap(CPDF_Document* pDocument, CPDF_Dictionary* pAnnotDict, IFX_SystemHandler* pSystemHandler) : CPWL_FontMap(pSystemHandler), m_pDocument(pDocument), @@ -49,7 +49,7 @@ void CBA_FontMap::Initial(const FX_CHAR* fontname) if (!m_pDefaultFont) { - m_pDefaultFont = GetAnnotDefaultFont(m_sDefaultFontName); + m_pDefaultFont = GetAnnotDefaultFont(m_sDefaultFontName); if (m_pDefaultFont) { if (const CFX_SubstFont* pSubstFont = m_pDefaultFont->GetSubstFont()) @@ -118,7 +118,7 @@ CPDF_Document* CBA_FontMap::GetDocument() return m_pDocument; } -CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias, +CPDF_Font* CBA_FontMap::FindResFontSameCharset(CPDF_Dictionary* pResDict, CFX_ByteString& sFontAlias, int32_t nCharset) { if (!pResDict) return NULL; @@ -172,7 +172,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl CPDF_Dictionary* pAPDict = m_pAnnotDict->GetDict("AP"); - if (pAPDict == NULL) + if (pAPDict == NULL) { pAPDict = FX_NEW CPDF_Dictionary; m_pAnnotDict->SetAt("AP", pAPDict); @@ -184,7 +184,7 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl return; CPDF_Stream* pStream = pAPDict->GetStream(m_sAPType); - if (pStream == NULL) + if (pStream == NULL) { pStream = new CPDF_Stream(NULL, 0, NULL); int32_t objnum = m_pDocument->AddIndirectObject(pStream); @@ -208,10 +208,10 @@ void CBA_FontMap::AddFontToAnnotDict(CPDF_Font* pFont, const CFX_ByteString& sAl pStreamDict->SetAt("Resources", pStreamResList); } - if (pStreamResList) + if (pStreamResList) { CPDF_Dictionary* pStreamResFontList = pStreamResList->GetDict("Font"); - if (!pStreamResFontList) + if (!pStreamResFontList) { pStreamResFontList = new CPDF_Dictionary; int32_t objnum = m_pDocument->AddIndirectObject(pStreamResFontList); @@ -237,7 +237,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias) if (CPDF_Dictionary * pRootDict = m_pDocument->GetRoot()) pAcroFormDict = pRootDict->GetDict("AcroForm"); } - + CFX_ByteString sDA; CPDF_Object* pObj; if ((pObj = FPDF_GetFieldAttr(m_pAnnotDict, "DA"))) @@ -251,8 +251,8 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias) sDA = pObj ? pObj->GetString() : CFX_ByteString(); } } - - CPDF_Dictionary * pFontDict = NULL; + + CPDF_Dictionary * pFontDict = NULL; if (!sDA.IsEmpty()) { @@ -273,7 +273,7 @@ CPDF_Font* CBA_FontMap::GetAnnotDefaultFont(CFX_ByteString &sAlias) pFontDict = pResFontDict->GetDict(sAlias); if (bWidget) - { + { if (!pFontDict) { if (pAcroFormDict) diff --git a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp index dad485cac3..55d2d45bc2 100644 --- a/fpdfsdk/src/formfiller/FFL_CheckBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_CheckBox.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FormFiller.h" @@ -27,7 +27,7 @@ CPWL_Wnd* CFFL_CheckBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVie ASSERT(m_pWidget != NULL); pWnd->SetCheck(m_pWidget->IsChecked()); - + return pWnd; } @@ -46,7 +46,7 @@ FX_BOOL CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFla { switch (nChar) { - case FWL_VKEY_Return: + case FWL_VKEY_Return: case FWL_VKEY_Space: { CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); @@ -115,9 +115,9 @@ void CFFL_CheckBox::SaveData(CPDFSDK_PageView* pPageView) if (CPWL_CheckBox* pWnd = (CPWL_CheckBox*)GetPDFWindow(pPageView, FALSE)) { - + FX_BOOL bNewChecked = pWnd->IsChecked(); - + if (bNewChecked) { diff --git a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp index 8ae9254470..4ceb1e9af3 100644 --- a/fpdfsdk/src/formfiller/FFL_ComboBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ComboBox.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FormFiller.h" @@ -37,9 +37,9 @@ PWL_CREATEPARAM CFFL_ComboBox::GetCreateParam() ASSERT(m_pWidget != NULL); int nFlags = m_pWidget->GetFieldFlags(); - + if (nFlags & FIELDFLAG_EDIT) - { + { cp.dwFlags |= PCBS_ALLOWCUSTOMTEXT; } @@ -111,7 +111,7 @@ FX_BOOL CFFL_ComboBox::IsDataChanged(CPDFSDK_PageView* pPageView) return nCurSel != m_pWidget->GetSelectedIndex(0); } } - + return FALSE; } @@ -143,7 +143,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) bSetValue = FALSE; CFX_WideString sOldValue; - + if (bSetValue) { @@ -161,7 +161,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) SetChangeMark(); m_pWidget->GetPDFPage(); - + } } @@ -175,7 +175,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) { if (CPWL_Edit* pEdit = (CPWL_Edit*)*pComboBox) { - fa.bFieldFull = pEdit->IsTextFull(); + fa.bFieldFull = pEdit->IsTextFull(); int nSelStart = 0; int nSelEnd = 0; pEdit->GetSel(nSelStart, nSelEnd); @@ -213,7 +213,7 @@ void CFFL_ComboBox::SaveData(CPDFSDK_PageView* pPageView) -void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, +void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa) { switch (type) @@ -233,7 +233,7 @@ void CFFL_ComboBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAc } } -FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, +FX_BOOL CFFL_ComboBox::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew) { switch (type) @@ -287,11 +287,11 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRe { if (bRestoreValue) SaveState(pPageView); - + DestroyPDFWindow(pPageView); - + CPWL_Wnd* pRet = NULL; - + if (bRestoreValue) { RestoreState(pPageView); @@ -299,18 +299,18 @@ CPWL_Wnd* CFFL_ComboBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRe } else pRet = GetPDFWindow(pPageView, TRUE); - + m_pWidget->UpdateField(); - + return pRet; } void CFFL_ComboBox::OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag) { ASSERT(m_pWidget != NULL); - + int nFlags = m_pWidget->GetFieldFlags(); - + if (nFlags & FIELDFLAG_COMMITONSELCHANGE) { if (m_bValid) @@ -412,14 +412,14 @@ void CFFL_ComboBox::OnAddUndo(CPWL_Edit* pEdit) CFX_WideString CFFL_ComboBox::GetSelectExportText() { CFX_WideString swRet; - + int nExport = -1; CPDFSDK_PageView *pPageView = GetCurPageView(); if (CPWL_ComboBox * pComboBox = (CPWL_ComboBox*)GetPDFWindow(pPageView, FALSE)) { nExport = pComboBox->GetSelect(); } - + if (nExport >= 0) { if (CPDF_FormField * pFormField = m_pWidget->GetFormField()) @@ -429,6 +429,6 @@ CFX_WideString CFFL_ComboBox::GetSelectExportText() swRet = pFormField->GetOptionLabel(nExport); } } - + return swRet; } diff --git a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp index 1148c78a5f..540619692b 100644 --- a/fpdfsdk/src/formfiller/FFL_FormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_FormFiller.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com @@ -22,7 +22,7 @@ CFFL_FormFiller::CFFL_FormFiller(CPDFDoc_Environment* pApp, CPDFSDK_Annot* pAnno m_pAnnot(pAnnot), m_bValid(FALSE), m_ptOldPos(0,0) -{ +{ m_pWidget = (CPDFSDK_Widget*) pAnnot; } @@ -89,7 +89,7 @@ FX_RECT CFFL_FormFiller::GetViewBBox(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* return rect.GetOutterRect(); } -void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, +void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow,*/ FX_DWORD dwFlags) { @@ -109,14 +109,14 @@ void CFFL_FormFiller::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_A } } -void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, +void CFFL_FormFiller::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow,*/ FX_DWORD dwFlags) { ASSERT(pAnnot != NULL); - + CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; - + pWidget->DrawAppearance(pDevice, pUser2Device, CPDF_Annot::Normal, NULL); } @@ -146,7 +146,7 @@ void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pA FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE)) - { + { m_bValid = TRUE; FX_RECT rect = GetViewBBox(pPageView,pAnnot); InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); @@ -163,7 +163,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Anno FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { FX_RECT rcFFL = GetViewBBox(pPageView, pAnnot); InvalidateRect(rcFFL.left, rcFFL.top, rcFFL.right, rcFFL.bottom); pWnd->OnLButtonUp(WndtoPWL(pPageView, point),nFlags); @@ -176,7 +176,7 @@ FX_BOOL CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* FX_BOOL CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { pWnd->OnLButtonDblClk(WndtoPWL(pPageView, point),nFlags); return TRUE; } @@ -192,7 +192,7 @@ FX_BOOL CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* } if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { pWnd->OnMouseMove(WndtoPWL(pPageView, point),nFlags); return TRUE; } @@ -205,7 +205,7 @@ FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot if (!IsValid()) return FALSE; if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE)) - { + { return pWnd->OnMouseWheel(zDelta, WndtoPWL(pPageView, point),nFlags); } @@ -215,7 +215,7 @@ FX_BOOL CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView *pPageView, CPDFSDK_Annot FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, TRUE)) - { + { pWnd->OnRButtonDown(WndtoPWL(pPageView, point),nFlags); return TRUE; } @@ -226,7 +226,7 @@ FX_BOOL CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView *pPageView, CPDFSDK_Anno FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { pWnd->OnRButtonUp(WndtoPWL(pPageView, point),nFlags); return TRUE; } @@ -237,7 +237,7 @@ FX_BOOL CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* FX_BOOL CFFL_FormFiller::OnRButtonDblClk(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_UINT nFlags, const CPDF_Point& point) { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { pWnd->OnRButtonDblClk(WndtoPWL(pPageView, point),nFlags); return TRUE; } @@ -253,7 +253,7 @@ FX_BOOL CFFL_FormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_U ASSERT(pPageView != NULL); if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { return pWnd->OnKeyDown(nKeyCode,nFlags); } } @@ -269,7 +269,7 @@ FX_BOOL CFFL_FormFiller::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nF ASSERT(pPageView != NULL); if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { return pWnd->OnChar(nChar,nFlags); } } @@ -296,23 +296,23 @@ FX_BOOL CFFL_FormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) CPDFSDK_PageView* pPageView = pDoc->GetPageView(pPage); ASSERT(pPageView != NULL); - + CPWL_Wnd * pWnd = NULL; if ( (pWnd = GetPDFWindow(pPageView, TRUE))) - { + { pWnd->SetFocus(); } m_bValid = TRUE; - - - + + + m_bValid = TRUE; FX_RECT rcRect = GetViewBBox(pPageView,pAnnot); InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); - + return TRUE; } @@ -326,10 +326,10 @@ FX_BOOL CFFL_FormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag) CommitData(pPageView, nFlag); if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, FALSE)) - { + { pWnd->KillFocus(); } - + switch (m_pWidget->GetFieldType()) { case FIELDTYPE_PUSHBUTTON: @@ -357,10 +357,10 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() PWL_CREATEPARAM cp; - cp.pParentWnd = NULL; + cp.pParentWnd = NULL; cp.pProvider = this; cp.rcRectWnd = GetPDFWindowRect(); - + FX_DWORD dwCreateFlags = PWS_BORDER | PWS_BACKGROUND | PWS_VISIBLE; ASSERT(m_pWidget != NULL); @@ -369,7 +369,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags(); if (dwFieldFlag & FIELDFLAG_READONLY) - { + { dwCreateFlags |= PWS_READONLY; } @@ -393,7 +393,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() cp.fFontSize = m_pWidget->GetFontSize(); cp.dwBorderWidth = m_pWidget->GetBorderWidth(); - + int nBorderStyle = m_pWidget->GetBorderStyle(); switch (nBorderStyle) @@ -403,7 +403,7 @@ PWL_CREATEPARAM CFFL_FormFiller::GetCreateParam() break; case BBS_DASH: cp.nBorderStyle = PBS_DASH; - cp.sDash = CPWL_Dash(3,3,0); + cp.sDash = CPWL_Dash(3,3,0); break; case BBS_BEVELED: cp.nBorderStyle = PBS_BEVELED; @@ -500,7 +500,7 @@ CPDF_Matrix CFFL_FormFiller::GetWindowMatrix(void* pAttachedData) pPrivateData->pPageView->GetCurrentMatrix(mtPageView); CPDF_Matrix mt = GetCurMatrix(); mt.Concat(mtPageView); - + return mt; } } @@ -520,7 +520,7 @@ CPDF_Matrix CFFL_FormFiller::GetCurMatrix() switch (m_pWidget->GetRotate()) { default: - case 0: + case 0: mt = CPDF_Matrix(1,0,0,1,0,0); break; case 90: @@ -578,7 +578,7 @@ CPDFSDK_PageView* CFFL_FormFiller::GetCurPageView() CPDF_Rect CFFL_FormFiller::GetFocusBox(CPDFSDK_PageView* pPageView) { if (CPWL_Wnd * pWnd = GetPDFWindow(pPageView, FALSE)) - { + { CPDF_Rect rcFocus = FFLtoWnd(pPageView, PWLtoFFL(pWnd->GetFocusRect())); ASSERT(pPageView); CPDF_Rect rcPage = pPageView->GetPDFPage()->GetPageBBox(); @@ -594,7 +594,7 @@ CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect) { CPDF_Matrix mt; mt.SetReverse(GetCurMatrix()); - + CPDF_Rect temp = rect; mt.TransformRect(temp); @@ -604,7 +604,7 @@ CPDF_Rect CFFL_FormFiller::FFLtoPWL(const CPDF_Rect& rect) CPDF_Rect CFFL_FormFiller::PWLtoFFL(const CPDF_Rect& rect) { CPDF_Matrix mt = GetCurMatrix(); - + CPDF_Rect temp = rect; mt.TransformRect(temp); @@ -635,10 +635,10 @@ CPDF_Point CFFL_FormFiller::PWLtoFFL(const CPDF_Point & point) CPDF_Point CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Point& pt) { // ASSERT(pPageView != NULL); -// +// // CPDF_Point point(0.0f, 0.0f); // pPageView->WindowToDoc(pt.x, pt.y, point.x, point.y); -// +// return FFLtoPWL(pt); // return CPDF_Point(0, 0); } @@ -646,10 +646,10 @@ CPDF_Point CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, const CPDF_Poi CPDF_Rect CFFL_FormFiller::FFLtoWnd(CPDFSDK_PageView* pPageView, const CPDF_Rect & rect) { // FX_RECT rcRet(0,0,0,0); -// -// ASSERT(pPageView != NULL); +// +// ASSERT(pPageView != NULL); // pPageView->DocToWindow(rect, rcRet); -// +// return rect; } @@ -728,12 +728,12 @@ void CFFL_FormFiller::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::A fa.sValue = m_pWidget->GetValue(); } -void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, +void CFFL_FormFiller::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa) { } -FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, +FX_BOOL CFFL_FormFiller::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew) { return FALSE; @@ -749,7 +749,7 @@ void CFFL_FormFiller::RestoreState(CPDFSDK_PageView* pPageView) CPWL_Wnd* CFFL_FormFiller::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRestoreValue) { - return GetPDFWindow(pPageView, FALSE); + return GetPDFWindow(pPageView, FALSE); } void CFFL_FormFiller::TimerProc() @@ -770,7 +770,7 @@ void CFFL_FormFiller::OnKeyStroke(FX_BOOL bKeyDown) void CFFL_FormFiller::EscapeFiller(CPDFSDK_PageView* pPageView, FX_BOOL bDestroyPDFWindow) { m_bValid = FALSE; - + FX_RECT rcRect = GetViewBBox(pPageView, m_pWidget); InvalidateRect(rcRect.left, rcRect.top, rcRect.right, rcRect.bottom); @@ -862,7 +862,7 @@ FX_BOOL CFFL_Button::OnLButtonUp(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAn m_bMouseDown = FALSE; m_pWidget->GetPDFPage(); - + FX_RECT rect = GetViewBBox(pPageView, pAnnot); InvalidateRect(rect.left, rect.top, rect.right, rect.bottom); @@ -876,7 +876,7 @@ FX_BOOL CFFL_Button::OnMouseMove(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAn return TRUE; } -void CFFL_Button::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, +void CFFL_Button::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow,*/ FX_DWORD dwFlags) { @@ -916,7 +916,7 @@ void CFFL_Button::OnDraw(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot } -void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, +void CFFL_Button::OnDrawDeactive(CPDFSDK_PageView *pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow, */FX_DWORD dwFlags) { diff --git a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp index 61fd04a0d7..4a5a7bcd96 100644 --- a/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp +++ b/fpdfsdk/src/formfiller/FFL_IFormFiller.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FFL_FormFiller.h" @@ -20,7 +20,7 @@ /* ----------------------------- CFFL_IFormFiller ----------------------------- */ -CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) : +CFFL_IFormFiller::CFFL_IFormFiller(CPDFDoc_Environment* pApp) : m_pApp(pApp), m_bNotifying(FALSE) { @@ -73,7 +73,7 @@ FX_RECT CFFL_IFormFiller::GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot } } -void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, +void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, /*const CRect& rcWindow,*/ FX_DWORD dwFlags) { @@ -87,9 +87,9 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_ if (pFormFiller->IsValid()) { pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); - + pAnnot->GetPDFPage(); - + CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc(); ASSERT(pDocument != NULL); @@ -100,23 +100,23 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_ if (!rcFocus.IsEmpty()) { CFX_PathData path; - + path.SetPointCount(5); path.SetPoint(0, rcFocus.left, rcFocus.top, FXPT_MOVETO); path.SetPoint(1, rcFocus.left, rcFocus.bottom, FXPT_LINETO); path.SetPoint(2, rcFocus.right, rcFocus.bottom, FXPT_LINETO); path.SetPoint(3, rcFocus.right, rcFocus.top, FXPT_LINETO); path.SetPoint(4, rcFocus.left, rcFocus.top, FXPT_LINETO); - + CFX_GraphStateData gsd; - gsd.SetDashCount(1); + gsd.SetDashCount(1); gsd.m_DashArray[0] = 1.0f; - gsd.m_DashPhase = 0; - + gsd.m_DashPhase = 0; + gsd.m_LineWidth = 1.0f; pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255,0,0,0), FXFILL_ALTERNATE); - // ::DrawFocusRect(hDC, &rcFocus); + // ::DrawFocusRect(hDC, &rcFocus); } } @@ -133,7 +133,7 @@ void CFFL_IFormFiller::OnDraw(CPDFSDK_PageView* pPageView, /*HDC hDC,*/ CPDFSDK_ { pWidget->DrawShadow(pDevice, pPageView); } - + } } @@ -167,30 +167,30 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - + if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; if (pWidget->GetAAction(CPDF_AAction::CursorEnter)) { m_bNotifying = TRUE; - + int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); - + ASSERT(pPageView != NULL); - - - + + + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::CursorEnter, fa, pPageView ); m_bNotifying = FALSE; - + //if ( !IsValidAnnot(pPageView, pAnnot) ) return; - + if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) @@ -200,7 +200,7 @@ void CFFL_IFormFiller::OnMouseEnter(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* } } } - + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { pFormFiller->OnMouseEnter(pPageView, pAnnot); @@ -211,7 +211,7 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - + if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; @@ -221,20 +221,20 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); - + ASSERT(pPageView != NULL); - - - + + + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); - + pWidget->OnAAction(CPDF_AAction::CursorExit, fa, pPageView); m_bNotifying = FALSE; - + //if (!IsValidAnnot(pPageView, pAnnot)) return; - + if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) @@ -244,7 +244,7 @@ void CFFL_IFormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* p } } } - + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { pFormFiller->OnMouseExit(pPageView, pAnnot); @@ -255,7 +255,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Ann { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - + if (!m_bNotifying) { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; @@ -265,19 +265,19 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Ann pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); - + ASSERT(pPageView != NULL); - - - + + + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlags); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlags); pWidget->OnAAction(CPDF_AAction::ButtonDown, fa, pPageView); m_bNotifying = FALSE; - + if (!IsValidAnnot(pPageView, pAnnot)) return TRUE; - + if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) @@ -287,12 +287,12 @@ FX_BOOL CFFL_IFormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Ann } } } - + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { return pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point); } - + return FALSE; } @@ -300,13 +300,13 @@ FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot { ASSERT(pAnnot != NULL); ASSERT(pAnnot->GetPDFAnnot()->GetSubType() == "Widget"); - + CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; // CReader_Page* pPage = pAnnot->GetPage(); // ASSERT(pPage != NULL); CPDFSDK_Document* pDocument = m_pApp->GetCurrentDoc(); - ASSERT(pDocument != NULL); - + ASSERT(pDocument != NULL); + switch (pWidget->GetFieldType()) { case FIELDTYPE_PUSHBUTTON: @@ -321,9 +321,9 @@ FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot pDocument->SetFocusAnnot(pAnnot); break; } - + FX_BOOL bRet = FALSE; - + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { bRet = pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); @@ -345,7 +345,7 @@ FX_BOOL CFFL_IFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPageView, FX_BOOL& bReset, FX_BOOL& bExit,FX_UINT nFlag) { ASSERT(pWidget != NULL); - + if (!m_bNotifying) { if (pWidget->GetAAction(CPDF_AAction::ButtonUp)) @@ -353,33 +353,33 @@ void CFFL_IFormFiller::OnButtonUp(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa m_bNotifying = TRUE; int nAge = pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); - + ASSERT(pPageView != NULL); // CReader_DocView* pDocView = pPageView->GetDocView(); // ASSERT(pDocView != NULL); - - - + + + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); pWidget->OnAAction(CPDF_AAction::ButtonUp, fa, pPageView); m_bNotifying = FALSE; - + if (!IsValidAnnot(pPageView, pWidget)) { bExit = TRUE; return; } - + if (nAge != pWidget->GetAppearanceAge()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) { pFormFiller->ResetPDFWindow(pPageView, nValueAge == pWidget->GetValueAge()); } - + bReset = TRUE; } } @@ -472,7 +472,7 @@ FX_BOOL CFFL_IFormFiller::OnKeyDown(CPDFSDK_Annot* pAnnot, FX_UINT nKeyCode, FX_ if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, FALSE)) { - return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags); + return pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlags); } return FALSE; @@ -529,25 +529,25 @@ FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) pWidget->GetAppearanceAge(); int nValueAge = pWidget->GetValueAge(); pWidget->ClearAppModified(); - - + + CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); ASSERT(pPageView != NULL); - + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); - + CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, TRUE); if(!pFormFiller) return FALSE; pFormFiller->GetActionData(pPageView, CPDF_AAction::GetFocus, fa); - + pWidget->OnAAction(CPDF_AAction::GetFocus, fa, pPageView); m_bNotifying = FALSE; - + // if (!IsValidAnnot(m_pApp, pDocument, pDocView, pPageView, pAnnot)) return FALSE; - + if (pWidget->IsAppModified()) { if (CFFL_FormFiller* pFormFiller = GetFormFiller(pWidget, FALSE)) @@ -557,7 +557,7 @@ FX_BOOL CFFL_IFormFiller::OnSetFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) } } } - + if (CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot, TRUE)) { if (pFormFiller->OnSetFocus(pAnnot, nFlag)) @@ -587,19 +587,19 @@ FX_BOOL CFFL_IFormFiller::OnKillFocus(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) { m_bNotifying = TRUE; pWidget->ClearAppModified(); - + CPDFSDK_PageView* pPageView = pWidget->GetPageView(); ASSERT(pPageView != NULL); - + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); - + pFormFiller->GetActionData(pPageView, CPDF_AAction::LoseFocus, fa); - + pWidget->OnAAction(CPDF_AAction::LoseFocus, fa, pPageView); m_bNotifying = FALSE; - + } } } @@ -634,16 +634,16 @@ FX_BOOL CFFL_IFormFiller::IsFillingAllowed(CPDFSDK_Widget* pWidget) { CPDF_Page* pPage = pWidget->GetPDFPage(); ASSERT(pPage != NULL); - + CPDF_Document* pDocument = pPage->m_pDocument; ASSERT(pDocument != NULL); - + FX_DWORD dwPermissions = pDocument->GetUserPermissions(); - return (dwPermissions&FPDFPERM_FILL_FORM) || - (dwPermissions&FPDFPERM_ANNOT_FORM) || + return (dwPermissions&FPDFPERM_FILL_FORM) || + (dwPermissions&FPDFPERM_ANNOT_FORM) || (dwPermissions&FPDFPERM_MODIFY); } - return TRUE; + return TRUE; } CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister) @@ -659,7 +659,7 @@ CFFL_FormFiller* CFFL_IFormFiller::GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL if (bRegister) { - CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; + CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot; int nFieldType = pWidget->GetFieldType(); switch(nFieldType) @@ -728,7 +728,7 @@ void CFFL_IFormFiller::QueryWherePopup(void* pPrivateData, FX_FLOAT fPopupMin,FX CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; - + CPDF_Rect rcPageView(0,0,0,0); @@ -837,8 +837,8 @@ void CFFL_IFormFiller::OnSetWindowRect(void* pPrivateData, const CPDF_Rect & rcW } } -void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, CFX_WideString& strChange, - const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, +void CFFL_IFormFiller::OnKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, CFX_WideString& strChange, + const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit) { ASSERT(pPrivateData != NULL); @@ -864,8 +864,8 @@ void CFFL_IFormFiller::OnKeyStrokeCommit(CPDFSDK_Widget* pWidget, CPDFSDK_PageVi ASSERT(pPageView != NULL); // CReader_DocView* pDocView = pPageView->GetDocView(); // ASSERT(pDocView != NULL); - - + + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); @@ -904,8 +904,8 @@ void CFFL_IFormFiller::OnValidate(CPDFSDK_Widget* pWidget, CPDFSDK_PageView* pPa ASSERT(pPageView != NULL); // CReader_DocView* pDocView = pPageView->GetDocView(); // ASSERT(pDocView != NULL); - - + + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); @@ -1228,17 +1228,17 @@ void CFFL_IFormFiller::DoPaste(CPDFSDK_Document* pDocument) } void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, int32_t nKeyCode, - CFX_WideString & strChange, const CFX_WideString& strChangeEx, + CFX_WideString & strChange, const CFX_WideString& strChangeEx, int nSelStart, int nSelEnd, FX_BOOL bKeyDown, FX_BOOL & bRC, FX_BOOL & bExit, FX_DWORD nFlag) { ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; ASSERT(pData->pWidget != NULL); - + CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); ASSERT(pFormFiller != NULL); - + if (pFormFiller->IsFieldFull(pData->pPageView)) { FX_BOOL bFullExit = FALSE; @@ -1251,7 +1251,7 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData return; } } - + if (!m_bNotifying) { if (pData->pWidget->GetAAction(CPDF_AAction::KeyStroke)) @@ -1262,7 +1262,7 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData ASSERT(pData->pPageView != NULL); CPDFSDK_Document* pDocument = pData->pPageView->GetSDKDocument(); - + PDFSDK_FieldAction fa; fa.bModifier = m_pApp->FFI_IsCTRLKeyDown(nFlag); fa.bShift = m_pApp->FFI_IsSHIFTKeyDown(nFlag); @@ -1277,7 +1277,7 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData pFormFiller->GetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa); pFormFiller->SaveState(pData->pPageView); - + if (pData->pWidget->OnAAction(CPDF_AAction::KeyStroke, fa, pData->pPageView)) { if (!IsValidAnnot(pData->pPageView, pData->pWidget)) @@ -1286,14 +1286,14 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData m_bNotifying = FALSE; return; } - + if (nAge != pData->pWidget->GetAppearanceAge()) { CPWL_Wnd* pWnd = pFormFiller->ResetPDFWindow(pData->pPageView, nValueAge == pData->pWidget->GetValueAge()); pData = (CFFL_PrivateData*)pWnd->GetAttachedData(); bExit = TRUE; } - + if (fa.bRC) { pFormFiller->SetActionData(pData->pPageView, CPDF_AAction::KeyStroke, fa); @@ -1304,7 +1304,7 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData pFormFiller->RestoreState(pData->pPageView); bRC = FALSE; } - + if (pDocument->GetFocusAnnot() != pData->pWidget) { pFormFiller->CommitData(pData->pPageView,nFlag); @@ -1312,7 +1312,7 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData } } else - { + { if (!IsValidAnnot(pData->pPageView, pData->pWidget)) { bExit = TRUE; @@ -1320,21 +1320,21 @@ void CFFL_IFormFiller::OnBeforeKeyStroke(FX_BOOL bEditOrList, void* pPrivateData return; } } - + m_bNotifying = FALSE; } } } -void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit,FX_DWORD nFlag) +void CFFL_IFormFiller::OnAfterKeyStroke(FX_BOOL bEditOrList, void* pPrivateData, FX_BOOL & bExit,FX_DWORD nFlag) { ASSERT(pPrivateData != NULL); CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData; ASSERT(pData->pWidget != NULL); - + CFFL_FormFiller* pFormFiller = GetFormFiller(pData->pWidget, FALSE); ASSERT(pFormFiller != NULL); - + if (!bEditOrList) pFormFiller->OnKeyStroke(bExit); } diff --git a/fpdfsdk/src/formfiller/FFL_ListBox.cpp b/fpdfsdk/src/formfiller/FFL_ListBox.cpp index 6ee608a5bb..4622d4fcef 100644 --- a/fpdfsdk/src/formfiller/FFL_ListBox.cpp +++ b/fpdfsdk/src/formfiller/FFL_ListBox.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FormFiller.h" @@ -39,9 +39,9 @@ PWL_CREATEPARAM CFFL_ListBox::GetCreateParam() ASSERT(m_pWidget != NULL); FX_DWORD dwFieldFlag = m_pWidget->GetFieldFlags(); - + if (dwFieldFlag & FIELDFLAG_MULTISELECT) - { + { cp.dwFlags |= PLBS_MULTIPLESEL; } @@ -76,7 +76,7 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView if (pWnd->HasFlag(PLBS_MULTIPLESEL)) { m_OriginSelections.RemoveAll(); - + FX_BOOL bSetCaret = FALSE; for (int32_t i=0,sz=m_pWidget->CountOptions(); i<sz; i++) { @@ -103,9 +103,9 @@ CPWL_Wnd* CFFL_ListBox::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView } } } - + pWnd->SetTopVisibleIndex(m_pWidget->GetTopVisibleIndex()); - + return pWnd; } @@ -143,7 +143,7 @@ FX_BOOL CFFL_ListBox::IsDataChanged(CPDFSDK_PageView* pPageView) return pListBox->GetCurSel() != m_pWidget->GetSelectedIndex(0); } } - + return FALSE; } @@ -165,10 +165,10 @@ void CFFL_ListBox::SaveData(CPDFSDK_PageView* pPageView) } } - + int32_t nNewTopIndex = pListBox->GetTopVisibleIndex(); - m_pWidget->ClearSelection(FALSE); + m_pWidget->ClearSelection(FALSE); if (m_pWidget->GetFieldFlags() & FIELDFLAG_MULTISELECT) { @@ -235,7 +235,7 @@ void CFFL_ListBox::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AAct } -void CFFL_ListBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, +void CFFL_ListBox::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa) { } @@ -269,11 +269,11 @@ CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRes { if (bRestoreValue) SaveState(pPageView); - + DestroyPDFWindow(pPageView); - + CPWL_Wnd* pRet = NULL; - + if (bRestoreValue) { RestoreState(pPageView); @@ -281,9 +281,9 @@ CPWL_Wnd* CFFL_ListBox::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bRes } else pRet = GetPDFWindow(pPageView, TRUE); - + m_pWidget->UpdateField(); - + return pRet; } @@ -292,7 +292,7 @@ void CFFL_ListBox::OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag) ASSERT(m_pWidget != NULL); int nFlags = m_pWidget->GetFieldFlags(); - + if (nFlags & FIELDFLAG_COMMITONSELCHANGE) { if (m_bValid) diff --git a/fpdfsdk/src/formfiller/FFL_Notify.cpp b/fpdfsdk/src/formfiller/FFL_Notify.cpp index 4fd2bd84ea..58a2202b61 100644 --- a/fpdfsdk/src/formfiller/FFL_Notify.cpp +++ b/fpdfsdk/src/formfiller/FFL_Notify.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com // #include "../../include/formfiller/FormFiller.h" @@ -14,7 +14,7 @@ //#pragma warning(disable: 4800) -CFFL_Notify::CFFL_Notify(CFFL_FormFiller * pFormFiller) : +CFFL_Notify::CFFL_Notify(CFFL_FormFiller * pFormFiller) : m_bDoActioning(FALSE), m_nNotifyFlag(0) { @@ -94,15 +94,15 @@ FX_BOOL CFFL_Notify::OnFormat(int iCommitKey) return TRUE; } -FX_BOOL CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange, +FX_BOOL CFFL_Notify::OnKeyStroke(CPDF_FormField* pFormField, int nCommitKey, CFX_WideString& strValue, CFX_WideString& strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, - FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull, + FX_BOOL bShift, FX_BOOL bWillCommit, FX_BOOL bFieldFull, int& nSelStart, int& nSelEnd, FX_BOOL& bRC) { return TRUE; } -FX_BOOL CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange, +FX_BOOL CFFL_Notify::OnValidate(CPDF_FormField* pFormField, CFX_WideString& strValue, CFX_WideString & strChange, const CFX_WideString& strChangeEx, FX_BOOL bKeyDown, FX_BOOL bModifier, FX_BOOL bShift, FX_BOOL & bRC) { diff --git a/fpdfsdk/src/formfiller/FFL_PushButton.cpp b/fpdfsdk/src/formfiller/FFL_PushButton.cpp index b8a07fb548..a5df48840c 100644 --- a/fpdfsdk/src/formfiller/FFL_PushButton.cpp +++ b/fpdfsdk/src/formfiller/FFL_PushButton.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FormFiller.h" @@ -23,7 +23,7 @@ CPWL_Wnd* CFFL_PushButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageV { CPWL_PushButton* pWnd = new CPWL_PushButton(); pWnd->Create(cp); - + return pWnd; } @@ -33,7 +33,7 @@ FX_BOOL CFFL_PushButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nF return CFFL_FormFiller::OnChar(pAnnot, nChar, nFlags); } -void CFFL_PushButton::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, +void CFFL_PushButton::OnDraw(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, FX_DWORD dwFlags) { diff --git a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp index 708d6df090..1f73e8ccaa 100644 --- a/fpdfsdk/src/formfiller/FFL_RadioButton.cpp +++ b/fpdfsdk/src/formfiller/FFL_RadioButton.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FormFiller.h" @@ -27,7 +27,7 @@ CPWL_Wnd* CFFL_RadioButton::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_Page ASSERT(m_pWidget != NULL); pWnd->SetCheck(m_pWidget->IsChecked()); - + return pWnd; } @@ -47,7 +47,7 @@ FX_BOOL CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT n { switch (nChar) { - case FWL_VKEY_Return: + case FWL_VKEY_Return: case FWL_VKEY_Space: { CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller(); @@ -109,7 +109,7 @@ void CFFL_RadioButton::SaveData(CPDFSDK_PageView* pPageView) if (CPWL_RadioButton* pWnd = (CPWL_RadioButton*)GetPDFWindow(pPageView, FALSE)) { - + FX_BOOL bNewChecked = pWnd->IsChecked(); if (bNewChecked) diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp index 9f0a8148cf..83c7f35ba9 100644 --- a/fpdfsdk/src/formfiller/FFL_TextField.cpp +++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/formfiller/FFL_TextField.h" @@ -36,16 +36,16 @@ PWL_CREATEPARAM CFFL_TextField::GetCreateParam() if (nFlags & FIELDFLAG_PASSWORD) - { + { cp.dwFlags |= PES_PASSWORD; } if (!(nFlags & FIELDFLAG_DONOTSPELLCHECK)) - { + { } if (nFlags & FIELDFLAG_MULTILINE) - { + { cp.dwFlags |= PES_MULTILINE | PES_AUTORETURN | PES_TOP; if (!(nFlags & FIELDFLAG_DONOTSCROLL)) @@ -64,17 +64,17 @@ PWL_CREATEPARAM CFFL_TextField::GetCreateParam() } if (nFlags & FIELDFLAG_COMB) - { + { cp.dwFlags |= PES_CHARARRAY; } if (nFlags & FIELDFLAG_RICHTEXT) - { + { cp.dwFlags |= PES_RICH; } cp.dwFlags |= PES_UNDO; - + switch (m_pWidget->GetAlignment()) { default: @@ -115,7 +115,7 @@ CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageVi ASSERT(m_pWidget != NULL); int32_t nMaxLen = m_pWidget->GetMaxLen(); CFX_WideString swValue = m_pWidget->GetValue(); - + if (nMaxLen > 0) { if (pWnd->HasFlag(PES_CHARARRAY)) @@ -146,7 +146,7 @@ FX_BOOL CFFL_TextField::OnChar(CPDFSDK_Annot* pAnnot, FX_UINT nChar, FX_UINT nFl m_bValid = !m_bValid; CPDF_Rect rcAnnot = pAnnot->GetRect(); m_pApp->FFI_Invalidate(pAnnot->GetPDFXFAPage(), rcAnnot.left, rcAnnot.top, rcAnnot.right, rcAnnot.bottom); - + if (m_bValid) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, TRUE)) @@ -197,7 +197,7 @@ void CFFL_TextField::SaveData(CPDFSDK_PageView* pPageView) CFX_WideString sOldValue = m_pWidget->GetValue(); CFX_WideString sNewValue = pWnd->GetText(); - m_pWidget->SetValue(sNewValue, FALSE); + m_pWidget->SetValue(sNewValue, FALSE); m_pWidget->ResetFieldAppearance(TRUE); m_pWidget->UpdateField(); SetChangeMark(); @@ -212,10 +212,10 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA case CPDF_AAction::KeyStroke: if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) { - fa.bFieldFull = pWnd->IsTextFull(); + fa.bFieldFull = pWnd->IsTextFull(); fa.sValue = pWnd->GetText(); - + if (fa.bFieldFull) { fa.sChange = L""; @@ -239,7 +239,7 @@ void CFFL_TextField::GetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA } } -void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, +void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AActionType type, const PDFSDK_FieldAction& fa) { switch (type) @@ -258,7 +258,7 @@ void CFFL_TextField::SetActionData(CPDFSDK_PageView* pPageView, CPDF_AAction::AA } -FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, +FX_BOOL CFFL_TextField::IsActionDataChanged(CPDF_AAction::AActionType type, const PDFSDK_FieldAction& faOld, const PDFSDK_FieldAction& faNew) { switch (type) @@ -313,7 +313,7 @@ CPWL_Wnd* CFFL_TextField::ResetPDFWindow(CPDFSDK_PageView* pPageView, FX_BOOL bR pRet = GetPDFWindow(pPageView, TRUE); m_pWidget->UpdateField(); - + return pRet; } @@ -321,7 +321,7 @@ FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) { if (CPWL_Edit* pWnd = (CPWL_Edit*)GetPDFWindow(pPageView, FALSE)) { - return pWnd->IsTextFull(); + return pWnd->IsTextFull(); } return FALSE; @@ -330,22 +330,22 @@ FX_BOOL CFFL_TextField::IsFieldFull(CPDFSDK_PageView* pPageView) void CFFL_TextField::OnSetFocus(CPWL_Wnd* pWnd) { ASSERT(m_pApp != NULL); - + ASSERT(pWnd != NULL); - + if (pWnd->GetClassName() == PWL_CLASSNAME_EDIT) { CPWL_Edit* pEdit = (CPWL_Edit*)pWnd; pEdit->SetCharSet(134); pEdit->SetCodePage(936); - + pEdit->SetReadyToInput(); CFX_WideString wsText = pEdit->GetText(); int nCharacters = wsText.GetLength(); CFX_ByteString bsUTFText = wsText.UTF16LE_Encode(); unsigned short* pBuffer = (unsigned short*)bsUTFText.c_str(); m_pApp->FFI_OnSetFieldInputFocus(m_pWidget->GetFormField(), pBuffer, nCharacters, TRUE); - + pEdit->SetEditNotify(this); //pUndo->BeginEdit(pDocument); } diff --git a/fpdfsdk/src/formfiller/FFL_Utils.cpp b/fpdfsdk/src/formfiller/FFL_Utils.cpp index 2f988b2f0b..8d2d76d73c 100644 --- a/fpdfsdk/src/formfiller/FFL_Utils.cpp +++ b/fpdfsdk/src/formfiller/FFL_Utils.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include <algorithm> @@ -53,7 +53,7 @@ FX_BOOL CFFL_Utils::TraceObject(CPDF_Object* pObj) CPDF_Array* pArray = (CPDF_Array*)pObj; for (FX_DWORD i = 0; i < pArray->GetCount(); i ++) { - CPDF_Object* pElement = pArray->GetElementValue(i); + CPDF_Object* pElement = pArray->GetElementValue(i); TraceObject(pElement); } } diff --git a/fpdfsdk/src/fpdf_dataavail.cpp b/fpdfsdk/src/fpdf_dataavail.cpp index d0f0a4ac90..7189dc0788 100644 --- a/fpdfsdk/src/fpdf_dataavail.cpp +++ b/fpdfsdk/src/fpdf_dataavail.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_dataavail.h" @@ -31,7 +31,7 @@ public: private: FX_FILEAVAIL* m_pfileAvail; -}; +}; class CFPDF_FileAccessWrap : public IFX_FileRead { @@ -48,7 +48,7 @@ public: virtual FX_FILESIZE GetSize() { - return m_pFileAccess->m_FileLen; + return m_pFileAccess->m_FileLen; } virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) @@ -72,15 +72,15 @@ public: m_pDownloadHints = pDownloadHints; } public: - virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) + virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) { m_pDownloadHints->AddSegment(m_pDownloadHints, offset, size); - } + } private: FX_DOWNLOADHINTS* m_pDownloadHints; }; -class CFPDF_DataAvail +class CFPDF_DataAvail { public: CFPDF_DataAvail() diff --git a/fpdfsdk/src/fpdf_ext.cpp b/fpdfsdk/src/fpdf_ext.cpp index 2dd242b372..f40023b9cc 100644 --- a/fpdfsdk/src/fpdf_ext.cpp +++ b/fpdfsdk/src/fpdf_ext.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_ext.h" @@ -43,7 +43,7 @@ FX_BOOL FPDF_UnSupportError(int nError) return FALSE; pAdapter->ReportError(nError); return TRUE; -} +} DLLEXPORT FPDF_BOOL STDCALL FSDK_SetUnSpObjProcessHandler(UNSUPPORT_INFO* unsp_info) { @@ -95,22 +95,22 @@ void CheckUnSupportAnnot(CPDF_Document * pDoc, CPDF_Annot* pPDFAnnot) if(pAnnotDict->KeyExist("FT")) { cbString = pAnnotDict->GetString("FT"); - } + } if(cbString.Compare("Sig") == 0) { FPDF_UnSupportError(FPDF_UNSP_ANNOT_SIG); } } - + } FX_BOOL CheckSharedForm(CXML_Element * pElement, CFX_ByteString cbName) { int count = pElement->CountAttrs(); int i=0; - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { - CFX_ByteString space, name; + CFX_ByteString space, name; CFX_WideString value; pElement->GetAttrByIndex(i, space, name, value); if (space == FX_BSTRC("xmlns") && name == FX_BSTRC("adhocwf") && value == L"http://ns.adobe.com/AcrobatAdhocWorkflow/1.0/") @@ -160,7 +160,7 @@ void CheckUnSupportError(CPDF_Document * pDoc, FX_DWORD err_code) if(!pDoc) return ; - // Portfolios and Packages + // Portfolios and Packages CPDF_Dictionary * pRootDict = pDoc->GetRoot(); if(pRootDict) { diff --git a/fpdfsdk/src/fpdf_flatten.cpp b/fpdfsdk/src/fpdf_flatten.cpp index 742aeda72f..b9edef9941 100644 --- a/fpdfsdk/src/fpdf_flatten.cpp +++ b/fpdfsdk/src/fpdf_flatten.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_flatten.h" @@ -17,16 +17,16 @@ enum FPDF_VALUE { TOP, LEFT, RIGHT, BOTTOM }; FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage) { - if ( rect.left - rect.right > 0.000001f || + if ( rect.left - rect.right > 0.000001f || rect.bottom - rect.top > 0.000001f) return FALSE; - + if (rect.left == 0.0f && rect.top == 0.0f && rect.right == 0.0f && rect.bottom == 0.0f) return FALSE; - + if (!rcPage.IsEmpty()) { if (rect.left - rcPage.left < -10.000001f || @@ -35,7 +35,7 @@ FX_BOOL IsValiableRect(CPDF_Rect rect, CPDF_Rect rcPage) rect.bottom - rcPage.bottom < -10.000001f) return FALSE; } - + return TRUE; } @@ -47,24 +47,24 @@ FX_BOOL GetContentsRect( CPDF_Document * pDoc, CPDF_Dictionary* pDict, CPDF_Rect pPDFPage->ParseContent(); FX_POSITION pos = pPDFPage->GetFirstObjectPosition(); - + while (pos) { CPDF_PageObject* pPageObject = pPDFPage->GetNextObject(pos); if (!pPageObject)continue; - + CPDF_Rect rc; rc.left = pPageObject->m_Left; rc.right = pPageObject->m_Right; rc.bottom = pPageObject->m_Bottom; rc.top = pPageObject->m_Top; - + if (IsValiableRect(rc, pDict->GetRect("MediaBox"))) { pRectArray->Add(rc); } } - + delete pPDFPage; return TRUE; } @@ -78,10 +78,10 @@ void ParserStream( CPDF_Dictionary * pPageDic, CPDF_Dictionary* pStream, CPDF_Re rect = pStream->GetRect("Rect"); else if (pStream->KeyExist("BBox")) rect = pStream->GetRect("BBox"); - + if (IsValiableRect(rect, pPageDic->GetRect("MediaBox"))) pRectArray->Add(rect); - + pObjectArray->Add(pStream); } @@ -133,9 +133,9 @@ FX_FLOAT GetMinMaxValue( CPDF_RectArray& array, FPDF_TYPE type, FPDF_VALUE value { int nRects = array.GetSize(); FX_FLOAT fRet = 0.0f; - + if (nRects <= 0)return 0.0f; - + FX_FLOAT* pArray = new FX_FLOAT[nRects]; switch(value) { @@ -143,28 +143,28 @@ FX_FLOAT GetMinMaxValue( CPDF_RectArray& array, FPDF_TYPE type, FPDF_VALUE value { for (int i = 0; i < nRects; i++) pArray[i] = CPDF_Rect(array.GetAt(i)).left; - + break; } case TOP: { for (int i = 0; i < nRects; i++) pArray[i] = CPDF_Rect(array.GetAt(i)).top; - + break; } case RIGHT: { for (int i = 0; i < nRects; i++) pArray[i] = CPDF_Rect(array.GetAt(i)).right; - + break; } case BOTTOM: { for (int i = 0; i < nRects; i++) pArray[i] = CPDF_Rect(array.GetAt(i)).bottom; - + break; } default: @@ -191,12 +191,12 @@ CPDF_Rect CalculateRect( CPDF_RectArray * pRectArray ) { CPDF_Rect rcRet; - + rcRet.left = GetMinMaxValue(*pRectArray, MIN, LEFT); rcRet.top = GetMinMaxValue(*pRectArray, MAX, TOP); rcRet.right = GetMinMaxValue(*pRectArray, MAX, RIGHT); rcRet.bottom = GetMinMaxValue(*pRectArray, MIN, BOTTOM); - + return rcRet; } @@ -208,7 +208,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* { pContentsObj = pPage->GetArray("Contents"); } - + if (!pContentsObj) { //Create a new contents dictionary @@ -217,7 +217,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); if (!pNewContents)return; pPage->SetAtReference("Contents", pDocument, pDocument->AddIndirectObject(pNewContents)); - + CFX_ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE); @@ -227,7 +227,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* int iType = pContentsObj->GetType(); CPDF_Array* pContentsArray = NULL; - + switch(iType) { case PDFOBJ_STREAM: @@ -244,7 +244,7 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* pContentsArray->AddReference(pDocument, dwObjNum); break; } - + case PDFOBJ_ARRAY: { pContentsArray = (CPDF_Array*)pContentsObj; @@ -252,36 +252,36 @@ void SetPageContents(CFX_ByteString key, CPDF_Dictionary* pPage, CPDF_Document* } default: break; - } - + } + if (!pContentsArray)return; - + FX_DWORD dwObjNum = pDocument->AddIndirectObject(pContentsArray); pPage->SetAtReference("Contents", pDocument, dwObjNum); - + if (!key.IsEmpty()) { CPDF_Stream* pNewContents = FX_NEW CPDF_Stream(NULL, 0, FX_NEW CPDF_Dictionary); dwObjNum = pDocument->AddIndirectObject(pNewContents); pContentsArray->AddReference(pDocument, dwObjNum); - + CFX_ByteString sStream; sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str()); pNewContents->SetData((const uint8_t*)sStream, sStream.GetLength(), FALSE, FALSE); } } - + CFX_AffineMatrix GetMatrix(CPDF_Rect rcAnnot, CPDF_Rect rcStream, CFX_AffineMatrix matrix) { if(rcStream.IsEmpty()) return CFX_AffineMatrix(); - + matrix.TransformRect(rcStream); rcStream.Normalize(); - + FX_FLOAT a = rcAnnot.Width()/rcStream.Width(); FX_FLOAT d = rcAnnot.Height()/rcStream.Height(); - + FX_FLOAT e = rcAnnot.left - rcStream.left * a; FX_FLOAT f = rcAnnot.bottom - rcStream.bottom * d; return CFX_AffineMatrix(a, 0, 0, d, e, f); @@ -293,7 +293,7 @@ void GetOffset(FX_FLOAT& fa, FX_FLOAT& fd, FX_FLOAT& fe, FX_FLOAT& ff, CPDF_Rect FX_FLOAT fStreamHeight = 0.0f; - + if (matrix.a != 0 && matrix.d != 0) { fStreamWidth = rcStream.right - rcStream.left; @@ -304,7 +304,7 @@ void GetOffset(FX_FLOAT& fa, FX_FLOAT& fd, FX_FLOAT& fe, FX_FLOAT& ff, CPDF_Rect fStreamWidth = rcStream.top - rcStream.bottom; fStreamHeight = rcStream.right - rcStream.left; } - + FX_FLOAT x1 = matrix.a * rcStream.left + matrix.c * rcStream.bottom + matrix.e; FX_FLOAT y1 = matrix.b * rcStream.left + matrix.d * rcStream.bottom + matrix.f; FX_FLOAT x2 = matrix.a * rcStream.left + matrix.c * rcStream.top + matrix.e; @@ -313,10 +313,10 @@ void GetOffset(FX_FLOAT& fa, FX_FLOAT& fd, FX_FLOAT& fe, FX_FLOAT& ff, CPDF_Rect FX_FLOAT y3 = matrix.b * rcStream.right + matrix.d * rcStream.bottom + matrix.f; FX_FLOAT x4 = matrix.a * rcStream.right + matrix.c * rcStream.top + matrix.e; FX_FLOAT y4 = matrix.b * rcStream.right + matrix.d * rcStream.top + matrix.f; - + FX_FLOAT left = FX_MIN(FX_MIN(x1, x2), FX_MIN(x3, x4)); FX_FLOAT bottom = FX_MIN(FX_MIN(y1, y2), FX_MIN(y3, y4)); - + fa = (rcAnnot.right - rcAnnot.left)/fStreamWidth; fd = (rcAnnot.top - rcAnnot.bottom)/fStreamHeight; fe = rcAnnot.left - left * fa; @@ -337,7 +337,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) CPDF_Document * pDocument = pPage->m_pDocument; CPDF_Dictionary * pPageDict = pPage->m_pFormDict; - + if ( !pDocument || !pPageDict ) { return FLATTEN_FAIL; @@ -357,17 +357,17 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) if (pPageDict->KeyExist("CropBox")) rcOriginalMB = pPageDict->GetRect("CropBox"); - - if (rcOriginalMB.IsEmpty()) + + if (rcOriginalMB.IsEmpty()) { rcOriginalMB = CPDF_Rect(0.0f, 0.0f, 612.0f, 792.0f); } - + rcMerger.left = rcMerger.left < rcOriginalMB.left? rcOriginalMB.left : rcMerger.left; rcMerger.right = rcMerger.right > rcOriginalMB.right? rcOriginalMB.right : rcMerger.right; rcMerger.top = rcMerger.top > rcOriginalMB.top? rcOriginalMB.top : rcMerger.top; rcMerger.bottom = rcMerger.bottom < rcOriginalMB.bottom? rcOriginalMB.bottom : rcMerger.bottom; - + if (pPageDict->KeyExist("ArtBox")) rcOriginalCB = pPageDict->GetRect("ArtBox"); else @@ -375,7 +375,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) if (!rcOriginalMB.IsEmpty()) { - CPDF_Array* pMediaBox = FX_NEW CPDF_Array(); + CPDF_Array* pMediaBox = FX_NEW CPDF_Array(); pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.left)); pMediaBox->Add(FX_NEW CPDF_Number(rcOriginalMB.bottom)); @@ -384,7 +384,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) pPageDict->SetAt("MediaBox",pMediaBox); } - + if (!rcOriginalCB.IsEmpty()) { CPDF_Array* pCropBox = FX_NEW CPDF_Array(); @@ -442,10 +442,10 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) pNewOXbjectDic->SetAtName("Subtype", "Form"); pNewOXbjectDic->SetAtInteger("FormType", 1); pNewOXbjectDic->SetAtName("Name", "FRM"); - CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox"); + CPDF_Rect rcBBox = pPageDict->GetRect("ArtBox"); pNewOXbjectDic->SetAtRect("BBox", rcBBox); } - + for (int i = 0; i < nStreams; i++) { CPDF_Dictionary* pAnnotDic = ObjectArray.GetAt(i); @@ -479,7 +479,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) { if (pFirstObj->GetType() == PDFOBJ_REFERENCE) pFirstObj = pFirstObj->GetDirect(); - + if (pFirstObj->GetType() != PDFOBJ_STREAM) continue; @@ -505,7 +505,7 @@ DLLEXPORT int STDCALL FPDFPage_Flatten( FPDF_PAGE page, int nFlag) CPDF_Object* pObj = pAPStream; if (pObj) - { + { CPDF_Dictionary* pObjDic = pObj->GetDict(); if (pObjDic) { diff --git a/fpdfsdk/src/fpdf_progressive.cpp b/fpdfsdk/src/fpdf_progressive.cpp index bd8d86434f..f94bce046e 100644 --- a/fpdfsdk/src/fpdf_progressive.cpp +++ b/fpdfsdk/src/fpdf_progressive.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_progressive.h" @@ -16,7 +16,7 @@ extern void (*Func_RenderPage)( CRenderContext*, FPDF_PAGE page, int start_x, in extern void DropContext(void* data); -DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE page, +DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags, IFSDK_PAUSE * pause ) @@ -33,9 +33,9 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage(); if (!pPage) return FPDF_RENDER_FAILED; - + // FXMT_CSLOCK_OBJ(&pPage->m_PageLock); - + CRenderContext* pContext = FX_NEW CRenderContext; pPage->SetPrivateData((void*)1, pContext, DropContext ); #ifdef _SKIA_SUPPORT_ @@ -52,7 +52,7 @@ DLLEXPORT int STDCALL FPDF_RenderPageBitmap_Start( FPDF_BITMAP bitmap, FPDF_PAGE ((CFX_FxgeDevice*)pContext->m_pDevice)->Attach((CFX_DIBitmap*)bitmap); #endif IFSDK_PAUSE_Adapter IPauseAdapter(pause); - + Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,FALSE, &IPauseAdapter); if ( pContext->m_pRenderer ) @@ -71,7 +71,7 @@ DLLEXPORT int STDCALL FPDF_RenderPage_Continue(FPDF_PAGE page,IFSDK_PAUSE * paus if (!pause) return FPDF_RENDER_FAILED; - + if (pause->version !=1) return FPDF_RENDER_FAILED; diff --git a/fpdfsdk/src/fpdf_searchex.cpp b/fpdfsdk/src/fpdf_searchex.cpp index 4384cdc5b3..d63f8fff46 100644 --- a/fpdfsdk/src/fpdf_searchex.cpp +++ b/fpdfsdk/src/fpdf_searchex.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_searchex.h" diff --git a/fpdfsdk/src/fpdf_sysfontinfo.cpp b/fpdfsdk/src/fpdf_sysfontinfo.cpp index c1c6417ca6..85b83a6ed2 100644 --- a/fpdfsdk/src/fpdf_sysfontinfo.cpp +++ b/fpdfsdk/src/fpdf_sysfontinfo.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_sysfontinfo.h" diff --git a/fpdfsdk/src/fpdf_transformpage.cpp b/fpdfsdk/src/fpdf_transformpage.cpp index a6caf78e6e..7bec77c2df 100644 --- a/fpdfsdk/src/fpdf_transformpage.cpp +++ b/fpdfsdk/src/fpdf_transformpage.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_transformpage.h" @@ -21,7 +21,7 @@ DLLEXPORT void STDCALL FPDFPage_SetMediaBox(FPDF_PAGE page, float left, float bo pMediaBoxArray->Add(FX_NEW CPDF_Number(bottom)); pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right))); pMediaBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top))); - + pPageDict->SetAt("MediaBox", pMediaBoxArray); } @@ -38,8 +38,8 @@ DLLEXPORT void STDCALL FPDFPage_SetCropBox(FPDF_PAGE page, float left, float bot pCropBoxArray->Add(FX_NEW CPDF_Number(bottom)); pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(right))); pCropBoxArray->Add(FX_NEW CPDF_Number(FX_FLOAT(top))); - - + + pPageDict->SetAt("CropBox", pCropBoxArray); } @@ -102,7 +102,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX CFX_ByteString bsMatix; bsMatix.Format("%f %f %f %f %f %f cm ", matrix->a, matrix->b,matrix->c,matrix->d,matrix->e,matrix->f); textBuf<<bsMatix; - + CPDF_Dictionary* pPageDic = pPage->m_pFormDict; CPDF_Object* pContentObj = pPageDic ? pPageDic->GetElement("Contents") : NULL; @@ -110,7 +110,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX pContentObj = pPageDic ? pPageDic->GetArray("Contents") : NULL; if(!pContentObj) return FALSE; - + CPDF_Dictionary* pDic = FX_NEW CPDF_Dictionary; CPDF_Stream* pStream = FX_NEW CPDF_Stream(NULL,0, pDic); pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize(), FALSE, FALSE); @@ -123,7 +123,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX 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; if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY) { @@ -131,7 +131,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); pContentArray->AddReference(pDoc,pEndStream); - + } else if(pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE) { @@ -145,7 +145,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); pContentArray->AddReference(pDoc,pEndStream); - + } else if(pDirectObj->GetType() == PDFOBJ_STREAM) { @@ -156,7 +156,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray)); } } - } + } //Need to transform the patterns as well. CPDF_Dictionary* pRes = pPageDic->GetDict(FX_BSTRC("Resources")); @@ -183,7 +183,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, FS_MATRIX } else continue; - + CFX_AffineMatrix m = pDict->GetMatrix(FX_BSTRC("Matrix")); CFX_AffineMatrix t = *(CFX_AffineMatrix*)matrix; m.Concat(t); @@ -201,7 +201,7 @@ DLLEXPORT void STDCALL FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object if(pPageObj == NULL) return; CFX_AffineMatrix matrix((FX_FLOAT)a,(FX_FLOAT)b,(FX_FLOAT)c,(FX_FLOAT)d,(FX_FLOAT)e,(FX_FLOAT)f); - + //Special treatment to shading object, because the ClipPath for shading object is already transformed. if(pPageObj->m_Type != PDFPAGE_SHADING) pPageObj->TransformClipPath(matrix); @@ -230,16 +230,16 @@ void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) { const CFX_PathData* pPathData = path; if (pPathData == NULL) return; - + FX_PATHPOINT* pPoints = pPathData->GetPoints(); - + if (path.IsRect()) { - buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " " - << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " " + buf << (pPoints[0].m_PointX) << " " << (pPoints[0].m_PointY) << " " + << (pPoints[2].m_PointX - pPoints[0].m_PointX) << " " << (pPoints[2].m_PointY - pPoints[0].m_PointY) << " re\n"; return; } - + CFX_ByteString temp; for (int i = 0; i < pPathData->GetPointCount(); i ++) { buf << (pPoints[i].m_PointX) << " " << (pPoints[i].m_PointY); @@ -247,7 +247,7 @@ void OutputPath(CFX_ByteTextBuf& buf, CPDF_Path path) if (point_type == FXPT_MOVETO) buf << " m\n"; else if (point_type == FXPT_BEZIERTO) { - buf << " " << (pPoints[i+1].m_PointX) << " " << (pPoints[i+1].m_PointY) << " " << + buf << " " << (pPoints[i+1].m_PointX) << " " << (pPoints[i+1].m_PointY) << " " << (pPoints[i+2].m_PointX) << " " << (pPoints[i+2].m_PointY); if (pPoints[i+2].m_Flag & FXPT_CLOSEFIGURE) buf << " c h\n"; @@ -300,14 +300,14 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip if(!pDoc) return; pDoc->AddIndirectObject(pStream); - + CPDF_Array* pContentArray = NULL; if (pContentObj && pContentObj->GetType() == PDFOBJ_ARRAY) { pContentArray = (CPDF_Array*)pContentObj; CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); - + } else if(pContentObj && pContentObj->GetType() == PDFOBJ_REFERENCE) { @@ -320,7 +320,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip pContentArray = (CPDF_Array*)pDirectObj; CPDF_Reference* pRef = FX_NEW CPDF_Reference(pDoc, pStream->GetObjNum()); pContentArray->InsertAt(0, pRef); - + } else if(pDirectObj->GetType() == PDFOBJ_STREAM) { @@ -330,6 +330,6 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,FPDF_CLIPPATH clip pPageDic->SetAtReference("Contents", pDoc, pDoc->AddIndirectObject(pContentArray)); } } - } + } } diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index e874e815e1..2c3d1afdd7 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_doc.h" @@ -225,7 +225,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_Enumerate(FPDF_PAGE page, int* startPos, FP continue; if(pDict->GetString(FX_BSTRC("Subtype")).Equal(FX_BSTRC("Link"))) { *startPos = i + 1; - *linkAnnot = (FPDF_LINK)pDict; + *linkAnnot = (FPDF_LINK)pDict; return TRUE; } } @@ -275,7 +275,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot, int quad quadPoints->x4 = pArray->GetNumber(quadIndex*8+6); quadPoints->y4 = pArray->GetNumber(quadIndex*8+7); return TRUE; - } + } return FALSE; } diff --git a/fpdfsdk/src/fpdfeditimg.cpp b/fpdfsdk/src/fpdfeditimg.cpp index aba8d0b7b2..a6951d20d3 100644 --- a/fpdfsdk/src/fpdfeditimg.cpp +++ b/fpdfsdk/src/fpdfeditimg.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_edit.h" @@ -30,7 +30,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_LoadJpegFile(FPDF_PAGE* pages, int nCou pImgObj->m_GeneralState.GetModify(); for (int index=0;index<nCount;index++) { - CPDF_Page* pPage = ((CPDFXFA_Page*)pages[index])->GetPDFPage(); + CPDF_Page* pPage = ((CPDFXFA_Page*)pages[index])->GetPDFPage(); if (!pPage) continue; pImgObj->m_pImage->ResetCache(pPage,NULL); diff --git a/fpdfsdk/src/fpdfeditpage.cpp b/fpdfsdk/src/fpdfeditpage.cpp index 205d0a01e8..d1068ae3be 100644 --- a/fpdfsdk/src/fpdfeditpage.cpp +++ b/fpdfsdk/src/fpdfeditpage.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_edit.h" @@ -57,9 +57,9 @@ DLLEXPORT FPDF_DOCUMENT STDCALL FPDF_CreateNewDocument() DLLEXPORT void STDCALL FPDFPage_Delete(FPDF_DOCUMENT document, int page_index) { CPDF_Document* pDoc = ((CPDFXFA_Document*)document)->GetPDFDoc(); - if (pDoc == NULL) + if (pDoc == NULL) return; - if (page_index < 0 || page_index >= pDoc->GetPageCount()) + if (page_index < 0 || page_index >= pDoc->GetPageCount()) return; pDoc->DeletePage(page_index); @@ -76,7 +76,7 @@ DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document, int page_index, page_index = 0; if(pDoc->GetPageCount()<page_index) page_index = pDoc->GetPageCount(); -// if (page_index < 0 || page_index >= pDoc->GetPageCount()) +// if (page_index < 0 || page_index >= pDoc->GetPageCount()) // return NULL; CPDF_Dictionary* pPageDict = pDoc->CreateNewPage(page_index); @@ -140,7 +140,7 @@ DLLEXPORT int STDCALL FPDFPage_GetRotation(FPDF_PAGE page) { return -1; } - + return rotate; } @@ -279,7 +279,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_GenerateContent(FPDF_PAGE page) } DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object, - double a, double b, double c, double d, double e, double f) + double a, double b, double c, double d, double e, double f) { CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object; if(pPageObj == NULL) diff --git a/fpdfsdk/src/fpdfformfill.cpp b/fpdfsdk/src/fpdfformfill.cpp index e4b7de4426..9e89ea002b 100644 --- a/fpdfsdk/src/fpdfformfill.cpp +++ b/fpdfsdk/src/fpdfformfill.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_formfill.h" @@ -46,7 +46,7 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_ } IXFA_PageView* pPageView = ((CPDFXFA_Page*)page)->GetXFAPageView(); - if (pPageView) + if (pPageView) { IXFA_WidgetHandler* pWidgetHandler = NULL; IXFA_DocView* pDocView = pPageView->GetDocView(); @@ -81,7 +81,7 @@ DLLEXPORT int STDCALL FPDPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle, FPDF_ pWidgetIterator->Release(); } - + return -1; } @@ -121,7 +121,7 @@ DLLEXPORT void STDCALL FPDFDOC_ExitFormFillEnvironment(FPDF_FORMHANDLE hHandle) } DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE page, int modifier, double page_x, double page_y) -{ +{ if (!hHandle || !page) return FALSE; // CPDF_Page * pPage = (CPDF_Page*) page; @@ -133,7 +133,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnMouseMove(FPDF_FORMHANDLE hHandle, FPDF_PAGE CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDFXFA_Page*)page); if(!pPageView) return FALSE; - + // double page_x = 0; // double page_y = 0; // pEnv->FFI_DeviceToPage(page, point_x, point_y, &page_x, &page_y); @@ -217,8 +217,8 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyDown(FPDF_FORMHANDLE hHandle, FPDF_PAGE pa CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDFXFA_Page*)page); if(!pPageView) return FALSE; - - + + return pPageView->OnKeyDown(nKeyCode, modifier); } @@ -232,8 +232,8 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnKeyUp(FPDF_FORMHANDLE hHandle, FPDF_PAGE page CPDFSDK_PageView* pPageView = pFXDoc->GetPageView((CPDFXFA_Page*)page); if(!pPageView) return FALSE; - - + + return pPageView->OnKeyUp(nKeyCode, modifier); } @@ -259,16 +259,16 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_ForceToKillFocus(FPDF_FORMHANDLE hHandle) CPDFSDK_Document* pSDKDoc = ((CPDFDoc_Environment*)hHandle)->GetCurrentDoc(); if(!pSDKDoc) return FALSE; - //Kill the current focus. + //Kill the current focus. return pSDKDoc->KillFocusAnnot(0); } -DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, +DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags) { if (!hHandle || !page) return ; - + CPDFXFA_Page* pPage = (CPDFXFA_Page*)page; CPDFXFA_Document* pDocument = pPage->GetDocument(); if (!pDocument) @@ -281,10 +281,10 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, CPDFSDK_Document* pFXDoc = pEnv->GetCurrentDoc(); if (!pFXDoc) return; - + CFX_AffineMatrix matrix; - pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); - + pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); + FX_RECT clip; clip.left = start_x; clip.right = start_x + size_x; @@ -303,7 +303,7 @@ DLLEXPORT void STDCALL FPDF_FFLDraw(FPDF_FORMHANDLE hHandle, FPDF_BITMAP bitmap, pDevice->Attach((CFX_DIBitmap*)bitmap); pDevice->SaveState(); pDevice->SetClip_Rect(&clip); - + CPDF_RenderOptions options; if (flags & FPDF_LCD_TEXT) options.m_Flags |= RENDER_CLEARTYPE; @@ -526,7 +526,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE *size = len; return TRUE; } - + int real_size = len < *size ? len : *size; if (real_size > 0) FXSYS_memcpy((void*)bsText, (const FX_CHAR*)(sSuggestWords[index]), real_size); @@ -546,7 +546,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringH { if (stringHandle == NULL || bsText == NULL || size <= 0) return FALSE; - + CFX_ByteStringArray* stringArr = (CFX_ByteStringArray*)stringHandle; CFX_ByteString bsStr(bsText, size); @@ -566,7 +566,7 @@ DLLEXPORT void STDCALL FPDF_SetFormFieldHighlightColor(FPDF_FORMHANDLE hHandle, { pInterForm->SetHighlightColor(color, fieldType); } - + } } @@ -607,7 +607,7 @@ DLLEXPORT void STDCALL FORM_OnAfterLoadPage(FPDF_PAGE page, FPDF_FORMHANDLE hHan if(pPageView) { pPageView->SetValid(TRUE); - } + } } DLLEXPORT void STDCALL FORM_OnBeforeClosePage(FPDF_PAGE page, FPDF_FORMHANDLE hHandle) @@ -633,7 +633,7 @@ DLLEXPORT void STDCALL FORM_DoDocumentJSAction(FPDF_FORMHANDLE hHandle) pSDKDoc->InitPageView(); if(((CPDFDoc_Environment*)hHandle)->IsJSInitiated()) pSDKDoc->ProcJavascriptFun(); - } + } } DLLEXPORT void STDCALL FORM_DoDocumentOpenAction(FPDF_FORMHANDLE hHandle) @@ -658,7 +658,7 @@ DLLEXPORT void STDCALL FORM_DoDocumentAAction(FPDF_FORMHANDLE hHandle, int aaTyp if (!pDic) return; CPDF_AAction aa = pDic->GetDict(FX_BSTRC("AA")); - + if(aa.ActionExist((CPDF_AAction::AActionType)aaType)) { CPDF_Action action = aa.GetAction((CPDF_AAction::AActionType)aaType); @@ -679,15 +679,15 @@ DLLEXPORT void STDCALL FORM_DoPageAAction(FPDF_PAGE page, FPDF_FORMHANDLE hHandl { CPDFDoc_Environment *pEnv = pSDKDoc->GetEnv(); ASSERT(pEnv != NULL); - + CPDFSDK_ActionHandler *pActionHandler = pEnv->GetActionHander(); ASSERT(pActionHandler != NULL); - + if (!pPage->GetPDFPage()) return; CPDF_Dictionary *pPageDict = pPage->GetPDFPage()->m_pFormDict; ASSERT(pPageDict != NULL); - + CPDF_AAction aa = pPageDict->GetDict(FX_BSTRC("AA")); FX_BOOL bExistOAAction = FALSE; diff --git a/fpdfsdk/src/fpdfppo.cpp b/fpdfsdk/src/fpdfppo.cpp index 11f7d594b3..688b79306e 100644 --- a/fpdfsdk/src/fpdfppo.cpp +++ b/fpdfsdk/src/fpdfppo.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_ppo.h" @@ -13,14 +13,14 @@ class CPDF_PageOrganizer public: CPDF_PageOrganizer(); ~CPDF_PageOrganizer(); - + public: FX_BOOL PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document *pSrcPDFDoc); FX_BOOL ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* nPageNum, CPDF_Document *pDestPDFDoc, int nIndex); CPDF_Object* PageDictGetInheritableTag(CPDF_Dictionary *pDict, CFX_ByteString nSrctag); FX_BOOL UpdateReference(CPDF_Object *pObj, CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr); int GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr, CPDF_Reference *pRef); - + }; @@ -38,17 +38,17 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document { if(!pDestPDFDoc || !pSrcPDFDoc) return false; - + CPDF_Dictionary* pNewRoot = pDestPDFDoc->GetRoot(); if(!pNewRoot) return FALSE; - + //Set the document information//////////////////////////////////////////// - + CPDF_Dictionary* DInfoDict = pDestPDFDoc->GetInfo(); - + if(!DInfoDict) return FALSE; - + CFX_ByteString producerstr; producerstr.Format("PDFium"); DInfoDict->SetAt("Producer", new CPDF_String(producerstr)); @@ -59,7 +59,7 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document { pNewRoot->SetAt("Type", new CPDF_Name("Catalog")); } - + CPDF_Dictionary* pNewPages = (CPDF_Dictionary*)(pNewRoot->GetElement("Pages")? pNewRoot->GetElement("Pages")->GetDirect() : NULL); if(!pNewPages) { @@ -67,7 +67,7 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document FX_DWORD NewPagesON = pDestPDFDoc->AddIndirectObject(pNewPages); pNewRoot->SetAt("Pages", new CPDF_Reference(pDestPDFDoc, NewPagesON)); } - + CFX_ByteString cbPageType = pNewPages->GetString("Type",""); if(cbPageType.Equal("")) { @@ -80,15 +80,15 @@ FX_BOOL CPDF_PageOrganizer::PDFDocInit(CPDF_Document *pDestPDFDoc, CPDF_Document CPDF_Array* pNewKids = new CPDF_Array; FX_DWORD Kidsobjnum = -1; Kidsobjnum = pDestPDFDoc->AddIndirectObject(pNewKids);//, Kidsobjnum, Kidsgennum); - + pNewPages->SetAt("Kids", new CPDF_Reference(pDestPDFDoc, Kidsobjnum));//, Kidsgennum)); - pNewPages->SetAt("Count", new CPDF_Number(0)); + pNewPages->SetAt("Count", new CPDF_Number(0)); } return true; } -FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* nPageNum, +FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* nPageNum, CPDF_Document *pDestPDFDoc,int nIndex) { int curpage =nIndex; @@ -98,7 +98,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* for(int i=0; i<nPageNum->GetSize(); i++) { - + CPDF_Dictionary* pCurPageDict = pDestPDFDoc->CreateNewPage(curpage); CPDF_Dictionary* pSrcPageDict = pSrcPDFDoc->GetPage(nPageNum->GetAt(i)-1); if(!pSrcPageDict || !pCurPageDict) @@ -106,7 +106,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* delete pMapPtrToPtr; return FALSE; } - + // Clone the page dictionary/////////// FX_POSITION SrcPos = pSrcPageDict->GetStartPos(); while (SrcPos) @@ -120,15 +120,15 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* pCurPageDict->SetAt(cbSrcKeyStr, pObj->Clone()); } } - + //inheritable item/////////////////////// CPDF_Object* pInheritable = NULL; //1 MediaBox //required if(!pCurPageDict->KeyExist("MediaBox")) { - + pInheritable = PageDictGetInheritableTag(pSrcPageDict, "MediaBox"); - if(!pInheritable) + if(!pInheritable) { //Search the "CropBox" from source page dictionary, if not exists,we take the letter size. pInheritable = PageDictGetInheritableTag(pSrcPageDict, "CropBox"); @@ -152,7 +152,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* if(!pCurPageDict->KeyExist("Resources")) { pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Resources"); - if(!pInheritable) + if(!pInheritable) { delete pMapPtrToPtr; return FALSE; @@ -163,14 +163,14 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* if(!pCurPageDict->KeyExist("CropBox")) { pInheritable = PageDictGetInheritableTag(pSrcPageDict, "CropBox"); - if(pInheritable) + if(pInheritable) pCurPageDict->SetAt("CropBox", pInheritable->Clone()); } //4 Rotate //Optional if(!pCurPageDict->KeyExist("Rotate")) { pInheritable = PageDictGetInheritableTag(pSrcPageDict, "Rotate"); - if(pInheritable) + if(pInheritable) pCurPageDict->SetAt("Rotate", pInheritable->Clone()); } @@ -178,7 +178,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* //Update the reference FX_DWORD dwOldPageObj = pSrcPageDict->GetObjNum(); FX_DWORD dwNewPageObj = pCurPageDict->GetObjNum(); - + pMapPtrToPtr->SetAt((void*)(uintptr_t)dwOldPageObj, (void*)(uintptr_t)dwNewPageObj); UpdateReference(pCurPageDict, pDestPDFDoc, pMapPtrToPtr); @@ -191,7 +191,7 @@ FX_BOOL CPDF_PageOrganizer::ExportPage(CPDF_Document *pSrcPDFDoc, CFX_WordArray* CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(CPDF_Dictionary *pDict, CFX_ByteString nSrctag) { - if(!pDict || !pDict->KeyExist("Type") || nSrctag.IsEmpty()) + if(!pDict || !pDict->KeyExist("Type") || nSrctag.IsEmpty()) return NULL; CPDF_Object* pType = pDict->GetElement("Type")->GetDirect(); @@ -202,14 +202,14 @@ CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(CPDF_Dictionary *pDic if(!pDict->KeyExist("Parent")) return NULL; CPDF_Object* pParent = pDict->GetElement("Parent")->GetDirect(); if(!pParent || pParent->GetType() != PDFOBJ_DICTIONARY) return NULL; - + CPDF_Dictionary* pp = (CPDF_Dictionary*)pParent; - - if(pDict->KeyExist((const char*)nSrctag)) + + if(pDict->KeyExist((const char*)nSrctag)) return pDict->GetElement((const char*)nSrctag); while (pp) { - if(pp->KeyExist((const char*)nSrctag)) + if(pp->KeyExist((const char*)nSrctag)) return pp->GetElement((const char*)nSrctag); else if (pp->KeyExist("Parent")) { @@ -218,11 +218,11 @@ CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(CPDF_Dictionary *pDic } else break; } - + return NULL; } -FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object *pObj, CPDF_Document *pDoc, +FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object *pObj, CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPtrToPtr) { switch (pObj->GetType()) @@ -238,7 +238,7 @@ FX_BOOL CPDF_PageOrganizer::UpdateReference(CPDF_Object *pObj, CPDF_Document *pD case PDFOBJ_DICTIONARY: { CPDF_Dictionary* pDict = (CPDF_Dictionary*)pObj; - + FX_POSITION pos = pDict->GetStartPos(); while(pos) { @@ -299,9 +299,9 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt if(!pRef) return 0; dwObjnum = pRef->GetRefObjNum(); - + size_t dwNewObjNum = 0; - + pMapPtrToPtr->Lookup((void*)dwObjnum, (void*&)dwNewObjNum); if(dwNewObjNum) { @@ -320,7 +320,7 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt { return 0; } - + if(pClone->GetType() == PDFOBJ_DICTIONARY) { CPDF_Dictionary* pDictClone = (CPDF_Dictionary*)pClone; @@ -341,7 +341,7 @@ int CPDF_PageOrganizer::GetNewObjId(CPDF_Document *pDoc, CFX_MapPtrToPtr* pMapPt } dwNewObjNum = pDoc->AddIndirectObject(pClone);//, onum, gnum); pMapPtrToPtr->SetAt((void*)dwObjnum, (void*)dwNewObjNum); - + if(!UpdateReference(pClone, pDoc, pMapPtrToPtr)) { pClone->Release(); @@ -376,7 +376,7 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring, CFX_WordArray* pageAr nStringTo = nLength; } cbMidRange = rangstring.Mid(nStringFrom,nStringTo-nStringFrom); - + int nMid = cbMidRange.Find('-'); if(nMid == -1) { @@ -398,10 +398,10 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring, CFX_WordArray* pageAr int nEnd = cbMidRange.GetLength()-nMid; if(nEnd ==0)return FALSE; - + // int nEndPageNum = (nEnd == 0)?nCount:atol(cbMidRange.Mid(nMid,nEnd)); int nEndPageNum = atol(cbMidRange.Mid(nMid,nEnd)); - + if(nStartPageNum < 0 ||nStartPageNum >nEndPageNum|| nEndPageNum > nCount) { return FALSE; @@ -418,7 +418,7 @@ FPDF_BOOL ParserPageRangeString(CFX_ByteString rangstring, CFX_WordArray* pageAr return TRUE; } -DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMENT src_doc, +DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMENT src_doc, FPDF_BYTESTRING pagerange, int index) { if(dest_doc == NULL || src_doc == NULL ) @@ -439,7 +439,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDF_ImportPages(FPDF_DOCUMENT dest_doc,FPDF_DOCUMEN pageArray.Add(i); } } - + CPDFXFA_Document* pDestDoc = (CPDFXFA_Document*)dest_doc; CPDF_Document* pDestPDFDoc = pDestDoc->GetPDFDoc(); CPDF_PageOrganizer pageOrg; diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp index 34cf381555..ddf4a47513 100644 --- a/fpdfsdk/src/fpdfsave.cpp +++ b/fpdfsdk/src/fpdfsave.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_edit.h" @@ -20,13 +20,13 @@ class CFX_IFileWrite final : public IFX_StreamWrite { - + public: CFX_IFileWrite(); FX_BOOL Init( FPDF_FILEWRITE * pFileWriteStruct ); virtual FX_BOOL WriteBlock(const void* pData, size_t size) override; virtual void Release() override {} - + protected: FPDF_FILEWRITE* m_pFileWriteStruct; }; @@ -54,7 +54,7 @@ FX_BOOL CFX_IFileWrite::WriteBlock(const void* pData, size_t size) m_pFileWriteStruct->WriteBlock( m_pFileWriteStruct, pData, size ); return TRUE; } - else + else return FALSE; } @@ -86,7 +86,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList if (NULL == pAcroForm) return FALSE; CPDF_Object* pXFA = pAcroForm->GetElement("XFA"); - if (pXFA == NULL) + if (pXFA == NULL) return TRUE; if(pXFA->GetType() != PDFOBJ_ARRAY) return FALSE; @@ -117,7 +117,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList pContext = XFA_Checksum_Create(); FXSYS_assert(pContext); pContext->StartChecksum(); - + //template if (iTemplate > -1) { @@ -134,11 +134,11 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList CPDF_Stream* pFormStream = NULL; CPDF_Stream* pDataSetsStream = NULL; if (iFormIndex != -1) - { + { //Get form CPDF_Stream CPDF_Object* pFormPDFObj = pArray->GetElement(iFormIndex); if (pFormPDFObj->GetType() == PDFOBJ_REFERENCE) - { + { CPDF_Reference* pFormRefObj = (CPDF_Reference*)pFormPDFObj; CPDF_Object* pFormDircetObj = pFormPDFObj->GetDirect(); if (NULL != pFormDircetObj && pFormDircetObj->GetType() == PDFOBJ_STREAM) @@ -151,13 +151,13 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList pFormStream = (CPDF_Stream*)pFormPDFObj; } } - + if (iDataSetsIndex != -1) { //Get datasets CPDF_Stream CPDF_Object* pDataSetsPDFObj = pArray->GetElement(iDataSetsIndex); if (pDataSetsPDFObj->GetType() == PDFOBJ_REFERENCE) - { + { CPDF_Reference* pDataSetsRefObj = (CPDF_Reference*)pDataSetsPDFObj; CPDF_Object* pDataSetsDircetObj = pDataSetsRefObj->GetDirect(); if (NULL != pDataSetsDircetObj && pDataSetsDircetObj->GetType() == PDFOBJ_STREAM) @@ -169,7 +169,7 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList { pDataSetsStream = (CPDF_Stream*)pDataSetsPDFObj; } - } + } //end //L"datasets" { @@ -208,11 +208,11 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList fileList.Add(pDsfileWrite); } } - + //L"form" { - + IFX_FileStream* pfileWrite = FX_CreateMemoryStream(); if (NULL == pfileWrite) { @@ -254,7 +254,7 @@ FX_BOOL _SendPostSaveToXFADoc(CPDFXFA_Document* pDocument) if (pDocument->GetDocType() != DOCTYPE_DYNIMIC_XFA && pDocument->GetDocType() != DOCTYPE_STATIC_XFA) return TRUE; - + IXFA_DocView* pXFADocView = pDocument->GetXFADocView(); if (NULL == pXFADocView) return FALSE; @@ -266,7 +266,7 @@ FX_BOOL _SendPostSaveToXFADoc(CPDFXFA_Document* pDocument) while(pWidgetAcc) { CXFA_EventParam preParam; - preParam.m_eType = XFA_EVENT_PostSave; + preParam.m_eType = XFA_EVENT_PostSave; pWidgetHander->ProcessEvent(pWidgetAcc,&preParam); pWidgetAcc = pWidgetAccIterator->MoveToNext(); } @@ -291,11 +291,11 @@ FX_BOOL _SendPreSaveToXFADoc(CPDFXFA_Document* pDocument, CFX_PtrArray& fileList while(pWidgetAcc) { CXFA_EventParam preParam; - preParam.m_eType = XFA_EVENT_PreSave; + preParam.m_eType = XFA_EVENT_PreSave; pWidgetHander->ProcessEvent(pWidgetAcc, &preParam); pWidgetAcc = pWidgetAccIterator->MoveToNext(); } - pWidgetAccIterator->Release(); + pWidgetAccIterator->Release(); pXFADocView->UpdateDocView(); return _SaveXFADocumentData(pDocument, fileList); } @@ -310,14 +310,14 @@ FPDF_BOOL _FPDF_Doc_Save(FPDF_DOCUMENT document, FPDF_FILEWRITE * pFileWrite,FPD _SendPreSaveToXFADoc(pDoc, fileList); CPDF_Document* pPDFDoc = pDoc->GetPDFDoc(); - if (!pPDFDoc) + if (!pPDFDoc) return 0; - + if ( flags < FPDF_INCREMENTAL || flags > FPDF_REMOVE_SECURITY ) { flags = 0; } - + CPDF_Creator FileMaker(pPDFDoc); if (bSetVersion) FileMaker.SetFileVersion(fileVerion); diff --git a/fpdfsdk/src/fpdftext.cpp b/fpdfsdk/src/fpdftext.cpp index 951cde047c..610050ff59 100644 --- a/fpdfsdk/src/fpdftext.cpp +++ b/fpdfsdk/src/fpdftext.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../public/fpdf_text.h" @@ -71,7 +71,7 @@ DLLEXPORT void STDCALL FPDFText_GetCharBox(FPDF_TEXTPAGE text_page, int index,do { if (!text_page) return; IPDF_TextPage* textpage=(IPDF_TextPage*)text_page; - + if (index<0 || index>=textpage->CountChars()) return ; FPDF_CHAR_INFO charinfo; textpage->GetCharInfo(index,charinfo); @@ -93,7 +93,7 @@ DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,int start,int cou { if (!text_page) return 0; IPDF_TextPage* textpage=(IPDF_TextPage*)text_page; - + if (start>=textpage->CountChars()) return 0; CFX_WideString str=textpage->GetPageText(start,count); @@ -127,7 +127,7 @@ DLLEXPORT void STDCALL FPDFText_GetRect(FPDF_TEXTPAGE text_page,int rect_index, *bottom=rect.bottom; } -DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double left, double top, +DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double left, double top, double right, double bottom,unsigned short* buffer,int buflen) { if (!text_page) return 0; @@ -147,7 +147,7 @@ DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,double lef cbUTF16Str.ReleaseBuffer(size*sizeof(unsigned short)); return size; - + } //Search diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index 5b35c80110..80aad14ac2 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com @@ -65,7 +65,7 @@ FX_BOOL CFPDF_FileStream::ReadBlock(void* buffer, FX_FILESIZE offset, size_t siz size_t CFPDF_FileStream::ReadBlock(void* buffer, size_t size) { if (!buffer || !size || !m_pFS->ReadBlock) return 0; - + FX_FILESIZE nSize = GetSize(); if (m_nCurPos >= nSize) return 0; FX_FILESIZE dwAvail = nSize - m_nCurPos; @@ -306,7 +306,7 @@ public: virtual void Release() {delete this;} virtual FX_FILESIZE GetSize() {return m_size;} - virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) + virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offset, size_t size) { if (offset < 0) { return FALSE; @@ -472,7 +472,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int bBackgroundAlphaNeeded = pPage->BackgroundAlphaNeeded(); if (bBackgroundAlphaNeeded) { - + pBitmap = FX_NEW CFX_DIBitmap; pBitmap->Create(size_x, size_y, FXDIB_Argb); pBitmap->Clear(0x00ffffff); @@ -489,12 +489,12 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int Func_RenderPage(pContext, page, start_x, start_y, size_x, size_y, rotate, flags,TRUE,NULL); - if (bBackgroundAlphaNeeded) + if (bBackgroundAlphaNeeded) { if (pBitmap) { CFX_WindowsDevice WinDC(dc); - + if (WinDC.GetDeviceCaps(FXDC_DEVICE_CLASS) == FXDC_PRINTER) { CFX_DIBitmap* pDst = FX_NEW CFX_DIBitmap; @@ -564,7 +564,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int 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 CPDF_ModuleMgr::Get()->ReportError(999, "Ready for PDF rendering"); #endif @@ -615,7 +615,7 @@ DLLEXPORT void STDCALL FPDF_RenderPage(HDC dc, FPDF_PAGE page, int start_x, int } #endif -DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, +DLLEXPORT void STDCALL FPDF_RenderPageBitmap(FPDF_BITMAP bitmap, FPDF_PAGE page, int start_x, int start_y, int size_x, int size_y, int rotate, int flags) { if (bitmap == NULL || page == NULL) return; @@ -658,11 +658,11 @@ DLLEXPORT void STDCALL FPDF_CloseDocument(FPDF_DOCUMENT document) { if (!document) return; - CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document; + CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document; delete pDoc; // CPDF_Parser* pParser = (CPDF_Parser*)pDoc->GetParser(); -// if (pParser == NULL) +// if (pParser == NULL) // { // delete pDoc; // return; @@ -804,7 +804,7 @@ void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_ CFX_AffineMatrix matrix; - pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); + pPage->GetDisplayMatrix(matrix, start_x, start_y, size_x, size_y, rotate); FX_RECT clip; clip.left = start_x; @@ -830,7 +830,7 @@ void FPDF_RenderPage_Retail(CRenderContext* pContext, FPDF_PAGE page, int start_ { pContext->m_pDevice->RestoreState(); } - + //#endif } @@ -839,10 +839,10 @@ DLLEXPORT int STDCALL FPDF_GetPageSizeByIndex(FPDF_DOCUMENT document, int page_i // CPDF_Document* pDoc = (CPDF_Document*)document; // if(pDoc == NULL) // return FALSE; -// +// // CPDF_Dictionary* pDict = pDoc->GetPage(page_index); // if (pDict == NULL) return FALSE; -// +// // CPDF_Page page; // page.Load(pDoc, pDict); // *width = page.GetPageWidth(); @@ -927,12 +927,12 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDestByName(FPDF_DOCUMENT document,FPDF_ { if (!document) return NULL; - if (!name || name[0] == 0) + if (!name || name[0] == 0) return NULL; CPDFXFA_Document* pDoc = (CPDFXFA_Document*)document; CPDF_Document* pPDFDoc = pDoc->GetPDFDoc(); - if (!pPDFDoc) + if (!pPDFDoc) return NULL; CPDF_NameTree name_tree(pPDFDoc, FX_BSTRC("Dests")); return name_tree.LookupNamedDest(pPDFDoc, name); diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp index 22112ab5d6..574302302a 100644 --- a/fpdfsdk/src/fsdk_annothandler.cpp +++ b/fpdfsdk/src/fsdk_annothandler.cpp @@ -70,7 +70,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::NewAnnot(CPDF_Annot * pAnnot, CPDFSDK_Pa { return pAnnotHandler->NewAnnot(pAnnot, pPageView); } - + return new CPDFSDK_BAAnnot(pAnnot, pPageView); } @@ -381,12 +381,12 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX { CPDFSDK_PageView* pPageView = pSDKAnnot->GetPageView(); CPDFXFA_Page* pPage = pPageView->GetPDFXFAPage(); - if (pPage == NULL) + if (pPage == NULL) return NULL; - if (pPage->GetPDFPage()) { // for pdf annots. + if (pPage->GetPDFPage()) { // for pdf annots. CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), pSDKAnnot->GetType(), ""); - CPDFSDK_Annot* pNext = bNext ? - ai.GetNextAnnot(pSDKAnnot) : + CPDFSDK_Annot* pNext = bNext ? + ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot); return pNext; } @@ -394,7 +394,7 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,FX IXFA_WidgetIterator* pWidgetIterator = pPage->GetXFAPageView()->CreateWidgetIterator(XFA_TRAVERSEWAY_Tranvalse, XFA_WIDGETFILTER_Visible | XFA_WIDGETFILTER_Viewable | XFA_WIDGETFILTER_Field); if (pWidgetIterator == NULL) return NULL; - if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget()) + if (pWidgetIterator->GetCurrentWidget() != pSDKAnnot->GetXFAWidget()) pWidgetIterator->SetCurrentWidget(pSDKAnnot->GetXFAWidget()); IXFA_Widget* hNextFocus = NULL; hNextFocus = bNext?pWidgetIterator->MoveToNext():pWidgetIterator->MoveToPrevious(); @@ -714,7 +714,7 @@ void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) { ASSERT(pAnnot != NULL); - + CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); ASSERT(pPageView != NULL); @@ -723,7 +723,7 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) CPDFXFA_Document* pDoc = pSDKDoc->GetDocument(); ASSERT(pDoc != NULL); - + CFX_ByteString sSubType = pAnnot->GetSubType(); if (sSubType == BFFT_SIGNATURE) @@ -745,13 +745,13 @@ void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) pWidget->ResetAppearance(sValue.c_str(), FALSE); } } - - if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) + + if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty()) pWidget->ResetAppearance(FALSE); } - + if (m_pFormFiller) m_pFormFiller->OnLoad(pAnnot); @@ -914,7 +914,7 @@ CPDF_Rect CPDFSDK_XFAAnnotHandler::GetViewBBox(CPDFSDK_PageView *pPageView, CPDF CFX_RectF rcBBox; if (eType == XFA_ELEMENT_Signature) pWidgetHandler->GetBBox (pAnnot->GetXFAWidget(), rcBBox, XFA_WIDGETSTATUS_Visible, TRUE); - else + else pWidgetHandler->GetBBox (pAnnot->GetXFAWidget(), rcBBox, 0); CFX_FloatRect rcWidget(rcBBox.left, rcBBox.top, rcBBox.left + rcBBox.width, rcBBox.top+rcBBox.height); @@ -953,7 +953,7 @@ FX_BOOL CPDFSDK_XFAAnnotHandler::HitTest(CPDFSDK_PageView *pPageView, CPDFSDK_An void CPDFSDK_XFAAnnotHandler::OnMouseEnter(CPDFSDK_PageView *pPageView, CPDFSDK_Annot* pAnnot, FX_DWORD nFlag) { - if (!pPageView || !pAnnot) + if (!pPageView || !pAnnot) return; IXFA_WidgetHandler* pWidgetHandler = GetXFAWidgetHandler(pAnnot); ASSERT(pWidgetHandler != NULL); diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 91fd3ef0b2..e9a1cc396e 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../include/fsdk_define.h" @@ -11,7 +11,7 @@ //--------------------------------------------------------------------------- -// CPDFSDK_DateTime +// CPDFSDK_DateTime //--------------------------------------------------------------------------- int _gAfxGetTimeZoneInSeconds(FX_CHAR tzhour, uint8_t tzminute) { @@ -377,7 +377,7 @@ void CPDFSDK_DateTime::ToSystemTime(FX_SYSTEMTIME& st) CPDFSDK_DateTime dt = *this; time_t t = (time_t)dt; struct tm* pTime = localtime(&t); - if(pTime){ + if(pTime){ st.wYear = (FX_WORD)pTime->tm_year + 1900; st.wMonth = (FX_WORD)pTime->tm_mon + 1; st.wDay = (FX_WORD)pTime->tm_mday; @@ -502,7 +502,7 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddSeconds(int seconds) //--------------------------------------------------------------------------- -// CPDFSDK_Annot +// CPDFSDK_Annot //--------------------------------------------------------------------------- CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView) : m_pPageView(pPageView), @@ -540,7 +540,7 @@ void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected) m_bSelected = bSelected; } -// Tab Order +// Tab Order int CPDFSDK_Annot::GetTabOrder() { return m_nTabOrder; @@ -554,7 +554,7 @@ void CPDFSDK_Annot::SetTabOrder(int iTabOrder) CPDF_Dictionary* CPDFSDK_BAAnnot::GetAnnotDict() const { ASSERT(m_pAnnot != NULL); - + return m_pAnnot->GetAnnotDict(); } @@ -562,24 +562,24 @@ void CPDFSDK_BAAnnot::SetRect(const CPDF_Rect& rect) { ASSERT(rect.right - rect.left >= GetMinWidth()); ASSERT(rect.top - rect.bottom >= GetMinHeight()); - + m_pAnnot->GetAnnotDict()->SetAtRect("Rect", rect); } CPDF_Rect CPDFSDK_BAAnnot::GetRect() const { ASSERT(m_pAnnot != NULL); - + CPDF_Rect rect; m_pAnnot->GetRect(rect); - + return rect; } CFX_ByteString CPDFSDK_BAAnnot::GetType() const { ASSERT(m_pAnnot != NULL); - + return m_pAnnot->GetSubType(); } @@ -594,11 +594,11 @@ void CPDFSDK_BAAnnot::ResetAppearance() } void CPDFSDK_BAAnnot::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device, - CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions) + CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions) { ASSERT(m_pPageView != NULL); ASSERT(m_pAnnot != NULL); - + m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, mode, pOptions); } @@ -611,7 +611,7 @@ FX_BOOL CPDFSDK_BAAnnot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode) { CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP"); if (pAP == NULL) return FALSE; - + // Choose the right sub-ap const FX_CHAR* ap_entry = "N"; if (mode == CPDF_Annot::Down) @@ -620,11 +620,11 @@ FX_BOOL CPDFSDK_BAAnnot::IsAppearanceValid(CPDF_Annot::AppearanceMode mode) ap_entry = "R"; if (!pAP->KeyExist(ap_entry)) ap_entry = "N"; - + // Get the AP stream or subdirectory CPDF_Object* psub = pAP->GetElementValue(ap_entry); if (psub == NULL) return FALSE; - + return TRUE; } @@ -632,14 +632,14 @@ void CPDFSDK_BAAnnot::DrawBorder(CFX_RenderDevice* pDevice, const CPDF_Matrix* p const CPDF_RenderOptions* pOptions) { ASSERT(m_pAnnot != NULL); - m_pAnnot->DrawBorder(pDevice, pUser2Device, pOptions); + m_pAnnot->DrawBorder(pDevice, pUser2Device, pOptions); } void CPDFSDK_BAAnnot::ClearCachedAP() { ASSERT(m_pAnnot != NULL); m_pAnnot->ClearCachedAP(); -} +} void CPDFSDK_BAAnnot::SetContents(const CFX_WideString& sContents) { @@ -671,7 +671,7 @@ void CPDFSDK_BAAnnot::SetModifiedDate(const FX_SYSTEMTIME& st) { CPDFSDK_DateTime dt(st); CFX_ByteString str = dt.ToPDFDateTimeString(); - + if (str.IsEmpty()) m_pAnnot->GetAnnotDict()->RemoveAt("M"); else @@ -680,12 +680,12 @@ void CPDFSDK_BAAnnot::SetModifiedDate(const FX_SYSTEMTIME& st) FX_SYSTEMTIME CPDFSDK_BAAnnot::GetModifiedDate() const { - FX_SYSTEMTIME systime; + FX_SYSTEMTIME systime; CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetString("M"); - + CPDFSDK_DateTime dt(str); dt.ToSystemTime(systime); - + return systime; } @@ -810,8 +810,8 @@ int CPDFSDK_BAAnnot::GetBorderStyle() const CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); if (pBorder) { - if (pBorder->GetCount() >= 4) - { + if (pBorder->GetCount() >= 4) + { CPDF_Array *pDP = pBorder->GetArray(3); if (pDP && pDP->GetCount() > 0) return BBS_DASH; @@ -924,21 +924,21 @@ FX_BOOL CPDFSDK_BAAnnot::GetColor(FX_COLORREF& color) const } -void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox, +void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox, const CPDF_Matrix& matrix, const CFX_ByteString& sContents, const CFX_ByteString& sAPState) { CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDict("AP"); - - if (!pAPDict) + + if (!pAPDict) { pAPDict = new CPDF_Dictionary; m_pAnnot->GetAnnotDict()->SetAt("AP", pAPDict); } - + CPDF_Stream* pStream = NULL; CPDF_Dictionary* pParentDict = NULL; - + if (sAPState.IsEmpty()) { pParentDict = pAPDict; @@ -952,12 +952,12 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_ pAPTypeDict = FX_NEW CPDF_Dictionary; pAPDict->SetAt(sAPType, pAPTypeDict); } - + pParentDict = pAPTypeDict; pStream = pAPTypeDict->GetStream(sAPState); } - - if (!pStream) + + if (!pStream) { ASSERT(m_pPageView != NULL); CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); @@ -971,7 +971,7 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_ } CPDF_Dictionary * pStreamDict = pStream->GetDict(); - + if (!pStreamDict) { pStreamDict = FX_NEW CPDF_Dictionary; @@ -980,13 +980,13 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, const CPDF_ pStreamDict->SetAtInteger("FormType", 1); pStream->InitStream(NULL,0,pStreamDict); } - + if (pStreamDict) { - pStreamDict->SetAtMatrix("Matrix",matrix); - pStreamDict->SetAtRect("BBox", rcBBox); + pStreamDict->SetAtMatrix("Matrix",matrix); + pStreamDict->SetAtRect("BBox", rcBBox); } - + pStream->SetData((uint8_t*)sContents.c_str(), sContents.GetLength(), FALSE, FALSE); } @@ -1045,7 +1045,7 @@ CPDF_AAction CPDFSDK_BAAnnot::GetAAction() const void CPDFSDK_BAAnnot::SetAAction(const CPDF_AAction& aa) { ASSERT(aa != NULL); - + if ((CPDF_AAction&)aa != m_pAnnot->GetAnnotDict()->GetDict("AA")) m_pAnnot->GetAnnotDict()->SetAt("AA", (CPDF_AAction&)aa); } @@ -1075,7 +1075,7 @@ FX_BOOL CPDFSDK_BAAnnot::IsXFAField() void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, CPDF_RenderOptions* pOptions) { - + m_pAnnot->GetAPForm(m_pPageView->GetPDFPage(), CPDF_Annot::Normal); m_pAnnot->DrawAppearance(m_pPageView->GetPDFPage(), pDevice, pUser2Device, CPDF_Annot::Normal, NULL); diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index d9449d892a..9ea2f4e487 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../third_party/base/nonstd_unique_ptr.h" @@ -17,7 +17,7 @@ #include "../include/javascript/IJavaScript.h" //------------------------------------------------------------------------------------ -//* CPDFSDK_Widget +//* CPDFSDK_Widget //------------------------------------------------------------------------------------ #define IsFloatZero(f) ((f) < 0.01 && (f) > -0.01) @@ -156,7 +156,7 @@ static XFA_EVENTTYPE GetXFAEventType(CPDF_AAction::AActionType eAAT, FX_BOOL bWi switch (eAAT) { case CPDF_AAction::CursorEnter: - eEventType = XFA_EVENT_MouseEnter; + eEventType = XFA_EVENT_MouseEnter; break; case CPDF_AAction::CursorExit: eEventType = XFA_EVENT_MouseExit; @@ -165,7 +165,7 @@ static XFA_EVENTTYPE GetXFAEventType(CPDF_AAction::AActionType eAAT, FX_BOOL bWi eEventType = XFA_EVENT_MouseDown; break; case CPDF_AAction::ButtonUp: - eEventType = XFA_EVENT_MouseUp; + eEventType = XFA_EVENT_MouseUp; break; case CPDF_AAction::GetFocus: eEventType = XFA_EVENT_Enter; @@ -214,7 +214,7 @@ FX_BOOL CPDFSDK_Widget::HasXFAAAction(PDFSDK_XFAAActionType eXFAAAT) XFA_EVENTTYPE eEventType = GetXFAEventType(eXFAAAT); if ((eEventType == XFA_EVENT_Click || - eEventType == XFA_EVENT_Change) && + eEventType == XFA_EVENT_Change) && GetFieldType() == FIELDTYPE_RADIOBUTTON) { if (IXFA_Widget* hGroupWidget = GetGroupMixXFAWidget()) @@ -271,20 +271,20 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, PDFSDK_Field param.m_wsPrevText = data.sValue; if ((eEventType == XFA_EVENT_Click || - eEventType == XFA_EVENT_Change) && + eEventType == XFA_EVENT_Change) && GetFieldType() == FIELDTYPE_RADIOBUTTON) { if (IXFA_Widget* hGroupWidget = GetGroupMixXFAWidget()) { CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hGroupWidget); param.m_pTarget = pAcc; - pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); + pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); } { CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hWidget); param.m_pTarget = pAcc; - int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); + int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); return nRet == XFA_EVENTERROR_Sucess; } } @@ -292,7 +292,7 @@ FX_BOOL CPDFSDK_Widget::OnXFAAAction(PDFSDK_XFAAActionType eXFAAAT, PDFSDK_Field { CXFA_WidgetAcc* pAcc = pXFAWidgetHandler->GetDataAcc(hWidget); param.m_pTarget = pAcc; - int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); + int32_t nRet = pXFAWidgetHandler->ProcessEvent(pAcc, ¶m); return nRet == XFA_EVENTERROR_Sucess; } @@ -322,7 +322,7 @@ void CPDFSDK_Widget::Synchronize(FX_BOOL bSynchronizeElse) { case FIELDTYPE_CHECKBOX: case FIELDTYPE_RADIOBUTTON: - { + { CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); @@ -421,7 +421,7 @@ void CPDFSDK_Widget::SynchronizeXFAItems() } } -void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, +void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, CPDF_FormField* pFormField, CPDF_FormControl* pFormControl) { ASSERT(pXFADocView != NULL); @@ -440,7 +440,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* { FX_BOOL bChecked = pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On; - pFormField->CheckControl(pFormField->GetControlIndex(pFormControl), + pFormField->CheckControl(pFormField->GetControlIndex(pFormControl), bChecked, TRUE); } } @@ -451,7 +451,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* { FX_BOOL bChecked = pWidgetAcc->GetCheckState() == XFA_CHECKSTATE_On; - pFormField->CheckControl(pFormField->GetControlIndex(pFormControl), + pFormField->CheckControl(pFormField->GetControlIndex(pFormControl), bChecked, TRUE); } } @@ -510,7 +510,7 @@ void CPDFSDK_Widget::SynchronizeXFAValue(IXFA_DocView* pXFADocView, IXFA_Widget* } } -void CPDFSDK_Widget::SynchronizeXFAItems(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, +void CPDFSDK_Widget::SynchronizeXFAItems(IXFA_DocView* pXFADocView, IXFA_Widget* hWidget, CPDF_FormField* pFormField, CPDF_FormControl* pFormControl) { ASSERT(pXFADocView != NULL); @@ -566,7 +566,7 @@ FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode { CPDF_Dictionary* pAP = m_pAnnot->GetAnnotDict()->GetDict("AP"); if (pAP == NULL) return FALSE; - + // Choose the right sub-ap const FX_CHAR* ap_entry = "N"; if (mode == CPDF_Annot::Down) @@ -575,11 +575,11 @@ FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode ap_entry = "R"; if (!pAP->KeyExist(ap_entry)) ap_entry = "N"; - + // Get the AP stream or subdirectory CPDF_Object* psub = pAP->GetElementValue(ap_entry); if (psub == NULL) return FALSE; - + int nFieldType = GetFieldType(); switch (nFieldType) { @@ -591,17 +591,17 @@ FX_BOOL CPDFSDK_Widget::IsWidgetAppearanceValid(CPDF_Annot::AppearanceMode mode return psub->GetType() == PDFOBJ_STREAM; case FIELDTYPE_CHECKBOX: case FIELDTYPE_RADIOBUTTON: - if (psub->GetType() == PDFOBJ_DICTIONARY) + if (psub->GetType() == PDFOBJ_DICTIONARY) { CPDF_Dictionary* pSubDict = (CPDF_Dictionary*)psub; - + return pSubDict->GetStream(GetAppState()) != NULL; } else return FALSE; break; } - + return TRUE; } @@ -609,7 +609,7 @@ int CPDFSDK_Widget::GetFieldType() const { CPDF_FormField* pField = GetFormField(); ASSERT(pField != NULL); - + return pField->GetFieldType(); } @@ -643,7 +643,7 @@ int CPDFSDK_Widget::GetFieldFlags() const CFX_ByteString CPDFSDK_Widget::GetSubType() const { int nType = GetFieldType(); - + if (nType == FIELDTYPE_SIGNATURE) return BFFT_SIGNATURE; return CPDFSDK_Annot::GetSubType(); @@ -652,20 +652,20 @@ CFX_ByteString CPDFSDK_Widget::GetSubType() const CPDF_FormField* CPDFSDK_Widget::GetFormField() const { ASSERT(m_pInterForm != NULL); - - CPDF_FormControl* pCtrl = GetFormControl(); + + CPDF_FormControl* pCtrl = GetFormControl(); ASSERT(pCtrl != NULL); - + return pCtrl->GetField(); } CPDF_FormControl* CPDFSDK_Widget::GetFormControl() const { ASSERT(m_pInterForm != NULL); - + CPDF_InterForm* pPDFInterForm = m_pInterForm->GetInterForm(); ASSERT(pPDFInterForm != NULL); - + return pPDFInterForm->GetControlByDict(GetAnnotDict()); } static CPDF_Dictionary* BF_GetField(CPDF_Dictionary* pFieldDict, const FX_CHAR* name) @@ -674,11 +674,11 @@ static CPDF_Dictionary* BF_GetField(CPDF_Dictionary* pFieldDict, const FX_CHAR* // First check the dictionary itself CPDF_Object* pAttr = pFieldDict->GetElementValue(name); if (pAttr) return pFieldDict; - + // Now we need to search from parents CPDF_Dictionary* pParent = pFieldDict->GetDict("Parent"); if (pParent == NULL) return NULL; - + return BF_GetField(pParent, name); } @@ -686,9 +686,9 @@ CPDF_FormControl* CPDFSDK_Widget::GetFormControl(CPDF_InterForm* pInterForm, CPD { ASSERT(pInterForm != NULL); ASSERT(pAnnotDict != NULL); - + CPDF_FormControl* pControl = pInterForm->GetControlByDict(pAnnotDict); - + return pControl; } @@ -696,7 +696,7 @@ int CPDFSDK_Widget::GetRotate() const { CPDF_FormControl* pCtrl = GetFormControl(); ASSERT(pCtrl != NULL); - + return pCtrl->GetRotation() % 360; } @@ -714,10 +714,10 @@ FX_BOOL CPDFSDK_Widget::GetFillColor(FX_COLORREF& color) const { CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - - int iColorType = 0; + + int iColorType = 0; color = FX_ARGBTOCOLORREF(pFormCtrl->GetBackgroundColor(iColorType)); - + return iColorType != COLORTYPE_TRANSPARENT; } @@ -725,10 +725,10 @@ FX_BOOL CPDFSDK_Widget::GetBorderColor(FX_COLORREF& color) const { CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - - int iColorType = 0; + + int iColorType = 0; color = FX_ARGBTOCOLORREF(pFormCtrl->GetBorderColor(iColorType)); - + return iColorType != COLORTYPE_TRANSPARENT; } @@ -736,18 +736,18 @@ FX_BOOL CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const { CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - + CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance(); if (da.HasColor()) { FX_ARGB argb; - int iColorType = COLORTYPE_TRANSPARENT; + int iColorType = COLORTYPE_TRANSPARENT; da.GetColor(argb, iColorType); color = FX_ARGBTOCOLORREF(argb); - + return iColorType != COLORTYPE_TRANSPARENT; } - + return FALSE; } @@ -755,12 +755,12 @@ FX_FLOAT CPDFSDK_Widget::GetFontSize() const { CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - + CPDF_DefaultAppearance pDa = pFormCtrl->GetDefaultAppearance(); CFX_ByteString csFont = ""; FX_FLOAT fFontSize = 0.0f; pDa.GetFont(csFont, fFontSize); - + return fFontSize; } @@ -780,7 +780,7 @@ int CPDFSDK_Widget::GetSelectedIndex(int nIndex) CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->GetSelectedIndex(nIndex); } @@ -801,7 +801,7 @@ CFX_WideString CPDFSDK_Widget::GetValue(FX_BOOL bDisplay) CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->GetValue(); } @@ -809,7 +809,7 @@ CFX_WideString CPDFSDK_Widget::GetDefaultValue() const { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->GetDefaultValue(); } @@ -817,7 +817,7 @@ CFX_WideString CPDFSDK_Widget::GetOptionLabel(int nIndex) const { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->GetOptionLabel(nIndex); } @@ -825,7 +825,7 @@ int CPDFSDK_Widget::CountOptions() const { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->CountOptions(); } @@ -847,7 +847,7 @@ FX_BOOL CPDFSDK_Widget::IsOptionSelected(int nIndex) CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->IsItemSelected(nIndex); } @@ -855,7 +855,7 @@ int CPDFSDK_Widget::GetTopVisibleIndex() const { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->GetTopVisibleIndex(); } @@ -875,7 +875,7 @@ FX_BOOL CPDFSDK_Widget::IsChecked() CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - + return pFormCtrl->IsChecked(); } @@ -883,7 +883,7 @@ int CPDFSDK_Widget::GetAlignment() const { CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - + return pFormCtrl->GetControlAlignment(); } @@ -891,7 +891,7 @@ int CPDFSDK_Widget::GetMaxLen() const { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + return pFormField->GetMaxLen(); } @@ -899,10 +899,10 @@ void CPDFSDK_Widget::SetCheck(FX_BOOL bChecked, FX_BOOL bNotify) { CPDF_FormControl* pFormCtrl = GetFormControl(); ASSERT(pFormCtrl != NULL); - + CPDF_FormField* pFormField = pFormCtrl->GetField(); ASSERT(pFormField != NULL); - + pFormField->CheckControl(pFormField->GetControlIndex(pFormCtrl), bChecked, bNotify); if (!IsWidgetAppearanceValid(CPDF_Annot::Normal)) ResetAppearance(TRUE); @@ -914,7 +914,7 @@ void CPDFSDK_Widget::SetValue(const CFX_WideString& sValue, FX_BOOL bNotify) { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + pFormField->SetValue(sValue, bNotify); if (!bNotify) @@ -928,7 +928,7 @@ void CPDFSDK_Widget::SetOptionSelection(int index, FX_BOOL bSelected, FX_BOOL bN { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + pFormField->SetItemSelection(index, bSelected, bNotify); if (!bNotify) @@ -939,7 +939,7 @@ void CPDFSDK_Widget::ClearSelection(FX_BOOL bNotify) { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + pFormField->ClearSelection(bNotify); if (!bNotify) @@ -997,7 +997,7 @@ void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChang m_nValueAge++; int nFieldType = GetFieldType(); - + switch (nFieldType) { case FIELDTYPE_PUSHBUTTON: @@ -1019,7 +1019,7 @@ void CPDFSDK_Widget::ResetAppearance(const FX_WCHAR* sValue, FX_BOOL bValueChang ResetAppearance_TextField(sValue); break; } - + ASSERT(m_pAnnot != NULL); m_pAnnot->ClearCachedAP(); } @@ -1035,7 +1035,7 @@ void CPDFSDK_Widget::ResetFieldAppearance(FX_BOOL bValueChanged) { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + ASSERT(m_pInterForm != NULL); m_pInterForm->ResetFieldAppearance(pFormField, NULL, bValueChanged); @@ -1045,21 +1045,21 @@ void CPDFSDK_Widget::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix CPDF_Annot::AppearanceMode mode, const CPDF_RenderOptions* pOptions) { int nFieldType = GetFieldType(); - + if ((nFieldType == FIELDTYPE_CHECKBOX || nFieldType == FIELDTYPE_RADIOBUTTON) && - mode == CPDF_Annot::Normal && + mode == CPDF_Annot::Normal && !IsWidgetAppearanceValid(CPDF_Annot::Normal)) { CFX_PathData pathData; - + CPDF_Rect rcAnnot = GetRect(); - + pathData.AppendRect(rcAnnot.left, rcAnnot.bottom, rcAnnot.right, rcAnnot.top); - + CFX_GraphStateData gsd; gsd.m_LineWidth = 0.0f; - + pDevice->DrawPath(&pathData, pUser2Device, &gsd, 0, 0xFFAAAAAA, FXFILL_ALTERNATE); } else @@ -1072,7 +1072,7 @@ void CPDFSDK_Widget::UpdateField() { CPDF_FormField* pFormField = GetFormField(); ASSERT(pFormField != NULL); - + ASSERT(m_pInterForm != NULL); m_pInterForm->UpdateField(pFormField); } @@ -1080,11 +1080,11 @@ void CPDFSDK_Widget::UpdateField() void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPageView) { ASSERT(m_pInterForm != NULL); - + int nFieldType = GetFieldType(); if (m_pInterForm->IsNeedHighLight(nFieldType)) { - + // if (nFieldType != FIELDTYPE_PUSHBUTTON) // { CPDF_Rect rc = GetRect(); @@ -1107,7 +1107,7 @@ void CPDFSDK_Widget::DrawShadow(CFX_RenderDevice* pDevice, CPDFSDK_PageView* pPa FX_ARGB argb = ArgbEncode((int)alpha, color); FX_RECT rcDev((int)rcDevice.left,(int)rcDevice.top,(int)rcDevice.right,(int)rcDevice.bottom); - pDevice->FillRect(&rcDev, argb); + pDevice->FillRect(&rcDev, argb); /* }*/ } } @@ -1118,8 +1118,8 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() ASSERT(pControl != NULL); - - CPDF_Rect rcWindow = GetRotatedRect(); + + CPDF_Rect rcWindow = GetRotatedRect(); int32_t nLayout = 0; @@ -1187,12 +1187,12 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() case BBS_UNDERLINE: nBorderStyle = PBS_UNDERLINED; break; - default: + default: nBorderStyle = PBS_SOLID; break; } - CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth); + CPDF_Rect rcClient = CPWL_Utils::DeflateRect(rcWindow,fBorderWidth); CPWL_Color crText(COLORTYPE_GRAY,0); @@ -1206,7 +1206,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]); } - if (da.HasFont()) + if (da.HasFont()) da.GetFont(csNameTag, fFontSize); CFX_WideString csWCaption; @@ -1280,7 +1280,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() FontMap.SetAPType("N"); - CFX_ByteString csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) + + CFX_ByteString csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) + CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) + CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pNormalIcon, iconFit, csNormalCaption, crText, fFontSize, nLayout); @@ -1291,7 +1291,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() CPDF_FormControl::HighlightingMode eHLM = pControl->GetHighlightingMode(); if (eHLM == CPDF_FormControl::Push || eHLM == CPDF_FormControl::Toggle) { - if (csRolloverCaption.IsEmpty() && !pRolloverIcon) + if (csRolloverCaption.IsEmpty() && !pRolloverIcon) { csRolloverCaption = csNormalCaption; pRolloverIcon = pNormalIcon; @@ -1299,7 +1299,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() FontMap.SetAPType("R"); - csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) + + csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, crBackground) + CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) + CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pRolloverIcon, iconFit, csRolloverCaption, crText, fFontSize, nLayout); @@ -1327,11 +1327,11 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() crRightBottom = CPWL_Color(COLORTYPE_GRAY,1); break; } - + FontMap.SetAPType("D"); - csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, CPWL_Utils::SubstractColor(crBackground,0.25f)) + - CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) + + csAP = CPWL_Utils::GetRectFillAppStream(rcWindow, CPWL_Utils::SubstractColor(crBackground,0.25f)) + + CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder) + CPWL_Utils::GetPushButtonAppStream(iconFit.GetFittingBounds() ? rcWindow : rcClient, &FontMap, pDownIcon, iconFit, csDownCaption, crText, fFontSize, nLayout); WriteAppearance("D", GetRotatedRect(), GetMatrix(), csAP); @@ -1353,7 +1353,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() CPWL_Color crBackground, crBorder, crText; - + int iColorType; FX_FLOAT fc[4]; @@ -1391,7 +1391,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() case BBS_UNDERLINE: nBorderStyle = PBS_UNDERLINED; break; - default: + default: nBorderStyle = PBS_SOLID; break; } @@ -1414,7 +1414,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() switch (csWCaption[0]) { case L'l': - nStyle = PCS_CIRCLE; + nStyle = PCS_CIRCLE; break; case L'8': nStyle = PCS_CROSS; @@ -1458,7 +1458,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() break; } - CFX_ByteString csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) + + CFX_ByteString csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) + CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder); CFX_ByteString csAP_D_OFF = csAP_D_ON; @@ -1481,11 +1481,11 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() { CPDF_FormControl* pControl = GetFormControl(); ASSERT(pControl != NULL); - + CPWL_Color crBackground, crBorder, crText; - + int iColorType; FX_FLOAT fc[4]; @@ -1523,7 +1523,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() case BBS_UNDERLINE: nBorderStyle = PBS_UNDERLINED; break; - default: + default: nBorderStyle = PBS_SOLID; break; } @@ -1546,7 +1546,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() switch (csWCaption[0]) { default: //L'l': - nStyle = PCS_CIRCLE; + nStyle = PCS_CIRCLE; break; case L'8': nStyle = PCS_CROSS; @@ -1573,7 +1573,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() CFX_ByteString csAP_N_ON; CPDF_Rect rcCenter = CPWL_Utils::DeflateRect(CPWL_Utils::GetCenterSquare(rcWindow), 1.0f); - + if (nStyle == PCS_CIRCLE) { if (nBorderStyle == PBS_BEVELED) @@ -1587,12 +1587,12 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() crRightBottom = CPWL_Color(COLORTYPE_GRAY,0.75f); } - csAP_N_ON = CPWL_Utils::GetCircleFillAppStream(rcCenter,crBackground) + + csAP_N_ON = CPWL_Utils::GetCircleFillAppStream(rcCenter,crBackground) + CPWL_Utils::GetCircleBorderAppStream(rcCenter,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder); } else { - csAP_N_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,crBackground) + + csAP_N_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,crBackground) + CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder); } @@ -1635,8 +1635,8 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() } else { - csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) + - CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder); + csAP_D_ON = CPWL_Utils::GetRectFillAppStream(rcWindow,CPWL_Utils::SubstractColor(crBackground,0.25f)) + + CPWL_Utils::GetBorderAppStream(rcWindow,fBorderWidth,crBorder,crLeftTop,crRightBottom,nBorderStyle,dsBorder); } CFX_ByteString csAP_D_OFF = csAP_D_ON; @@ -1683,7 +1683,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) CPDF_Rect rcEdit = rcClient; rcEdit.right = rcButton.left; rcEdit.Normalize(); - + pEdit->SetPlateRect(rcEdit); pEdit->SetAlignmentV(1); @@ -1692,9 +1692,9 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) pEdit->SetAutoFontSize(TRUE); else pEdit->SetFontSize(fFontSize); - + pEdit->Initialize(); - + if (sValue) pEdit->SetText(sValue); else @@ -1716,11 +1716,11 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const FX_WCHAR* sValue) if (rcContent.Width() > rcEdit.Width() || rcContent.Height() > rcEdit.Height()) { - sBody << rcEdit.left << " " << rcEdit.bottom << " " + sBody << rcEdit.left << " " << rcEdit.bottom << " " << rcEdit.Width() << " " << rcEdit.Height() << " re\nW\nn\n"; } - CPWL_Color crText = GetTextPWLColor(); + CPWL_Color crText = GetTextPWLColor(); sBody << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n" << "Q\nEMC\n"; } @@ -1757,15 +1757,15 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() FontMap.Initial(); pEdit->SetFontMap(&FontMap); - pEdit->SetPlateRect(CPDF_Rect(rcClient.left,0.0f,rcClient.right,0.0f)); - + pEdit->SetPlateRect(CPDF_Rect(rcClient.left,0.0f,rcClient.right,0.0f)); + FX_FLOAT fFontSize = GetFontSize(); if (IsFloatZero(fFontSize)) pEdit->SetFontSize(12.0f); else pEdit->SetFontSize(fFontSize); - + pEdit->Initialize(); CFX_ByteTextBuf sList; @@ -1777,7 +1777,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() for (int32_t i=nTop; i<nCount; i++) { - FX_BOOL bSelected = FALSE; + FX_BOOL bSelected = FALSE; for (int32_t j=0; j<nSelCount; j++) { if (pField->GetSelectedIndex(j) == i) @@ -1798,22 +1798,22 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() sList << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,0,51.0f/255.0f,113.0f/255.0f),TRUE) << rcItem.left << " " << rcItem.bottom << " " << rcItem.Width() << " " << rcItem.Height() << " re f\n" << "Q\n"; - sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),TRUE) << + sList << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1),TRUE) << CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n"; } else { CPWL_Color crText = GetTextPWLColor(); - sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << + sList << "BT\n" << CPWL_Utils::GetColorAppStream(crText,TRUE) << CPWL_Utils::GetEditAppStream(pEdit,CPDF_Point(0.0f,fy)) << "ET\n"; } fy -= fItemHeight; } - + if (sList.GetSize() > 0) { - sBody << "/Tx BMC\n" << "q\n" << rcClient.left << " " << rcClient.bottom << " " + sBody << "/Tx BMC\n" << "q\n" << rcClient.left << " " << rcClient.bottom << " " << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n"; sBody << sList << "Q\nEMC\n"; } @@ -1834,7 +1834,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) ASSERT(pField != NULL); CFX_ByteTextBuf sBody, sLines; - + if (IFX_Edit * pEdit = IFX_Edit::NewEdit()) { pEdit->EnableRefresh(FALSE); @@ -1850,7 +1850,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) CPDF_Rect rcClient = GetClientRect(); pEdit->SetPlateRect(rcClient); pEdit->SetAlignmentH(pControl->GetControlAlignment()); - + FX_DWORD dwFieldFlags = pField->GetFieldFlags(); FX_BOOL bMultiLine = (dwFieldFlags >> 12) & 1; @@ -1873,7 +1873,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) int nMaxLen = pField->GetMaxLen(); FX_BOOL bCharArray = (dwFieldFlags >> 24) & 1; - FX_FLOAT fFontSize = GetFontSize(); + FX_FLOAT fFontSize = GetFontSize(); CFX_WideString sValueTmp; if (!sValue && (NULL != this->GetMixXFAWidget())) @@ -1896,7 +1896,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) else { if (sValue) - nMaxLen = wcslen((const wchar_t*)sValue); + nMaxLen = wcslen((const wchar_t*)sValue); pEdit->SetLimitChar(nMaxLen); } } @@ -1907,7 +1907,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) pEdit->SetFontSize(fFontSize); pEdit->Initialize(); - + if (sValue) pEdit->SetText(sValue); else @@ -1924,10 +1924,10 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) if (rcContent.Width() > rcClient.Width() || rcContent.Height() > rcClient.Height()) { - sBody << rcClient.left << " " << rcClient.bottom << " " + sBody << rcClient.left << " " << rcClient.bottom << " " << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n"; } - CPWL_Color crText = GetTextPWLColor(); + CPWL_Color crText = GetTextPWLColor(); sBody << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n" << "Q\nEMC\n"; } @@ -1940,18 +1940,18 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) CFX_ByteString sColor = CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE); if (sColor.GetLength() > 0) { - sLines << "q\n" << GetBorderWidth() << " w\n" - << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n"; + sLines << "q\n" << GetBorderWidth() << " w\n" + << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) << " 2 J 0 j\n"; for (int32_t i=1;i<nMaxLen;i++) { sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " << rcClient.bottom << " m\n" << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " - << rcClient.top << " l S\n"; + << rcClient.top << " l S\n"; } - sLines << "Q\n"; + sLines << "Q\n"; } } break; @@ -1962,18 +1962,18 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const FX_WCHAR* sValue) { CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0); - sLines << "q\n" << GetBorderWidth() << " w\n" + sLines << "q\n" << GetBorderWidth() << " w\n" << CPWL_Utils::GetColorAppStream(GetBorderPWLColor(),FALSE) - << "[" << dsBorder.nDash << " " - << dsBorder.nGap << "] " + << "[" << dsBorder.nDash << " " + << dsBorder.nGap << "] " << dsBorder.nPhase << " d\n"; - for (int32_t i=1;i<nMaxLen;i++) + for (int32_t i=1;i<nMaxLen;i++) { sLines << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " << rcClient.bottom << " m\n" << rcClient.left + ((rcClient.right - rcClient.left)/nMaxLen)*i << " " - << rcClient.top << " l S\n"; + << rcClient.top << " l S\n"; } sLines << "Q\n"; @@ -2020,7 +2020,7 @@ CPDF_Rect CPDFSDK_Widget::GetRotatedRect() const case 0: case 180: default: - rcPDFWindow = CPDF_Rect(0, 0, fWidth, fHeight); + rcPDFWindow = CPDF_Rect(0, 0, fWidth, fHeight); break; case 90: case 270: @@ -2072,12 +2072,12 @@ CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const case BBS_UNDERLINE: nBorderStyle = PBS_UNDERLINED; break; - default: + default: nBorderStyle = PBS_SOLID; break; } - return CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, + return CPWL_Utils::GetBorderAppStream(rcWindow, fBorderWidth, crBorder, crLeftTop, crRightBottom, nBorderStyle, dsBorder); } @@ -2090,7 +2090,7 @@ CPDF_Matrix CPDFSDK_Widget::GetMatrix() const CPDF_Rect rcAnnot = GetRect(); FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left; FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom; - + switch (abs(pControl->GetRotation() % 360)) @@ -2187,7 +2187,7 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St sImageAlias = pImageDict->GetString("Name"); if (sImageAlias.IsEmpty()) sImageAlias = "IMG"; - } + } CPDF_Dictionary* pStreamResList = pStreamDict->GetDict("Resources"); if (!pStreamResList) @@ -2196,9 +2196,9 @@ void CPDFSDK_Widget::AddImageToAppearance(const CFX_ByteString& sAPType, CPDF_St pStreamDict->SetAt("Resources", pStreamResList); } - if (pStreamResList) + if (pStreamResList) { - CPDF_Dictionary* pXObject = FX_NEW CPDF_Dictionary; + CPDF_Dictionary* pXObject = FX_NEW CPDF_Dictionary; pXObject->SetAtReference(sImageAlias, pDoc, pImage); pStreamResList->SetAt("XObject", pXObject); } @@ -2226,7 +2226,7 @@ FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAc if (IXFA_Widget* hWidget = this->GetMixXFAWidget()) { XFA_EVENTTYPE eEventType = GetXFAEventType(type, data.bWillCommit); - + if (eEventType != XFA_EVENT_Unknown) { if (IXFA_WidgetHandler* pXFAWidgetHandler = this->GetXFAWidgetHandler()) @@ -2269,7 +2269,7 @@ FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, PDFSDK_FieldAc { CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander();/*(CPDFSDK_ActionHandler*)pApp->GetActionHandler();*/ ASSERT(pActionHandler != NULL); - + return pActionHandler->DoAction_Field(action, type, pDocument, GetFormField(), data); } @@ -2337,11 +2337,11 @@ FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY) if(annotRect.Contains(pageX, pageY)) { if (!IsVisible()) return FALSE; - + int nFieldFlags = GetFieldFlags(); - if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) + if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) return FALSE; - + return TRUE; } return FALSE; @@ -2452,7 +2452,7 @@ CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL b CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const { if(!pControl || !m_pInterForm) return NULL; - + CPDFSDK_Widget* pWidget = NULL; m_Map.Lookup(pControl, pWidget); @@ -2475,7 +2475,7 @@ CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const } } - if (!pPage) + if (!pPage) { int nPageIndex = GetPageIndexByAnnotDict(pDocument, pControlDict); if (nPageIndex >= 0) @@ -2499,7 +2499,7 @@ void CPDFSDK_InterForm::GetWidgets(const CFX_WideString& sFieldName, CFX_PtrArra CPDF_FormField* pFormField = m_pInterForm->GetField(i, sFieldName); ASSERT(pFormField != NULL); - GetWidgets(pFormField, widgets); + GetWidgets(pFormField, widgets); } } @@ -2527,7 +2527,7 @@ int CPDFSDK_InterForm::GetPageIndexByAnnotDict(CPDF_Document* pDocument, CPDF_Di for (int i=0,sz=pDocument->GetPageCount(); i<sz; i++) { if (CPDF_Dictionary* pPageDict = pDocument->GetPage(i)) - { + { if (CPDF_Array* pAnnots = pPageDict->GetArray("Annots")) { for (int j=0,jsz=pAnnots->GetCount(); j<jsz; j++) @@ -2705,16 +2705,16 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) { IFXJS_Context* pContext = pRuntime->NewContext(); ASSERT(pContext != NULL); - + CFX_WideString sOldValue = pField->GetValue(); CFX_WideString sValue = sOldValue; FX_BOOL bRC = TRUE; pContext->OnField_Calculate(pFormField, pField, sValue, bRC); - + CFX_WideString sInfo; FX_BOOL bRet = pContext->RunScript(csJS, sInfo); pRuntime->ReleaseContext(pContext); - + if (bRet) { if (bRC) @@ -2730,7 +2730,7 @@ void CPDFSDK_InterForm::OnCalculate(CPDF_FormField* pFormField) } } - + } m_bBusy = FALSE; @@ -2748,11 +2748,11 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL& { bFormated = FALSE; return sValue; - } + } IFXJS_Runtime* pRuntime = m_pDocument->GetJsRuntime(); ASSERT(pRuntime != NULL); - + pRuntime->SetReaderDocument(m_pDocument); if (pFormField->GetFieldType() == FIELDTYPE_COMBOBOX) @@ -2768,11 +2768,11 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL& bFormated = FALSE; CPDF_AAction aAction = pFormField->GetAdditionalAction(); - if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Format)) + if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Format)) { CPDF_Action action = aAction.GetAction(CPDF_AAction::Format); if (action) - { + { CFX_WideString script = action.GetJavaScript(); if (!script.IsEmpty()) { @@ -2782,7 +2782,7 @@ CFX_WideString CPDFSDK_InterForm::OnFormat(CPDF_FormField* pFormField, FX_BOOL& ASSERT(pContext != NULL); pContext->OnField_Format(pFormField, Value, TRUE); - + CFX_WideString sInfo; FX_BOOL bRet = pContext->RunScript(script, sInfo); pRuntime->ReleaseContext(pContext); @@ -2827,7 +2827,7 @@ void CPDFSDK_InterForm::UpdateField(CPDF_FormField* pFormField) { CPDFDoc_Environment * pEnv = m_pDocument->GetEnv(); CFFL_IFormFiller* pIFormFiller = pEnv->GetIFormFiller(); - + CPDFXFA_Page * pPage = pWidget->GetPDFXFAPage(); CPDFSDK_PageView * pPageView = m_pDocument->GetPageView(pPage,FALSE); @@ -2843,24 +2843,24 @@ void CPDFSDK_InterForm::OnKeyStrokeCommit(CPDF_FormField* pFormField, CFX_WideSt ASSERT(pFormField != NULL); CPDF_AAction aAction = pFormField->GetAdditionalAction(); - if (aAction != NULL && aAction.ActionExist(CPDF_AAction::KeyStroke)) + if (aAction != NULL && aAction.ActionExist(CPDF_AAction::KeyStroke)) { CPDF_Action action = aAction.GetAction(CPDF_AAction::KeyStroke); if (action) - { + { ASSERT(m_pDocument != NULL); CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); ASSERT(pEnv != NULL); CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); ASSERT(pActionHandler != NULL); - + PDFSDK_FieldAction fa; fa.bModifier = pEnv->FFI_IsCTRLKeyDown(0); fa.bShift = pEnv->FFI_IsSHIFTKeyDown(0); fa.sValue = csValue; - pActionHandler->DoAction_FieldJavaScript(action, CPDF_AAction::KeyStroke, + pActionHandler->DoAction_FieldJavaScript(action, CPDF_AAction::KeyStroke, m_pDocument, pFormField, fa); bRC = fa.bRC; } @@ -2872,15 +2872,15 @@ void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& c ASSERT(pFormField != NULL); CPDF_AAction aAction = pFormField->GetAdditionalAction(); - if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Validate)) + if (aAction != NULL && aAction.ActionExist(CPDF_AAction::Validate)) { CPDF_Action action = aAction.GetAction(CPDF_AAction::Validate); if (action) - { + { ASSERT(m_pDocument != NULL); CPDFDoc_Environment* pEnv = m_pDocument->GetEnv(); ASSERT(pEnv != NULL); - + CPDFSDK_ActionHandler* pActionHandler = pEnv->GetActionHander(); ASSERT(pActionHandler != NULL); @@ -2891,7 +2891,7 @@ void CPDFSDK_InterForm::OnValidate(CPDF_FormField* pFormField, CFX_WideString& c pActionHandler->DoAction_FieldJavaScript(action, CPDF_AAction::Validate, m_pDocument, pFormField, fa); bRC = fa.bRC; - + } } } @@ -2912,13 +2912,13 @@ FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action) FX_BOOL bHide = action.GetHideStatus(); FX_BOOL bChanged = FALSE; - + for (int i=0, sz=fields.GetSize(); i<sz; i++) { CPDF_FormField* pField = (CPDF_FormField*)fields[i]; ASSERT(pField != NULL); - + for (int j=0,jsz=pField->CountControls(); j<jsz; j++) { CPDF_FormControl* pControl = pField->GetControl(j); @@ -2943,7 +2943,7 @@ FX_BOOL CPDFSDK_InterForm::DoAction_Hide(const CPDF_Action& action) CPDFSDK_PageView* pPageView = pWidget->GetPageView(); ASSERT(pPageView != NULL); - + pPageView->UpdateView(pWidget); bChanged = TRUE; @@ -2967,12 +2967,12 @@ FX_BOOL CPDFSDK_InterForm::DoAction_SubmitForm(const CPDF_Action& action) { CPDF_ActionFields af = action.GetWidgets(); FX_DWORD dwFlags = action.GetFlags(); - + CFX_PtrArray fieldObjects; af.GetAllFields(fieldObjects); CFX_PtrArray fields; GetFieldFromObjects(fieldObjects, fields); - + if (fields.GetSize() != 0) { FX_BOOL bIncludeOrExclude = !(dwFlags & 0x01); @@ -3014,7 +3014,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, con uint8_t* pBuffer = textBuf.GetBuffer(); FX_STRSIZE nBufSize = textBuf.GetLength(); - + if (bUrlEncoded) { if(!FDFToURLEncodedData(pBuffer, nBufSize)) @@ -3022,7 +3022,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitFields(const CFX_WideString& csDestination, con } pEnv->JS_docSubmitForm(pBuffer, nBufSize, csDestination.c_str()); - + return TRUE; } @@ -3031,18 +3031,18 @@ void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer) ASSERT(m_pDocument != NULL); if (CFDF_Document *pFDFDocument = CFDF_Document::ParseMemory((const unsigned char *)sBuffer.GetBuffer(sBuffer.GetLength()), sBuffer.GetLength())) - { + { CPDF_Dictionary* pRootDic = pFDFDocument->GetRoot(); if(pRootDic) { CPDF_Dictionary * pFDFDict=pRootDic->GetDict("FDF"); if(pFDFDict) - { + { CPDF_Dictionary * pJSDict = pFDFDict->GetDict("JavaScript"); if(pJSDict) { CFX_WideString csJS; - + CPDF_Object* pJS = pJSDict->GetElementValue("Before"); if (pJS != NULL) { @@ -3052,7 +3052,7 @@ void CPDFSDK_InterForm::DoFDFBuffer(CFX_ByteString sBuffer) else if (iType == PDFOBJ_STREAM) csJS = pJS->GetUnicodeText(); } - + } } } @@ -3074,14 +3074,14 @@ FX_BOOL CPDFSDK_InterForm::FDFToURLEncodedData(uint8_t*& pBuf, FX_STRSIZE& nBufS { CPDF_Dictionary* pMainDict = pFDF->GetRoot()->GetDict("FDF"); if (pMainDict == NULL) return FALSE; - + // Get fields CPDF_Array* pFields = pMainDict->GetArray("Fields"); if (pFields == NULL) return FALSE; - + CFX_ByteTextBuf fdfEncodedData; - for (FX_DWORD i = 0; i < pFields->GetCount(); i ++) + for (FX_DWORD i = 0; i < pFields->GetCount(); i ++) { CPDF_Dictionary* pField = pFields->GetDict(i); if (pField == NULL) continue; @@ -3112,12 +3112,12 @@ FX_BOOL CPDFSDK_InterForm::ExportFieldsToFDFTextBuf(const CFX_PtrArray& fields,F { ASSERT(m_pDocument != NULL); ASSERT(m_pInterForm != NULL); - + CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath(),(CFX_PtrArray&)fields, bIncludeOrExclude); if (!pFDF) return FALSE; FX_BOOL bRet = pFDF->WriteBuf(textBuf); // = FALSE;// delete pFDF; - + return bRet; } @@ -3157,7 +3157,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOO if(NULL == m_pDocument) return FALSE; CFX_WideString wsPDFFilePath = m_pDocument->GetPath(); - + if(NULL == m_pInterForm) return FALSE; CFDF_Document* pFDFDoc = m_pInterForm->ExportToFDF(wsPDFFilePath); if (NULL == pFDFDoc) return FALSE; @@ -3169,7 +3169,7 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOO uint8_t* pBuffer = FdfBuffer.GetBuffer(); FX_STRSIZE nBufSize = FdfBuffer.GetLength(); - + if (bUrlEncoded) { if(!FDFToURLEncodedData(pBuffer, nBufSize)) @@ -3177,11 +3177,11 @@ FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination, FX_BOO } pEnv->JS_docSubmitForm(pBuffer, nBufSize, sDestination.c_str()); - + if (bUrlEncoded && pBuffer) { FX_Free(pBuffer); - pBuffer = NULL; + pBuffer = NULL; } return TRUE; @@ -3192,13 +3192,13 @@ FX_BOOL CPDFSDK_InterForm::ExportFormToFDFTextBuf(CFX_ByteTextBuf& textBuf) ASSERT(m_pInterForm != NULL); ASSERT(m_pDocument != NULL); - + CFDF_Document* pFDF = m_pInterForm->ExportToFDF(m_pDocument->GetPath()); if (!pFDF) return FALSE; - + FX_BOOL bRet = pFDF->WriteBuf(textBuf); delete pFDF; - + return bRet; } @@ -3237,7 +3237,7 @@ void CPDFSDK_InterForm::GetFieldFromObjects(const CFX_PtrArray& objects, CFX_Ptr { CPDF_Object* pObject = (CPDF_Object*)objects[i]; if (pObject == NULL) continue; - + int iType = pObject->GetType(); if (iType == PDFOBJ_STRING) { @@ -3267,7 +3267,7 @@ int CPDFSDK_InterForm::BeforeValueChange(const CPDF_FormField* pField, CFX_WideS { FX_BOOL bRC = TRUE; OnKeyStrokeCommit(pFormField, csValue, bRC); - if (bRC) + if (bRC) { OnValidate(pFormField, csValue, bRC); if (bRC) @@ -3318,7 +3318,7 @@ int CPDFSDK_InterForm::BeforeSelectionChange(const CPDF_FormField* pField, CFX_W { FX_BOOL bRC = TRUE; OnKeyStrokeCommit(pFormField, csValue, bRC); - if (bRC) + if (bRC) { OnValidate(pFormField, csValue, bRC); if (bRC) @@ -3420,7 +3420,7 @@ void CPDFSDK_InterForm::SetHighlightColor(FX_COLORREF clr, int nFieldType) break; } } - + } FX_COLORREF CPDFSDK_InterForm::GetHighlightColor(int nFieldType) @@ -3473,7 +3473,7 @@ CPDFSDK_Annot* CBA_AnnotIterator::GetFirstAnnot() { if (m_Annots.GetSize() > 0) return m_Annots[0]; - + return NULL; } @@ -3561,7 +3561,7 @@ void CBA_AnnotIterator::GenerateResults() CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); ASSERT(pAnnot != NULL); - if (pAnnot->GetType() == m_sType + if (pAnnot->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType) m_Annots.Add(pAnnot); } @@ -3572,13 +3572,13 @@ void CBA_AnnotIterator::GenerateResults() CPDFSDK_SortAnnots sa; { - + for (int i=0,sz=m_pPageView->CountAnnots(); i<sz; i++) { CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); ASSERT(pAnnot != NULL); - if (pAnnot->GetType() == m_sType + if (pAnnot->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType) sa.Add(pAnnot); } @@ -3617,7 +3617,7 @@ void CBA_AnnotIterator::GenerateResults() ASSERT(pLeftTopAnnot != NULL); CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot); - + m_Annots.Add(pLeftTopAnnot); sa.RemoveAt(nLeftTopIndex); @@ -3668,7 +3668,7 @@ void CBA_AnnotIterator::GenerateResults() CPDFSDK_Annot* pAnnot = m_pPageView->GetAnnot(i); ASSERT(pAnnot != NULL); - if (pAnnot->GetType() == m_sType + if (pAnnot->GetType() == m_sType && pAnnot->GetSubType() == m_sSubType) sa.Add(pAnnot); } @@ -3712,7 +3712,7 @@ void CBA_AnnotIterator::GenerateResults() ASSERT(pLeftTopAnnot != NULL); CPDF_Rect rcLeftTop = GetAnnotRect(pLeftTopAnnot); - + m_Annots.Add(pLeftTopAnnot); sa.RemoveAt(nLeftTopIndex); diff --git a/fpdfsdk/src/fsdk_mgr.cpp b/fpdfsdk/src/fsdk_mgr.cpp index 46c0ff7e02..3eb3c9dd9b 100644 --- a/fpdfsdk/src/fsdk_mgr.cpp +++ b/fpdfsdk/src/fsdk_mgr.cpp @@ -493,9 +493,9 @@ FX_BOOL CPDFSDK_Document::SetFocusAnnot(CPDFSDK_Annot* pAnnot,FX_UINT nFlag) { if(m_pFocusAnnot==pAnnot) return TRUE; - + CPDFSDK_Annot* pLastFocusAnnot = m_pFocusAnnot; - + if(m_pFocusAnnot) { if(!KillFocusAnnot(nFlag) ) return FALSE; @@ -664,9 +664,9 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* p static_cast<FX_FLOAT>(pClip->Width()), static_cast<FX_FLOAT>(pClip->Height())); gs.SetClipRect(rectClip); - } + } IXFA_RenderContext* pRenderContext = XFA_RenderContext_Create(); - if (!pRenderContext) + if (!pRenderContext) return; CXFA_RenderOptions renderOptions; renderOptions.m_bHighlight = TRUE; @@ -754,7 +754,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, FX_FLOAT pag while(pSDKAnnot) { if(pSDKAnnot->GetType() == "Widget" || pSDKAnnot->GetType() == FSDK_XFAWIDGET_TYPENAME) - { + { pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot); CPDF_Point point(pageX, pageY); if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot, point)) @@ -811,7 +811,7 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(IXFA_Widget* pPDFAnnot) CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); ASSERT(pEnv); - CPDFSDK_AnnotHandlerMgr * pAnnotHandler= pEnv->GetAnnotHandlerMgr(); + CPDFSDK_AnnotHandlerMgr * pAnnotHandler= pEnv->GetAnnotHandlerMgr(); pSDKAnnot =NULL; @@ -819,10 +819,10 @@ CPDFSDK_Annot* CPDFSDK_PageView::AddAnnot(IXFA_Widget* pPDFAnnot) { pSDKAnnot = pAnnotHandler->NewAnnot(pPDFAnnot, this); } - if(!pSDKAnnot) + if(!pSDKAnnot) return NULL; - m_fxAnnotArray.Add(pSDKAnnot); + m_fxAnnotArray.Add(pSDKAnnot); return pSDKAnnot; } @@ -850,7 +850,7 @@ FX_BOOL CPDFSDK_PageView::DeleteAnnot(CPDFSDK_Annot* pAnnot) if (m_CaptureWidget == pAnnot) m_CaptureWidget = NULL; - return TRUE; + return TRUE; } CPDF_Document* CPDFSDK_PageView::GetPDFDocument() @@ -1128,7 +1128,7 @@ void CPDFSDK_PageView::LoadFXAnnots() continue; } m_fxAnnotArray.Add(pAnnot); - + pAnnotHandlerMgr->Annot_OnLoad(pAnnot); pXFAAnnot = pWidgetHander->MoveToNext(); @@ -1136,8 +1136,8 @@ void CPDFSDK_PageView::LoadFXAnnots() } pWidgetHander->Release(); - } - else + } + else { CPDF_Page* pPage = m_page->GetPDFPage(); ASSERT(pPage != NULL); diff --git a/fpdfsdk/src/fsdk_rendercontext.cpp b/fpdfsdk/src/fsdk_rendercontext.cpp index 89c6179254..70c4a17248 100644 --- a/fpdfsdk/src/fsdk_rendercontext.cpp +++ b/fpdfsdk/src/fsdk_rendercontext.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../include/fsdk_rendercontext.h" diff --git a/fpdfsdk/src/fxedit/fxet_ap.cpp b/fpdfsdk/src/fxedit/fxet_ap.cpp index 10a76a7157..309a98f41e 100644 --- a/fpdfsdk/src/fxedit/fxet_ap.cpp +++ b/fpdfsdk/src/fxedit/fxet_ap.cpp @@ -1,14 +1,14 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/fxedit/fxet_stub.h" #include "../../include/fxedit/fx_edit.h" #include "../../include/fxedit/fxet_edit.h" -CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord) +CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, int32_t nFontIndex, FX_WORD Word, FX_WORD SubWord) { ASSERT (pFontMap != NULL); @@ -18,7 +18,7 @@ CFX_ByteString GetPDFWordString(IFX_Edit_FontMap * pFontMap, int32_t nFontIndex, { if (SubWord > 0) { - Word = SubWord; + Word = SubWord; } else { @@ -65,7 +65,7 @@ static CFX_ByteString GetFontSetString(IFX_Edit_FontMap * pFontMap, int32_t nFon return sRet.GetByteString(); } -CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, +CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange /* = NULL*/, FX_BOOL bContinuous/* = TRUE*/, FX_WORD SubWord/* = 0*/) { CFX_ByteTextBuf sEditStream, sWords; @@ -88,7 +88,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Poi if (pRange && place.WordCmp(pRange->EndPos) > 0) break; - if (bContinuous) + if (bContinuous) { if (place.LineCmp(oldplace) != 0) { @@ -120,7 +120,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Poi CPVT_Word word; if (pIterator->GetWord(word)) - { + { if (word.nFontIndex != nCurFontIndex) { if (sWords.GetSize() > 0) @@ -148,7 +148,7 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Poi { sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y << " Td\n"; ptOld = ptNew; - } + } if (word.nFontIndex != nCurFontIndex) { @@ -184,12 +184,12 @@ CFX_ByteString IFX_Edit::GetEditAppearanceStream(IFX_Edit* pEdit, const CPDF_Poi } sAppStream << sEditStream; - } + } return sAppStream.GetByteString(); } -CFX_ByteString IFX_Edit::GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, +CFX_ByteString IFX_Edit::GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange /*= NULL*/) { CFX_ByteTextBuf sRet; @@ -199,22 +199,22 @@ CFX_ByteString IFX_Edit::GetSelectAppearanceStream(IFX_Edit* pEdit, const CPDF_P if (IFX_Edit_Iterator* pIterator = pEdit->GetIterator()) { pIterator->SetAt(pRange->BeginPos); - + while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); - if (pRange && place.WordCmp(pRange->EndPos) > 0) break; + if (pRange && place.WordCmp(pRange->EndPos) > 0) break; CPVT_Word word; CPVT_Line line; if (pIterator->GetWord(word) && pIterator->GetLine(line)) - { + { //CPDF_Rect rcWordSel = CPDF_Rect(word.ptWord.x,line.ptLine.y + line.fLineDescent, // word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent); sRet << word.ptWord.x + ptOffset.x << " " << line.ptLine.y + line.fLineDescent - << " " << word.fWidth << " " << line.fLineAscent - line.fLineDescent << " re\nf\n"; + << " " << word.fWidth << " " << line.fLineAscent - line.fLineDescent << " re\nf\n"; } } } diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp index 19c05d20ae..70d7b77553 100644 --- a/fpdfsdk/src/fxedit/fxet_edit.cpp +++ b/fpdfsdk/src/fxedit/fxet_edit.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/fxedit/fxet_stub.h" @@ -11,7 +11,7 @@ /* ---------------------------- CFX_Edit_Iterator ---------------------------- */ -CFX_Edit_Iterator::CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator) : +CFX_Edit_Iterator::CFX_Edit_Iterator(CFX_Edit * pEdit,IPDF_VariableText_Iterator * pVTIterator) : m_pEdit(pEdit), m_pVTIterator(pVTIterator) { @@ -24,7 +24,7 @@ CFX_Edit_Iterator::~CFX_Edit_Iterator() FX_BOOL CFX_Edit_Iterator::NextWord() { ASSERT(m_pVTIterator != NULL); - + return m_pVTIterator->NextWord(); } @@ -45,7 +45,7 @@ FX_BOOL CFX_Edit_Iterator::NextSection() FX_BOOL CFX_Edit_Iterator::PrevWord() { ASSERT(m_pVTIterator != NULL); - + return m_pVTIterator->PrevWord(); } @@ -83,7 +83,7 @@ FX_BOOL CFX_Edit_Iterator::GetLine(CPVT_Line & line) const ASSERT(m_pVTIterator != NULL); if (m_pVTIterator->GetLine(line)) - { + { line.ptLine = m_pEdit->VTToEdit(line.ptLine); return TRUE; } @@ -153,12 +153,12 @@ int32_t CFX_Edit_Provider::GetCharWidth(int32_t nFontIndex, FX_WORD word, int32_ { FX_DWORD charcode = word; - if (pPDFFont->IsUnicodeCompatible()) - charcode = pPDFFont->CharCodeFromUnicode(word); + if (pPDFFont->IsUnicodeCompatible()) + charcode = pPDFFont->CharCodeFromUnicode(word); else charcode = m_pFontMap->CharCodeFromUnicode(nFontIndex, word); - if (charcode != -1) + if (charcode != -1) return pPDFFont->GetCharWidthF(charcode); } @@ -272,14 +272,14 @@ void CFX_Edit_Refresh::Analyse(int32_t nAlignment) { rcResult = pOldRect->m_rcLine; rcResult.Union(pNewRect->m_rcLine); - m_RefreshRects.Add(rcResult); + m_RefreshRects.Add(rcResult); } else { - if (!pNewRect->IsSameLeft(*pOldRect)) + if (!pNewRect->IsSameLeft(*pOldRect)) { rcResult = pOldRect->m_rcLine; - rcResult.Union(pNewRect->m_rcLine); + rcResult.Union(pNewRect->m_rcLine); } else { @@ -374,9 +374,9 @@ void CFX_Edit_Undo::Undo() ASSERT(pItem != NULL); pItem->Undo(); - + m_nCurUndoPos--; - m_bModified = (m_nCurUndoPos != 0); + m_bModified = (m_nCurUndoPos != 0); } m_bWorking = FALSE; @@ -401,7 +401,7 @@ void CFX_Edit_Undo::Redo() pItem->Redo(); m_nCurUndoPos++; - m_bModified = (m_nCurUndoPos != 0); + m_bModified = (m_nCurUndoPos != 0); } m_bWorking = FALSE; @@ -417,17 +417,17 @@ void CFX_Edit_Undo::AddItem(IFX_Edit_UndoItem* pItem) ASSERT(!m_bWorking); ASSERT(pItem != NULL); ASSERT(m_nBufSize > 1); - + if (m_nCurUndoPos < m_UndoItemStack.GetSize()) RemoveTails(); if (m_UndoItemStack.GetSize() >= m_nBufSize) { - RemoveHeads(); + RemoveHeads(); m_bVirgin = FALSE; } - m_UndoItemStack.Add(pItem); + m_UndoItemStack.Add(pItem); m_nCurUndoPos = m_UndoItemStack.GetSize(); m_bModified = (m_nCurUndoPos != 0); @@ -549,7 +549,7 @@ CFX_WideString CFX_Edit_GroupUndoItem::GetUndoTitle() /* ------------------------------------- CFX_Edit_UndoItem derived classes ------------------------------------- */ CFXEU_InsertWord::CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, - FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps) + FX_WORD word, int32_t charset, const CPVT_WordProps * pWordProps) : m_pEdit(pEdit), m_wpOld(wpOldPlace), m_wpNew(wpNewPlace), m_Word(word), m_nCharset(charset), m_WordProps() { if (pWordProps) @@ -565,7 +565,7 @@ void CFXEU_InsertWord::Redo() if (m_pEdit) { m_pEdit->SelectNone(); - m_pEdit->SetCaret(m_wpOld); + m_pEdit->SetCaret(m_wpOld); m_pEdit->InsertWord(m_Word,m_nCharset,&m_WordProps,FALSE,TRUE); } } @@ -588,7 +588,7 @@ CFXEU_InsertReturn::CFXEU_InsertReturn(CFX_Edit * pEdit, const CPVT_WordPlace & m_wpOld(wpOldPlace), m_wpNew(wpNewPlace), m_SecProps(), - m_WordProps() + m_WordProps() { if (pSecProps) m_SecProps = *pSecProps; @@ -632,7 +632,7 @@ CFXEU_Backspace::CFXEU_Backspace(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldP m_Word(word), m_nCharset(charset), m_SecProps(SecProps), - m_WordProps(WordProps) + m_WordProps(WordProps) { } @@ -763,7 +763,7 @@ CFXEU_ClearRich::CFXEU_ClearRich(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldP m_Word(word), m_nCharset(charset), m_SecProps(SecProps), - m_WordProps(WordProps) + m_WordProps(WordProps) { } @@ -815,7 +815,7 @@ CFXEU_InsertText::CFXEU_InsertText(CFX_Edit * pEdit, const CPVT_WordPlace & wpOl m_swText(swText), m_nCharset(charset), m_SecProps(), - m_WordProps() + m_WordProps() { if (pSecProps) m_SecProps = *pSecProps; @@ -849,8 +849,8 @@ void CFXEU_InsertText::Undo() /* -------------------------------------------------------------------------- */ -CFXEU_SetSecProps::CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, - const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops, +CFXEU_SetSecProps::CFXEU_SetSecProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, + const CPVT_SecProps & oldsecprops, const CPVT_WordProps & oldwordprops, const CPVT_SecProps & newsecprops, const CPVT_WordProps & newwordprops, const CPVT_WordRange & range) : m_pEdit(pEdit), m_wpPlace(place), @@ -897,7 +897,7 @@ void CFXEU_SetSecProps::Undo() /* -------------------------------------------------------------------------- */ -CFXEU_SetWordProps::CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, +CFXEU_SetWordProps::CFXEU_SetWordProps(CFX_Edit * pEdit, const CPVT_WordPlace & place, EDIT_PROPS_E ep, const CPVT_WordProps & oldprops, const CPVT_WordProps & newprops, const CPVT_WordRange & range) : m_pEdit(pEdit), m_wpPlace(place), @@ -965,7 +965,7 @@ CFX_Edit::CFX_Edit(IPDF_VariableText * pVT) : m_bNotify(TRUE), m_bOprNotify(FALSE), m_pGroupUndoItem(NULL) -{ +{ ASSERT(pVT != NULL); } @@ -997,7 +997,7 @@ void CFX_Edit::Initialize() void CFX_Edit::SetFontMap(IFX_Edit_FontMap * pFontMap) { - if (m_pVTProvide) + if (m_pVTProvide) delete m_pVTProvide; m_pVT->SetProvider(m_pVTProvide = new CFX_Edit_Provider(pFontMap)); @@ -1040,9 +1040,9 @@ IFX_Edit_FontMap* CFX_Edit::GetFontMap() } void CFX_Edit::SetPlateRect(const CPDF_Rect & rect, FX_BOOL bPaint/* = TRUE*/) -{ +{ m_pVT->SetPlateRect(rect); - m_ptScrollPos = CPDF_Point(rect.left,rect.top); + m_ptScrollPos = CPDF_Point(rect.left,rect.top); if (bPaint) Paint(); } @@ -1139,11 +1139,11 @@ void CFX_Edit::SetSel(int32_t nStartChar,int32_t nEndChar) SelectAll(); } else if (nStartChar < 0) - { + { SelectNone(); } else - { + { if (nStartChar < nEndChar) { SetSel(m_pVT->WordIndexToWordPlace(nStartChar),m_pVT->WordIndexToWordPlace(nEndChar)); @@ -1152,7 +1152,7 @@ void CFX_Edit::SetSel(int32_t nStartChar,int32_t nEndChar) { SetSel(m_pVT->WordIndexToWordPlace(nEndChar),m_pVT->WordIndexToWordPlace(nStartChar)); } - } + } } } @@ -1174,7 +1174,7 @@ void CFX_Edit::SetSel(const CPVT_WordPlace & begin,const CPVT_WordPlace & end) SetCaretInfo(); } else - { + { ScrollToCaret(); SetCaretInfo(); } @@ -1234,7 +1234,7 @@ CFX_WideString CFX_Edit::GetText() const pIterator->SetAt(0); - CPVT_Word wordinfo; + CPVT_Word wordinfo; CPVT_WordPlace oldplace = pIterator->GetAt(); while (pIterator->NextWord()) { @@ -1249,7 +1249,7 @@ CFX_WideString CFX_Edit::GetText() const else { swRet += wordinfo.Word; - } + } } if (oldplace.SecCmp(place) != 0) @@ -1257,7 +1257,7 @@ CFX_WideString CFX_Edit::GetText() const swRet += 0x0D; swRet += 0x0A; } - + oldplace = place; } } @@ -1275,13 +1275,13 @@ CFX_WideString CFX_Edit::GetRangeText(const CPVT_WordRange & range) const FX_BOOL bRich = m_pVT->IsRichText(); if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator()) - { + { CPVT_WordRange wrTemp = range; m_pVT->UpdateWordPlace(wrTemp.BeginPos); m_pVT->UpdateWordPlace(wrTemp.EndPos); pIterator->SetAt(wrTemp.BeginPos); - CPVT_Word wordinfo; + CPVT_Word wordinfo; CPVT_WordPlace oldplace = wrTemp.BeginPos; while (pIterator->NextWord()) { @@ -1297,7 +1297,7 @@ CFX_WideString CFX_Edit::GetRangeText(const CPVT_WordRange & range) const else { swRet += wordinfo.Word; - } + } } if (oldplace.SecCmp(place) != 0) @@ -1305,7 +1305,7 @@ CFX_WideString CFX_Edit::GetRangeText(const CPVT_WordRange & range) const swRet += 0x0D; swRet += 0x0A; } - + oldplace = place; } } @@ -1383,28 +1383,28 @@ FX_BOOL CFX_Edit::SetRichFontIndex(int32_t nFontIndex) { CPVT_WordProps WordProps; WordProps.nFontIndex = nFontIndex; - return SetRichTextProps(EP_FONTINDEX,NULL,&WordProps); + return SetRichTextProps(EP_FONTINDEX,NULL,&WordProps); } FX_BOOL CFX_Edit::SetRichFontSize(FX_FLOAT fFontSize) -{ +{ CPVT_WordProps WordProps; WordProps.fFontSize = fFontSize; - return SetRichTextProps(EP_FONTSIZE,NULL,&WordProps); + return SetRichTextProps(EP_FONTSIZE,NULL,&WordProps); } FX_BOOL CFX_Edit::SetRichTextColor(FX_COLORREF dwColor) { CPVT_WordProps WordProps; WordProps.dwWordColor = dwColor; - return SetRichTextProps(EP_WORDCOLOR,NULL,&WordProps); + return SetRichTextProps(EP_WORDCOLOR,NULL,&WordProps); } FX_BOOL CFX_Edit::SetRichTextScript(int32_t nScriptType) { CPVT_WordProps WordProps; WordProps.nScriptType = nScriptType; - return SetRichTextProps(EP_SCRIPTTYPE,NULL,&WordProps); + return SetRichTextProps(EP_SCRIPTTYPE,NULL,&WordProps); } FX_BOOL CFX_Edit::SetRichTextBold(FX_BOOL bBold) @@ -1443,21 +1443,21 @@ FX_BOOL CFX_Edit::SetRichTextCharSpace(FX_FLOAT fCharSpace) { CPVT_WordProps WordProps; WordProps.fCharSpace = fCharSpace; - return SetRichTextProps(EP_CHARSPACE,NULL,&WordProps); + return SetRichTextProps(EP_CHARSPACE,NULL,&WordProps); } FX_BOOL CFX_Edit::SetRichTextHorzScale(int32_t nHorzScale /*= 100*/) { CPVT_WordProps WordProps; WordProps.nHorzScale = nHorzScale; - return SetRichTextProps(EP_HORZSCALE,NULL,&WordProps); + return SetRichTextProps(EP_HORZSCALE,NULL,&WordProps); } FX_BOOL CFX_Edit::SetRichTextLineLeading(FX_FLOAT fLineLeading) { CPVT_SecProps SecProps; SecProps.fLineLeading = fLineLeading; - return SetRichTextProps(EP_LINELEADING,&SecProps,NULL); + return SetRichTextProps(EP_LINELEADING,&SecProps,NULL); } FX_BOOL CFX_Edit::SetRichTextLineIndent(FX_FLOAT fLineIndent) @@ -1483,7 +1483,7 @@ FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pS if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator()) { CPVT_WordRange wrTemp = m_SelState.ConvertToWordRange(); - + m_pVT->UpdateWordPlace(wrTemp.BeginPos); m_pVT->UpdateWordPlace(wrTemp.EndPos); pIterator->SetAt(wrTemp.BeginPos); @@ -1498,7 +1498,7 @@ FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pS if (place.WordCmp(wrTemp.EndPos) > 0) break; bSet1 = SetSecProps(eProps,place,pSecProps,pWordProps,wrTemp,TRUE); bSet2 = SetWordProps(eProps,place,pWordProps,wrTemp,TRUE); - + if (!bSet) bSet = (bSet1 || bSet2); } @@ -1510,7 +1510,7 @@ FX_BOOL CFX_Edit::SetRichTextProps(EDIT_PROPS_E eProps, const CPVT_SecProps * pS PaintSetProps(eProps,wrTemp); } } - } + } return bSet; } @@ -1526,8 +1526,8 @@ void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr) ScrollToCaret(); Refresh(RP_ANALYSE); SetCaretOrigin(); - SetCaretInfo(); - break; + SetCaretInfo(); + break; case EP_WORDCOLOR: case EP_UNDERLINE: case EP_CROSSOUT: @@ -1535,7 +1535,7 @@ void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr) break; case EP_FONTINDEX: case EP_FONTSIZE: - case EP_SCRIPTTYPE: + case EP_SCRIPTTYPE: case EP_CHARSPACE: case EP_HORZSCALE: case EP_BOLD: @@ -1548,13 +1548,13 @@ void CFX_Edit::PaintSetProps(EDIT_PROPS_E eProps, const CPVT_WordRange & wr) Refresh(RP_ANALYSE,&wrRefresh); SetCaretOrigin(); - SetCaretInfo(); + SetCaretInfo(); break; - } + } } -FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, - const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, +FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, + const CPVT_SecProps * pSecProps, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo) { if (m_pVT->IsValid() && m_pVT->IsRichText()) @@ -1578,10 +1578,10 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, switch(eProps) { - case EP_LINELEADING: + case EP_LINELEADING: if (!FX_EDIT_IsFloatEqual(secinfo.SecProps.fLineLeading,pSecProps->fLineLeading)) { - secinfo.SecProps.fLineLeading = pSecProps->fLineLeading; + secinfo.SecProps.fLineLeading = pSecProps->fLineLeading; bSet = TRUE; } break; @@ -1616,7 +1616,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, switch(eProps) { - case EP_FONTINDEX: + case EP_FONTINDEX: if (secinfo.WordProps.nFontIndex != pWordProps->nFontIndex) { secinfo.WordProps.nFontIndex = pWordProps->nFontIndex; @@ -1637,21 +1637,21 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, bSet = TRUE; } break; - case EP_SCRIPTTYPE: + case EP_SCRIPTTYPE: if (secinfo.WordProps.nScriptType != pWordProps->nScriptType) { secinfo.WordProps.nScriptType = pWordProps->nScriptType; bSet = TRUE; } break; - case EP_CHARSPACE: + case EP_CHARSPACE: if (!FX_EDIT_IsFloatEqual(secinfo.WordProps.fCharSpace,pWordProps->fCharSpace)) { secinfo.WordProps.fCharSpace = pWordProps->fCharSpace; bSet = TRUE; } break; - case EP_HORZSCALE: + case EP_HORZSCALE: if (secinfo.WordProps.nHorzScale != pWordProps->nHorzScale) { secinfo.WordProps.nHorzScale = pWordProps->nHorzScale; @@ -1663,7 +1663,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, { if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) == 0) { - secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE; + secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_UNDERLINE; bSet = TRUE; } } @@ -1681,7 +1681,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, { if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0) { - secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT; + secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT; bSet = TRUE; } } @@ -1699,7 +1699,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, { if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0) { - secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD; + secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD; bSet = TRUE; } } @@ -1717,7 +1717,7 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, { if ((secinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0) { - secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC; + secinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC; bSet = TRUE; } } @@ -1753,11 +1753,11 @@ FX_BOOL CFX_Edit::SetSecProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, return bSet; } } - + return FALSE; } -FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, +FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place, const CPVT_WordProps * pWordProps, const CPVT_WordRange & wr, FX_BOOL bAddUndo) { if (m_pVT->IsValid() && m_pVT->IsRichText()) @@ -1779,7 +1779,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place switch(eProps) { - case EP_FONTINDEX: + case EP_FONTINDEX: if (wordinfo.WordProps.nFontIndex != pWordProps->nFontIndex) { if (IFX_Edit_FontMap* pFontMap = GetFontMap()) @@ -1847,7 +1847,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place { if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) == 0) { - wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT; + wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_CROSSOUT; bSet = TRUE; } } @@ -1865,7 +1865,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place { if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_BOLD) == 0) { - wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD; + wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_BOLD; bSet = TRUE; } } @@ -1883,7 +1883,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place { if ((wordinfo.WordProps.nWordStyle & PVTWORD_STYLE_ITALIC) == 0) { - wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC; + wordinfo.WordProps.nWordStyle |= PVTWORD_STYLE_ITALIC; bSet = TRUE; } } @@ -1900,7 +1900,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place break; } } - } + } if (bSet) { @@ -1912,7 +1912,7 @@ FX_BOOL CFX_Edit::SetWordProps(EDIT_PROPS_E eProps, const CPVT_WordPlace & place (this,place,eProps,OldWordinfo.WordProps,wordinfo.WordProps,wr)); } } - + pIterator->SetAt(oldplace); return bSet; } @@ -2089,9 +2089,9 @@ void CFX_Edit::SelectAll() { if (m_pVT->IsValid()) { - m_SelState = GetWholeWordRange(); - SetCaret(m_SelState.EndPos); - + m_SelState = GetWholeWordRange(); + SetCaret(m_SelState.EndPos); + ScrollToCaret(); CPVT_WordRange wrVisible = GetVisibleWordRange(); Refresh(RP_OPTIONAL,&wrVisible); @@ -2109,7 +2109,7 @@ void CFX_Edit::SelectNone() m_SelState.Default(); Refresh(RP_OPTIONAL,&wrTemp); } - } + } } FX_BOOL CFX_Edit::IsSelected() const @@ -2136,7 +2136,7 @@ CPDF_Point CFX_Edit::VTToEdit(const CPDF_Point & point) const fPadding = rcPlate.Height() - rcContent.Height(); break; } - + return CPDF_Point(point.x - (m_ptScrollPos.x - rcPlate.left), point.y - (m_ptScrollPos.y + fPadding - rcPlate.top)); } @@ -2191,10 +2191,10 @@ void CFX_Edit::SetScrollInfo() if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; - m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right, + m_pNotify->IOnSetScrollInfoX(rcPlate.left, rcPlate.right, rcContent.left, rcContent.right, rcPlate.Width() / 3, rcPlate.Width()); - - m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top, + + m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top, rcContent.bottom, rcContent.top, rcPlate.Height() / 3, rcPlate.Height()); m_bNotifyFlag = FALSE; } @@ -2209,7 +2209,7 @@ void CFX_Edit::SetScrollPosX(FX_FLOAT fx) { if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.x,fx)) { - m_ptScrollPos.x = fx; + m_ptScrollPos.x = fx; Refresh(RP_NOANALYSE); if (m_bNotify && m_pNotify) @@ -2232,7 +2232,7 @@ void CFX_Edit::SetScrollPosY(FX_FLOAT fy) if (m_pVT->IsValid()) { if (!FX_EDIT_IsFloatEqual(m_ptScrollPos.y,fy)) - { + { m_ptScrollPos.y = fy; Refresh(RP_NOANALYSE); @@ -2277,7 +2277,7 @@ void CFX_Edit::SetScrollLimit() { if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.x, rcContent.left)) { - SetScrollPosX(rcContent.left); + SetScrollPosX(rcContent.left); } else if (FX_EDIT_IsFloatBigger(m_ptScrollPos.x, rcContent.right - rcPlate.Width())) { @@ -2289,7 +2289,7 @@ void CFX_Edit::SetScrollLimit() { SetScrollPosY(rcPlate.top); } - else + else { if (FX_EDIT_IsFloatSmaller(m_ptScrollPos.y, rcContent.bottom + rcPlate.Height())) { @@ -2326,7 +2326,7 @@ void CFX_Edit::ScrollToCaret() ptFoot.y = word.ptWord.y + word.fDescent; } else if (pIterator->GetLine(line)) - { + { ptHead.x = line.ptLine.x; ptHead.y = line.ptLine.y + line.fLineAscent; ptFoot.x = line.ptLine.x; @@ -2380,7 +2380,7 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const m_Refresh.BeginRefresh(); RefreshPushLineRects(GetVisibleWordRange()); -// if (!FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.x,m_ptScrollPos.x) || +// if (!FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.x,m_ptScrollPos.x) || // !FX_EDIT_IsFloatEqual(m_ptRefreshScrollPos.y,m_ptScrollPos.y)) // { m_Refresh.NoAnalyse(); @@ -2392,7 +2392,7 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const // { // case RP_ANALYSE: // m_Refresh.Analyse(m_pVT->GetAlignment()); -// +// // if (pRange1) RefreshPushRandomRects(*pRange1); // if (pRange2) RefreshPushRandomRects(*pRange2); // break; @@ -2402,9 +2402,9 @@ void CFX_Edit::Refresh(REFRESH_PLAN_E ePlan,const CPVT_WordRange * pRange1,const // case RP_OPTIONAL: // if (pRange1) RefreshPushRandomRects(*pRange1); // if (pRange2) RefreshPushRandomRects(*pRange2); -// break; +// break; // } -// } +// } if (m_bNotify && m_pNotify) { @@ -2436,7 +2436,7 @@ void CFX_Edit::RefreshPushLineRects(const CPVT_WordRange & wr) m_pVT->UpdateWordPlace(wpEnd); pIterator->SetAt(wpBegin); - CPVT_Line lineinfo; + CPVT_Line lineinfo; do { if (!pIterator->GetLine(lineinfo))break; @@ -2466,15 +2466,15 @@ void CFX_Edit::RefreshPushRandomRects(const CPVT_WordRange & wr) m_pVT->UpdateWordPlace(wrTemp.EndPos); pIterator->SetAt(wrTemp.BeginPos); - CPVT_Word wordinfo; - CPVT_Line lineinfo; + CPVT_Word wordinfo; + CPVT_Line lineinfo; CPVT_WordPlace place; while (pIterator->NextWord()) { place = pIterator->GetAt(); if (place.WordCmp(wrTemp.EndPos) > 0) break; - + pIterator->GetWord(wordinfo); pIterator->GetLine(lineinfo); @@ -2488,7 +2488,7 @@ void CFX_Edit::RefreshPushRandomRects(const CPVT_WordRange & wr) m_Refresh.AddRefresh(VTToEdit(rcWord)); } else - { + { CPDF_Rect rcLine(lineinfo.ptLine.x, lineinfo.ptLine.y + lineinfo.fLineDescent, lineinfo.ptLine.x + lineinfo.fLineWidth, @@ -2513,15 +2513,15 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) m_pVT->UpdateWordPlace(wrTemp.EndPos); pIterator->SetAt(wrTemp.BeginPos); - CPVT_Word wordinfo; - CPVT_Line lineinfo; + CPVT_Word wordinfo; + CPVT_Line lineinfo; CPVT_WordPlace place; while (pIterator->NextWord()) { place = pIterator->GetAt(); if (place.WordCmp(wrTemp.EndPos) > 0) break; - + pIterator->GetWord(wordinfo); pIterator->GetLine(lineinfo); @@ -2544,7 +2544,7 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) } } else - { + { CPDF_Rect rcLine(lineinfo.ptLine.x, lineinfo.ptLine.y + lineinfo.fLineDescent, lineinfo.ptLine.x + lineinfo.fLineWidth, @@ -2569,8 +2569,8 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) void CFX_Edit::SetCaret(const CPVT_WordPlace & place) { - m_wpOldCaret = m_wpCaret; - m_wpCaret = place; + m_wpOldCaret = m_wpCaret; + m_wpCaret = place; } void CFX_Edit::SetCaretInfo() @@ -2594,13 +2594,13 @@ void CFX_Edit::SetCaretInfo() ptFoot.y = word.ptWord.y + word.fDescent; } else if (pIterator->GetLine(line)) - { + { ptHead.x = line.ptLine.x; ptHead.y = line.ptLine.y + line.fLineAscent; ptFoot.x = line.ptLine.x; ptFoot.y = line.ptLine.y + line.fLineDescent; } - } + } m_bNotifyFlag = TRUE; m_pNotify->IOnSetCaret(!m_SelState.IsExist(),VTToEdit(ptHead),VTToEdit(ptFoot), m_wpCaret); @@ -2631,27 +2631,27 @@ void CFX_Edit::SetCaretChange() SecProps = section.SecProps; WordProps = section.WordProps; } - + if (pIterator->GetWord(word)) - { - WordProps = word.WordProps; + { + WordProps = word.WordProps; } - } - + } + if (!m_bNotifyFlag) { m_bNotifyFlag = TRUE; m_pNotify->IOnCaretChange(SecProps,WordProps); m_bNotifyFlag = FALSE; } - } + } } void CFX_Edit::SetCaret(int32_t nPos) { if (m_pVT->IsValid()) { - SelectNone(); + SelectNone(); SetCaret(m_pVT->WordIndexToWordPlace(nPos)); m_SelState.Set(m_wpCaret,m_wpCaret); @@ -2665,7 +2665,7 @@ void CFX_Edit::OnMouseDown(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl { if (m_pVT->IsValid()) { - SelectNone(); + SelectNone(); SetCaret(m_pVT->SearchWordPlace(EditToVT(point))); m_SelState.Set(m_wpCaret,m_wpCaret); @@ -2683,7 +2683,7 @@ void CFX_Edit::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl if (m_wpCaret != m_wpOldCaret) { - m_SelState.SetEndPos(m_wpCaret); + m_SelState.SetEndPos(m_wpCaret); ScrollToCaret(); CPVT_WordRange wr(m_wpOldCaret,m_wpCaret); @@ -2695,7 +2695,7 @@ void CFX_Edit::OnMouseMove(const CPDF_Point & point,FX_BOOL bShift,FX_BOOL bCtrl } void CFX_Edit::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) -{ +{ if (m_pVT->IsValid()) { SetCaret(m_pVT->GetUpWordPlace(m_wpCaret,m_ptCaret)); @@ -2717,9 +2717,9 @@ void CFX_Edit::OnVK_UP(FX_BOOL bShift,FX_BOOL bCtrl) } else { - SelectNone(); - - ScrollToCaret(); + SelectNone(); + + ScrollToCaret(); SetCaretInfo(); } } @@ -2750,7 +2750,7 @@ void CFX_Edit::OnVK_DOWN(FX_BOOL bShift,FX_BOOL bCtrl) { SelectNone(); - ScrollToCaret(); + ScrollToCaret(); SetCaretInfo(); } } @@ -2764,12 +2764,12 @@ void CFX_Edit::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) { if (m_wpCaret == m_pVT->GetLineBeginPlace(m_wpCaret) && m_wpCaret != m_pVT->GetSectionBeginPlace(m_wpCaret)) - SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret)); + SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret)); SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret)); if (m_SelState.IsExist()) - m_SelState.SetEndPos(m_wpCaret); + m_SelState.SetEndPos(m_wpCaret); else m_SelState.Set(m_wpOldCaret, m_wpCaret); @@ -2798,7 +2798,7 @@ void CFX_Edit::OnVK_LEFT(FX_BOOL bShift,FX_BOOL bCtrl) { if (m_wpCaret == m_pVT->GetLineBeginPlace(m_wpCaret) && m_wpCaret != m_pVT->GetSectionBeginPlace(m_wpCaret)) - SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret)); + SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret)); SetCaret(m_pVT->GetPrevWordPlace(m_wpCaret)); @@ -2823,12 +2823,12 @@ void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) SetCaret(m_pVT->GetNextWordPlace(m_wpCaret)); if (m_SelState.IsExist()) - m_SelState.SetEndPos(m_wpCaret); + m_SelState.SetEndPos(m_wpCaret); else - m_SelState.Set(m_wpOldCaret,m_wpCaret); + m_SelState.Set(m_wpOldCaret,m_wpCaret); if (m_wpOldCaret != m_wpCaret) - { + { ScrollToCaret(); CPVT_WordRange wr(m_wpOldCaret,m_wpCaret); Refresh(RP_OPTIONAL,&wr); @@ -2854,7 +2854,7 @@ void CFX_Edit::OnVK_RIGHT(FX_BOOL bShift,FX_BOOL bCtrl) if (m_wpCaret == m_pVT->GetLineEndPlace(m_wpCaret) && m_wpCaret != m_pVT->GetSectionEndPlace(m_wpCaret)) - SetCaret(m_pVT->GetNextWordPlace(m_wpCaret)); + SetCaret(m_pVT->GetNextWordPlace(m_wpCaret)); ScrollToCaret(); SetCaretOrigin(); @@ -2876,7 +2876,7 @@ void CFX_Edit::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) SetCaret(m_pVT->GetLineBeginPlace(m_wpCaret)); if (m_SelState.IsExist()) - m_SelState.SetEndPos(m_wpCaret); + m_SelState.SetEndPos(m_wpCaret); else m_SelState.Set(m_wpOldCaret,m_wpCaret); @@ -2903,8 +2903,8 @@ void CFX_Edit::OnVK_HOME(FX_BOOL bShift,FX_BOOL bCtrl) if (bCtrl) SetCaret(m_pVT->GetBeginWordPlace()); else - SetCaret(m_pVT->GetLineBeginPlace(m_wpCaret)); - + SetCaret(m_pVT->GetLineBeginPlace(m_wpCaret)); + ScrollToCaret(); SetCaretOrigin(); SetCaretInfo(); @@ -2953,8 +2953,8 @@ void CFX_Edit::OnVK_END(FX_BOOL bShift,FX_BOOL bCtrl) SetCaret(m_pVT->GetEndWordPlace()); else SetCaret(m_pVT->GetLineEndPlace(m_wpCaret)); - - ScrollToCaret(); + + ScrollToCaret(); SetCaretOrigin(); SetCaretInfo(); } @@ -3000,11 +3000,11 @@ FX_BOOL CFX_Edit::InsertWord(FX_WORD word, int32_t charset, const CPVT_WordProps return TRUE; } } - + return FALSE; } -FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, +FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordProps * pWordProps, FX_BOOL bAddUndo, FX_BOOL bPaint) { if (IsTextOverflow()) return FALSE; @@ -3027,9 +3027,9 @@ FX_BOOL CFX_Edit::InsertReturn(const CPVT_SecProps * pSecProps,const CPVT_WordPr RearrangePart(CPVT_WordRange(m_wpOldCaret, m_wpCaret)); ScrollToCaret(); CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos); - Refresh(RP_ANALYSE, &wr); + Refresh(RP_ANALYSE, &wr); SetCaretOrigin(); - SetCaretInfo(); + SetCaretInfo(); } if (m_bOprNotify && m_pOprNotify) @@ -3054,7 +3054,7 @@ FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint) if (bAddUndo) { if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator()) - { + { pIterator->SetAt(m_wpCaret); pIterator->GetSection(section); pIterator->GetWord(word); @@ -3069,7 +3069,7 @@ FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint) { if (bAddUndo && m_bEnableUndo) { - if (m_wpCaret.SecCmp(m_wpOldCaret) != 0) + if (m_wpCaret.SecCmp(m_wpOldCaret) != 0) AddEditUndoItem(new CFXEU_Backspace(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset, section.SecProps,section.WordProps)); else @@ -3084,7 +3084,7 @@ FX_BOOL CFX_Edit::Backspace(FX_BOOL bAddUndo, FX_BOOL bPaint) CPVT_WordRange wr; if (m_wpCaret.SecCmp(m_wpOldCaret) !=0) - wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret),GetVisibleWordRange().EndPos); + wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpCaret),GetVisibleWordRange().EndPos); else if (m_wpCaret.LineCmp(m_wpOldCaret) !=0) wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret)); else @@ -3118,7 +3118,7 @@ FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint) if (bAddUndo) { if (IPDF_VariableText_Iterator * pIterator = m_pVT->GetIterator()) - { + { pIterator->SetAt(m_pVT->GetNextWordPlace(m_wpCaret)); pIterator->GetSection(section); pIterator->GetWord(word); @@ -3133,14 +3133,14 @@ FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint) if (bAddUndo && m_bEnableUndo) { - if (bSecEnd) + if (bSecEnd) AddEditUndoItem(new CFXEU_Delete(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset, section.SecProps,section.WordProps,bSecEnd)); else AddEditUndoItem(new CFXEU_Delete(this,m_wpOldCaret,m_wpCaret,word.Word,word.nCharset, section.SecProps,word.WordProps,bSecEnd)); } - + if (bPaint) { RearrangePart(CPVT_WordRange(m_wpOldCaret,m_wpCaret)); @@ -3152,10 +3152,10 @@ FX_BOOL CFX_Edit::Delete(FX_BOOL bAddUndo, FX_BOOL bPaint) else if (m_wpCaret.LineCmp(m_wpOldCaret) !=0) wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(m_wpCaret),m_pVT->GetSectionEndPlace(m_wpCaret)); else - wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret),m_pVT->GetSectionEndPlace(m_wpCaret)); + wr = CPVT_WordRange(m_pVT->GetPrevWordPlace(m_wpOldCaret),m_pVT->GetSectionEndPlace(m_wpCaret)); Refresh(RP_ANALYSE, &wr); - + SetCaretOrigin(); SetCaretInfo(); } @@ -3200,14 +3200,14 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) { pIterator->SetAt(range.EndPos); - CPVT_Word wordinfo; - CPVT_Section secinfo; + CPVT_Word wordinfo; + CPVT_Section secinfo; do - { + { CPVT_WordPlace place = pIterator->GetAt(); if (place.WordCmp(range.BeginPos) <= 0)break; - CPVT_WordPlace oldplace = m_pVT->GetPrevWordPlace(place); + CPVT_WordPlace oldplace = m_pVT->GetPrevWordPlace(place); if (oldplace.SecCmp(place) != 0) { @@ -3220,7 +3220,7 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) else { if (pIterator->GetWord(wordinfo)) - { + { oldplace = m_pVT->AjustLineHeader(oldplace,TRUE); place = m_pVT->AjustLineHeader(place,TRUE); @@ -3233,23 +3233,23 @@ FX_BOOL CFX_Edit::Clear(FX_BOOL bAddUndo, FX_BOOL bPaint) EndGroupUndo(); } else - { - AddEditUndoItem(new CFXEU_Clear(this,range,GetSelText())); + { + AddEditUndoItem(new CFXEU_Clear(this,range,GetSelText())); } } - SelectNone(); - SetCaret(m_pVT->DeleteWords(range)); + SelectNone(); + SetCaret(m_pVT->DeleteWords(range)); m_SelState.Set(m_wpCaret,m_wpCaret); if (bPaint) { - RearrangePart(range); + RearrangePart(range); ScrollToCaret(); CPVT_WordRange wr(m_wpOldCaret, GetVisibleWordRange().EndPos); Refresh(RP_ANALYSE, &wr); - + SetCaretOrigin(); SetCaretInfo(); } @@ -3297,12 +3297,12 @@ void CFX_Edit::PaintInsertText(const CPVT_WordPlace & wpOld, const CPVT_WordPlac { RearrangePart(CPVT_WordRange(wpOld,wpNew)); ScrollToCaret(); - + CPVT_WordRange wr; if (m_wpCaret.LineCmp(wpOld) !=0) - wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(wpOld),m_pVT->GetSectionEndPlace(wpNew)); + wr = CPVT_WordRange(m_pVT->GetLineBeginPlace(wpOld),m_pVT->GetSectionEndPlace(wpNew)); else - wr = CPVT_WordRange(wpOld,m_pVT->GetSectionEndPlace(wpNew)); + wr = CPVT_WordRange(wpOld,m_pVT->GetSectionEndPlace(wpNew)); Refresh(RP_ANALYSE, &wr); SetCaretOrigin(); SetCaretInfo(); @@ -3352,12 +3352,12 @@ void CFX_Edit::SetCaretOrigin() m_ptCaret.y = word.ptWord.y; } else if (pIterator->GetLine(line)) - { + { m_ptCaret.x = line.ptLine.x; m_ptCaret.y = line.ptLine.y; } - } - } + } + } } int32_t CFX_Edit::WordPlaceToWordIndex(const CPVT_WordPlace & place) const @@ -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, const FX_WCHAR* 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; @@ -3529,7 +3529,7 @@ CPVT_WordPlace CFX_Edit::DoInsertText(const CPVT_WordPlace& place, const FX_WCHA if (sText[i+1] == 0x0A) i++; break; - case 0x0A: + case 0x0A: wp = m_pVT->InsertSection(wp,pSecProps,pWordProps); if (sText[i+1] == 0x0D) i++; diff --git a/fpdfsdk/src/fxedit/fxet_module.cpp b/fpdfsdk/src/fxedit/fxet_module.cpp index 9ca7f2eb32..d1421641bc 100644 --- a/fpdfsdk/src/fxedit/fxet_module.cpp +++ b/fpdfsdk/src/fxedit/fxet_module.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/fxedit/fxet_stub.h" diff --git a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp index 6b597cabb9..1c0269b682 100644 --- a/fpdfsdk/src/fxedit/fxet_pageobjs.cpp +++ b/fpdfsdk/src/fxedit/fxet_pageobjs.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/fxedit/fxet_stub.h" @@ -108,7 +108,7 @@ void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devic CPVT_WordPlace place = pIterator->GetAt(); if (pRange && place.WordCmp(pRange->EndPos) > 0) break; - CPVT_Word word; + CPVT_Word word; if (pIterator->GetWord(word)) { CFX_PathData pathUnderline; @@ -121,17 +121,17 @@ void IFX_Edit::DrawUnderline(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devic pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, color, 0, FXFILL_WINDING); } - } + } } } - + pDevice->RestoreState(); } -void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke, +void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke, const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHandler, void* pFFLData) { - + FX_BOOL bContinuous = pEdit->GetCharArray() == 0; if (pEdit->GetCharSpace() > 0.0f) bContinuous = FALSE; @@ -175,7 +175,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF else pIterator->SetAt(0); - CPVT_WordPlace oldplace; + CPVT_WordPlace oldplace; while (pIterator->NextWord()) { @@ -186,26 +186,26 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF { bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && place.WordCmp(wrSelect.EndPos) <= 0; if (bSelect) - { - crCurFill = crWhite; + { + crCurFill = crWhite; } else { crCurFill = crTextFill; } } - if(pSystemHandler && pSystemHandler->IsSelectionImplemented()) + if(pSystemHandler && pSystemHandler->IsSelectionImplemented()) { crCurFill = crTextFill; crOldFill = crCurFill; } - CPVT_Word word; + CPVT_Word word; if (pIterator->GetWord(word)) { if (bSelect) { - + CPVT_Line line; pIterator->GetLine(line); @@ -219,22 +219,22 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF pSystemHandler->OutputSelectedRect(pFFLData,rc); } else - { + { CFX_PathData pathSelBK; pathSelBK.AppendRect(word.ptWord.x,line.ptLine.y + line.fLineDescent, word.ptWord.x+word.fWidth,line.ptLine.y + line.fLineAscent); - - pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING); + + pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING); } } if (bContinuous) { - if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex || + if (place.LineCmp(oldplace) != 0 || word.nFontIndex != nFontIndex || crOldFill != crCurFill) { if (sTextBuf.GetLength() > 0) - { + { DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale); @@ -245,7 +245,7 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF crOldFill = crCurFill; } - sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord); + sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, SubWord); } else { @@ -260,17 +260,17 @@ void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF } if (sTextBuf.GetLength() > 0) - { + { DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(nFontIndex), fFontSize, pUser2Device, sTextBuf.GetByteString(), crOldFill, crTextStroke, nHorzScale); - } + } } } - + pDevice->RestoreState(); } -void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, +void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange) { //FX_FLOAT fFontSize = pEdit->GetFontSize(); @@ -309,14 +309,14 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device else pIterator->SetAt(0); - CPVT_WordPlace oldplace; + CPVT_WordPlace oldplace; while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); if (pRange && place.WordCmp(pRange->EndPos) > 0) break; - - CPVT_Word word; + + CPVT_Word word; if (pIterator->GetWord(word)) { word.WordProps.fFontSize = word.fFontSize; @@ -327,7 +327,7 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device { bSelect = place.WordCmp(wrSelect.BeginPos) > 0 && place.WordCmp(wrSelect.EndPos) <= 0; if (bSelect) - { + { crCurText = crWhite; } } @@ -343,15 +343,15 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device word.ptWord.x+word.fWidth + ptOffset.x, line.ptLine.y + line.fLineAscent + ptOffset.y); - pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING); + pDevice->DrawPath(&pathSelBK, pUser2Device, NULL, crSelBK, 0, FXFILL_WINDING); } - if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 || - FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 || + if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 || + FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 || crOld != crCurText) { if (sTextBuf.GetLength() > 0) - { + { DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, pUser2Device, sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale); @@ -362,15 +362,15 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device crOld = crCurText; } - sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0); - + sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0); + if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) { CFX_PathData pathUnderline; CPDF_Rect rcUnderline = GetUnderLineRect(word); pathUnderline.AppendRect(rcUnderline.left, rcUnderline.bottom, rcUnderline.right, rcUnderline.top); - pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, crCurText, 0, FXFILL_WINDING); + pDevice->DrawPath(&pathUnderline, pUser2Device, NULL, crCurText, 0, FXFILL_WINDING); } if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) @@ -382,18 +382,18 @@ void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device pDevice->DrawPath(&pathCrossout, pUser2Device, NULL, crCurText, 0, FXFILL_WINDING); } - oldplace = place; + oldplace = place; } } if (sTextBuf.GetLength() > 0) - { + { DrawTextString(pDevice, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, pUser2Device, sTextBuf.GetByteString(), crOld, 0, wp.nHorzScale); } } } - + pDevice->RestoreState(); } @@ -401,8 +401,8 @@ static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill { CPDF_PathObject* pPathObj = new CPDF_PathObject; CPDF_PathData* pPathData = pPathObj->m_Path.GetModify(); - pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top); - + pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top); + FX_FLOAT rgb[3]; rgb[0] = FXARGB_R(crFill) / 255.0f ; rgb[1] = FXARGB_G(crFill) / 255.0f; @@ -415,12 +415,12 @@ static void AddRectToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crFill pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj); } -static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crText, - CPDF_Font* pFont, FX_FLOAT fFontSize, FX_FLOAT fCharSpace, int32_t nHorzScale, +static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_COLORREF crText, + CPDF_Font* pFont, FX_FLOAT fFontSize, FX_FLOAT fCharSpace, int32_t nHorzScale, const CPDF_Point& point, const CFX_ByteString& text) { CPDF_TextObject* pTxtObj = new CPDF_TextObject; - + CPDF_TextStateData* pTextStateData = pTxtObj->m_TextState.GetModify(); pTextStateData->m_pFont = pFont; pTextStateData->m_FontSize = fFontSize; @@ -440,7 +440,7 @@ static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_ pTxtObj->m_ColorState.SetStrokeColor(CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB),rgb, 3); pTxtObj->SetPosition(point.x,point.y); - pTxtObj->SetText(text); + pTxtObj->SetText(text); pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pTxtObj); @@ -468,14 +468,14 @@ void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEd else pIterator->SetAt(0); - CPVT_WordPlace oldplace; + CPVT_WordPlace oldplace; while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); if (pRange && place.WordCmp(pRange->EndPos) > 0) break; - - CPVT_Word word; + + CPVT_Word word; if (pIterator->GetWord(word)) { if (place.LineCmp(oldplace) != 0 || nOldFontIndex != word.nFontIndex) @@ -493,12 +493,12 @@ void IFX_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* pEd } sTextBuf << GetPDFWordString(pFontMap, word.nFontIndex, word.Word, 0); - oldplace = place; + oldplace = place; } } if (sTextBuf.GetLength() > 0) - { + { ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crText, pFontMap->GetPDFFont(nOldFontIndex), fFontSize, 0.0f, 100, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString())); } @@ -530,22 +530,22 @@ void IFX_Edit::GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* else pIterator->SetAt(0); - CPVT_WordPlace oldplace; + CPVT_WordPlace oldplace; while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); if (pRange && place.WordCmp(pRange->EndPos) > 0) break; - - CPVT_Word word; + + CPVT_Word word; if (pIterator->GetWord(word)) { word.WordProps.fFontSize = word.fFontSize; crCurText = ArgbEncode(255,word.WordProps.dwWordColor); - if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 || - FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 || + if (place.LineCmp(oldplace) != 0 || word.WordProps.fCharSpace > 0.0f || word.WordProps.nHorzScale != 100 || + FXSYS_memcmp(&word.WordProps, &wp, sizeof(CPVT_WordProps)) != 0 || crOld != crCurText) { if (sTextBuf.GetLength() > 0) @@ -559,24 +559,24 @@ void IFX_Edit::GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* wp = word.WordProps; ptBT = word.ptWord; crOld = crCurText; - + } - sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0); - + sTextBuf << GetPDFWordString(pFontMap, word.WordProps.nFontIndex, word.Word, 0); + if (word.WordProps.nWordStyle & PVTWORD_STYLE_UNDERLINE) {/* - AddLineToPageObjects(pPageObjects, crCurText, + AddLineToPageObjects(pPageObjects, crCurText, CPDF_Point(word.ptWord.x, word.ptWord.y + word.fDescent * 0.4f), - CPDF_Point(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent * 0.4f)); + CPDF_Point(word.ptWord.x + word.fWidth, word.ptWord.y + word.fDescent * 0.4f)); */ CPDF_Rect rcUnderline = GetUnderLineRect(word); rcUnderline.left += ptOffset.x; rcUnderline.right += ptOffset.x; rcUnderline.top += ptOffset.y; rcUnderline.bottom += ptOffset.y; - - AddRectToPageObjects(pPageObjects, crCurText, rcUnderline); + + AddRectToPageObjects(pPageObjects, crCurText, rcUnderline); } if (word.WordProps.nWordStyle & PVTWORD_STYLE_CROSSOUT) @@ -587,15 +587,15 @@ void IFX_Edit::GenerateRichPageObjects(CPDF_PageObjects* pPageObjects, IFX_Edit* rcCrossout.top += ptOffset.y; rcCrossout.bottom += ptOffset.y; - AddRectToPageObjects(pPageObjects, crCurText, rcCrossout); + AddRectToPageObjects(pPageObjects, crCurText, rcCrossout); } - oldplace = place; + oldplace = place; } } if (sTextBuf.GetLength() > 0) - { + { ObjArray.Add(AddTextObjToPageObjects(pPageObjects, crOld, pFontMap->GetPDFFont(wp.nFontIndex), wp.fFontSize, wp.fCharSpace, wp.nHorzScale, CPDF_Point(ptBT.x+ptOffset.x, ptBT.y+ptOffset.y), sTextBuf.GetByteString())); } @@ -617,14 +617,14 @@ void IFX_Edit::GenerateUnderlineObjects(CPDF_PageObjects* pPageObjects, IFX_Edit else pIterator->SetAt(0); - CPVT_WordPlace oldplace; + CPVT_WordPlace oldplace; while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); if (pRange && place.WordCmp(pRange->EndPos) > 0) break; - - CPVT_Word word; + + CPVT_Word word; if (pIterator->GetWord(word)) { CPDF_Rect rcUnderline = GetUnderLineRect(word); diff --git a/fpdfsdk/src/javascript/Consts.cpp b/fpdfsdk/src/javascript/Consts.cpp index cea9f9a4c9..9edb6f443b 100644 --- a/fpdfsdk/src/javascript/Consts.cpp +++ b/fpdfsdk/src/javascript/Consts.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -168,7 +168,7 @@ int CJS_GlobalArrays::Init(IJS_Runtime* pRuntime) { const FX_WCHAR* ArrayName = L"RE_NUMBER_ENTRY_COMMA_SEP"; const FX_WCHAR* ArrayContent[] = {L"[+-]?\\d*,?\\d*"}; - + DEFINE_GLOBAL_ARRAY(pRuntime); } diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp index 9ea8029f60..d52ef0581e 100644 --- a/fpdfsdk/src/javascript/Document.cpp +++ b/fpdfsdk/src/javascript/Document.cpp @@ -1963,7 +1963,7 @@ void Document::DoAnnotDelay() } } -CJS_Document* Document::GetCJSDoc() const +CJS_Document* Document::GetCJSDoc() const { return static_cast<CJS_Document*>(m_pJSObject); } diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp index 0d5a73d6e1..c98e469408 100644 --- a/fpdfsdk/src/javascript/Field.cpp +++ b/fpdfsdk/src/javascript/Field.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -165,7 +165,7 @@ void Field::ParseFieldName(const std::wstring &strFieldNameParsed,std::wstring & } } - strFieldName = strFieldNameParsed.substr(0,iStart); + strFieldName = strFieldNameParsed.substr(0,iStart); } FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldName) @@ -176,8 +176,8 @@ FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldNam m_pDocument = pDocument->GetReaderDoc(); ASSERT(m_pDocument != NULL); - m_bCanSet = m_pDocument->GetPermissions(FPDFPERM_FILL_FORM) || - m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || + m_bCanSet = m_pDocument->GetPermissions(FPDFPERM_FILL_FORM) || + m_pDocument->GetPermissions(FPDFPERM_ANNOT_FORM) || m_pDocument->GetPermissions(FPDFPERM_MODIFY); CPDFSDK_InterForm* pRDInterForm = m_pDocument->GetInterForm(); @@ -195,7 +195,7 @@ FX_BOOL Field::AttachField(Document* pDocument, const CFX_WideString& csFieldNam int iControlNo = -1; ParseFieldName(swFieldNameTemp.c_str(), strFieldName, iControlNo); if (iControlNo == -1) return FALSE; - + m_FieldName = strFieldName.c_str(); m_nFormControlIndex = iControlNo; return TRUE; @@ -233,7 +233,7 @@ void Field::GetFormFields(const CFX_WideString& csFieldName, CFX_PtrArray& Field Field::GetFormFields(m_pDocument, csFieldName, FieldArray); } -void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, +void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormField, FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh) { ASSERT(pDocument != NULL); @@ -281,20 +281,20 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi { CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)widgets.GetAt(i); ASSERT(pWidget != NULL); - + CPDFSDK_InterForm * pInterForm = pWidget->GetInterForm(); CPDFSDK_Document* pDoc = pInterForm->GetDocument(); // CReader_Page* pPage = pWidget->GetPage(); ASSERT(pDoc != NULL); pDoc->UpdateAllViews(NULL, pWidget); } - } - + } + if (bChangeMark) pDocument->SetChangeMark(); } -void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl, +void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFormControl, FX_BOOL bChangeMark, FX_BOOL bResetAP, FX_BOOL bRefresh) { ASSERT(pDocument != NULL); @@ -304,7 +304,7 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFo ASSERT(pInterForm != NULL); CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl); - + if (pWidget) { if (bResetAP) @@ -430,14 +430,14 @@ FX_BOOL Field::alignment(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s return TRUE; } -void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, +void Field::SetAlignment(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string) { //Not supported. } FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) -{ +{ ASSERT(m_pDocument != NULL); if (vp.IsSetting()) @@ -496,7 +496,7 @@ FX_BOOL Field::borderStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& return TRUE; } -void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, +void Field::SetBorderStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string) { ASSERT(pDocument != NULL); @@ -578,7 +578,7 @@ FX_BOOL Field::buttonAlignX(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString } } else - { + { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); if (FieldArray.GetSize() <= 0) return FALSE; @@ -695,7 +695,7 @@ FX_BOOL Field::buttonFitBounds(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr if (!pFormControl)return FALSE; CPDF_IconFit IconFit = pFormControl->GetIconFit(); - vp << IconFit.GetFittingBounds(); + vp << IconFit.GetFittingBounds(); } return TRUE; @@ -868,7 +868,7 @@ FX_BOOL Field::calcOrderIndex(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStri ASSERT(m_pDocument != NULL); if (vp.IsSetting()) - { + { if (!m_bCanSet) return FALSE; int nVP; @@ -975,7 +975,7 @@ FX_BOOL Field::comb(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError } } else - { + { CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); if (FieldArray.GetSize() <= 0) return FALSE; @@ -1075,7 +1075,7 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid array.Add(iSelecting); } } - + if (m_bDelay) { AddDelay_WordArray(FP_CURRENTVALUEINDICES, array); @@ -1115,7 +1115,7 @@ FX_BOOL Field::currentValueIndices(IFXJS_Context* cc, CJS_PropValue& vp, CFX_Wid return TRUE; } -void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, +void Field::SetCurrentValueIndices(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_DWordArray& array) { ASSERT(pDocument != NULL); @@ -1160,7 +1160,7 @@ FX_BOOL Field::defaultStyle(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString { if (!m_bCanSet) return FALSE; - ; + ; } else { @@ -1183,7 +1183,7 @@ FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString if (!m_bCanSet) return FALSE; CFX_WideString WideStr; - vp >> WideStr; + vp >> WideStr; if (m_bDelay) { @@ -1203,7 +1203,7 @@ FX_BOOL Field::defaultValue(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON || + if (pFormField->GetFieldType() == FIELDTYPE_PUSHBUTTON || pFormField->GetFieldType() == FIELDTYPE_SIGNATURE) return FALSE; @@ -1284,7 +1284,7 @@ FX_BOOL Field::doNotSpellCheck(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideStr CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD && + if (pFormField->GetFieldType() != FIELDTYPE_TEXTFIELD && pFormField->GetFieldType() != FIELDTYPE_COMBOBOX) return FALSE; @@ -1313,7 +1313,7 @@ FX_BOOL Field::delay(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro if (vp.IsSetting()) { if (!m_bCanSet) return FALSE; - + bool bVP; vp >> bVP; @@ -1335,7 +1335,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr if (!m_bCanSet) return FALSE; int nVP; - vp >> nVP; + vp >> nVP; if (m_bDelay) { @@ -1363,11 +1363,11 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr FX_DWORD dwFlag = pWidget->GetFlags(); - if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag) + if (ANNOTFLAG_INVISIBLE & dwFlag || ANNOTFLAG_HIDDEN & dwFlag) { vp << (int32_t)1; } - else + else { if (ANNOTFLAG_PRINT & dwFlag) { @@ -1383,7 +1383,7 @@ FX_BOOL Field::display(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr else { vp << (int32_t)2; - } + } } } @@ -1422,7 +1422,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel dwFlag &= (~ANNOTFLAG_INVISIBLE); dwFlag &= (~ANNOTFLAG_HIDDEN); dwFlag &= (~ANNOTFLAG_NOVIEW); - dwFlag |= ANNOTFLAG_PRINT; + dwFlag |= ANNOTFLAG_PRINT; break; case 1: dwFlag &= (~ANNOTFLAG_INVISIBLE); @@ -1440,7 +1440,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel dwFlag |= ANNOTFLAG_PRINT; dwFlag &= (~ANNOTFLAG_HIDDEN); break; - } + } if (dwFlag != pWidget->GetFlags()) { @@ -1448,8 +1448,8 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel bSet = TRUE; } } - } - + } + if (bSet) UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); } else @@ -1467,7 +1467,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel dwFlag &= (~ANNOTFLAG_INVISIBLE); dwFlag &= (~ANNOTFLAG_HIDDEN); dwFlag &= (~ANNOTFLAG_NOVIEW); - dwFlag |= ANNOTFLAG_PRINT; + dwFlag |= ANNOTFLAG_PRINT; break; case 1: dwFlag &= (~ANNOTFLAG_INVISIBLE); @@ -1485,7 +1485,7 @@ void Field::SetDisplay(CPDFSDK_Document* pDocument, const CFX_WideString& swFiel dwFlag |= ANNOTFLAG_PRINT; dwFlag &= (~ANNOTFLAG_HIDDEN); break; - } + } if (dwFlag != pWidget->GetFlags()) { pWidget->SetFlags(dwFlag); @@ -1548,12 +1548,12 @@ FX_BOOL Field::exportValues(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && + if (pFormField->GetFieldType() != FIELDTYPE_CHECKBOX && pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON) return FALSE; if (vp.IsSetting()) - { + { if (!m_bCanSet) return FALSE; if (!vp.IsArrayObject())return FALSE; } @@ -1734,11 +1734,11 @@ FX_BOOL Field::hidden(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr FX_DWORD dwFlags = pWidget->GetFlags(); - if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags) + if (ANNOTFLAG_INVISIBLE & dwFlags || ANNOTFLAG_HIDDEN & dwFlags) { vp << true; } - else + else vp << false; } @@ -1766,9 +1766,9 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField for (int j=0,jsz = pFormField->CountControls(); j<jsz; j++) { if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormField->GetControl(j))) - { + { FX_DWORD dwFlags = pWidget->GetFlags(); - + if (b) { dwFlags &= (~ANNOTFLAG_INVISIBLE); @@ -1780,19 +1780,19 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField dwFlags &= (~ANNOTFLAG_INVISIBLE); dwFlags &= (~ANNOTFLAG_HIDDEN); dwFlags &= (~ANNOTFLAG_NOVIEW); - dwFlags |= ANNOTFLAG_PRINT; + dwFlags |= ANNOTFLAG_PRINT; } if (dwFlags != pWidget->GetFlags()) { - pWidget->SetFlags(dwFlags); + pWidget->SetFlags(dwFlags); bSet = TRUE; } } } if (bSet) - UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); + UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); } else { @@ -1802,7 +1802,7 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) { FX_DWORD dwFlags = pWidget->GetFlags(); - + if (b) { dwFlags &= (~ANNOTFLAG_INVISIBLE); @@ -1814,13 +1814,13 @@ void Field::SetHidden(CPDFSDK_Document* pDocument, const CFX_WideString& swField dwFlags &= (~ANNOTFLAG_INVISIBLE); dwFlags &= (~ANNOTFLAG_HIDDEN); dwFlags &= (~ANNOTFLAG_NOVIEW); - dwFlags |= ANNOTFLAG_PRINT; + dwFlags |= ANNOTFLAG_PRINT; } if (dwFlags != pWidget->GetFlags()) { - pWidget->SetFlags(dwFlags); - UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE); + pWidget->SetFlags(dwFlags); + UpdateFormControl(pDocument, pFormControl, TRUE, FALSE, TRUE); } } } @@ -1960,7 +1960,7 @@ void Field::SetLineWidth(CPDFSDK_Document* pDocument, const CFX_WideString& swFi { CPDF_FormControl* pFormControl = pFormField->GetControl(j); ASSERT(pFormControl != NULL); - + if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) { if (number != pWidget->GetBorderWidth()) @@ -2096,7 +2096,7 @@ FX_BOOL Field::name(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError } FX_BOOL Field::numItems(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) -{ +{ CFX_PtrArray FieldArray; GetFormFields(m_FieldName, FieldArray); if (FieldArray.GetSize() <= 0) return FALSE; @@ -2178,7 +2178,7 @@ FX_BOOL Field::password(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { Field::SetPassword(m_pDocument, m_FieldName, m_nFormControlIndex, bVP); - } + } } else { @@ -2280,7 +2280,7 @@ FX_BOOL Field::print(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro { CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - + CPDFSDK_Widget* pWidget = pInterForm->GetWidget(GetSmartFieldControl(pFormField)); if (!pWidget) return FALSE; @@ -2388,7 +2388,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError else { Field::SetRect(m_pDocument, m_FieldName, m_nFormControlIndex, crRect); - } + } } else { @@ -2418,7 +2418,7 @@ FX_BOOL Field::rect(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError rcArray.SetElement(2,Lower_Rightx); rcArray.SetElement(3,Lower_Righty); - vp << rcArray; + vp << rcArray; } return TRUE; @@ -2484,7 +2484,7 @@ void Field::SetRect(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldNa if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) { CPDF_Rect crRect = rect; - + CPDF_Page* pPDFPage = pWidget->GetPDFPage(); ASSERT(pPDFPage != NULL); @@ -2563,7 +2563,7 @@ FX_BOOL Field::richText(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { Field::SetRichText(m_pDocument, m_FieldName, m_nFormControlIndex, bVP); - } + } } else { @@ -2629,7 +2629,7 @@ FX_BOOL Field::rotation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { Field::SetRotation(m_pDocument, m_FieldName, m_nFormControlIndex, nVP); - } + } } else { @@ -2677,7 +2677,7 @@ FX_BOOL Field::strokeColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& else { Field::SetStrokeColor(m_pDocument, m_FieldName, m_nFormControlIndex, color); - } + } } else { @@ -2751,7 +2751,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro else { Field::SetStyle(m_pDocument, m_FieldName, m_nFormControlIndex, csBCaption); - } + } } else { @@ -2762,7 +2762,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON && + if (pFormField->GetFieldType() != FIELDTYPE_RADIOBUTTON && pFormField->GetFieldType() != FIELDTYPE_CHECKBOX) return FALSE; @@ -2799,7 +2799,7 @@ FX_BOOL Field::style(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro return TRUE; } -void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, +void Field::SetStyle(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CFX_ByteString& string) { //Not supported. @@ -2832,7 +2832,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s else { Field::SetTextColor(m_pDocument, m_FieldName, m_nFormControlIndex, color); - } + } } else { @@ -2845,7 +2845,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); if (!pFormControl)return FALSE; - + int iColorType; FX_ARGB color; CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance(); @@ -2862,7 +2862,7 @@ FX_BOOL Field::textColor(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s CJS_Array crArray(m_isolate); color::ConvertPWLColorToArray(crRet, crArray); - vp << crArray; + vp << crArray; } return TRUE; @@ -2892,7 +2892,7 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { Field::SetTextFont(m_pDocument, m_FieldName, m_nFormControlIndex, csFontName); - } + } } else { @@ -2908,8 +2908,8 @@ FX_BOOL Field::textFont(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE int nFieldType = pFormField->GetFieldType(); - if (nFieldType == FIELDTYPE_PUSHBUTTON || - nFieldType == FIELDTYPE_COMBOBOX || + if (nFieldType == FIELDTYPE_PUSHBUTTON || + nFieldType == FIELDTYPE_COMBOBOX || nFieldType == FIELDTYPE_LISTBOX || nFieldType == FIELDTYPE_TEXTFIELD) { @@ -2948,7 +2948,7 @@ FX_BOOL Field::textSize(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { Field::SetTextSize(m_pDocument, m_FieldName, m_nFormControlIndex, nVP); - } + } } else { @@ -3044,7 +3044,7 @@ FX_BOOL Field::userName(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE else { Field::SetUserName(m_pDocument, m_FieldName, m_nFormControlIndex, swName); - } + } } else { @@ -3071,7 +3071,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro ASSERT(m_pDocument != NULL); if (vp.IsSetting()) - { + { if (!m_bCanSet) return FALSE; CJS_WideStringArray strArray; @@ -3157,7 +3157,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro else { CFX_WideString swValue = pFormField->GetValue(); - + double dRet; FX_BOOL bDot; if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot)) @@ -3168,7 +3168,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro vp << dRet; } else - vp << swValue; + vp << swValue; } } break; @@ -3200,7 +3200,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro continue; } if (!bFind) - vp << L"Off"; + vp << L"Off"; } break; default: @@ -3212,7 +3212,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro return TRUE; } -void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, +void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldName, int nControlIndex, const CJS_WideStringArray& strArray) { ASSERT(pDocument != NULL); @@ -3237,7 +3237,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN if (pFormField->GetValue() != strArray.GetAt(0)) { CFX_WideString WideString = strArray.GetAt(0); - pFormField->SetValue(strArray.GetAt(0), TRUE); + pFormField->SetValue(strArray.GetAt(0), TRUE); UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); } break; @@ -3246,7 +3246,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN { if (pFormField->GetValue() != strArray.GetAt(0)) { - pFormField->SetValue(strArray.GetAt(0), TRUE); + pFormField->SetValue(strArray.GetAt(0), TRUE); UpdateFormField(pDocument, pFormField, TRUE, FALSE, TRUE); } } @@ -3279,7 +3279,7 @@ void Field::SetValue(CPDFSDK_Document* pDocument, const CFX_WideString& swFieldN } } break; - default: + default: break; } } @@ -3349,9 +3349,9 @@ FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& pa CPDFDoc_Environment* pApp = m_pDocument->GetEnv(); ASSERT(pApp != NULL); - if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) && + if ((pFormField->GetFieldFlags() & FIELDFLAG_FILESELECT) && (pFormField->GetFieldType() == FIELDTYPE_TEXTFIELD)) - { + { CFX_WideString wsFileName = pApp->JS_fieldBrowse(); if(!wsFileName.IsEmpty()) { @@ -3359,7 +3359,7 @@ FX_BOOL Field::browseForFileToSubmit(IFXJS_Context* cc, const CJS_Parameters& pa UpdateFormField(m_pDocument, pFormField, TRUE, TRUE, TRUE); } } - else + else return FALSE; return TRUE; @@ -3381,13 +3381,13 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params, CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - + if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) return FALSE; CPDF_FormControl* pFormControl = GetSmartFieldControl(pFormField); if (!pFormControl)return FALSE; - + if (nface == 0) vRet = pFormControl->GetNormalCaption().c_str(); else if (nface == 1) @@ -3410,14 +3410,14 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ int iSize = params.size(); if (iSize >= 1) nface = params[0].ToInt(); - + CFX_PtrArray FieldArray; GetFormFields(m_FieldName,FieldArray); if (FieldArray.GetSize() <= 0) return FALSE; CPDF_FormField* pFormField = (CPDF_FormField*)FieldArray.ElementAt(0); ASSERT(pFormField != NULL); - + if (pFormField->GetFieldType() != FIELDTYPE_PUSHBUTTON) return FALSE; @@ -3429,10 +3429,10 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ CJS_Runtime* pRuntime = pContext->GetJSRuntime(); ASSERT(pRuntime != NULL); - + JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"Icon")); ASSERT(pObj.IsEmpty() == FALSE); - + CJS_Icon* pJS_Icon = (CJS_Icon*)JS_GetPrivate(pObj); ASSERT(pJS_Icon != NULL); @@ -3459,7 +3459,7 @@ FX_BOOL Field::buttonGetIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { -#if 0 +#if 0 ASSERT(m_pDocument != NULL); CFX_PtrArray FieldArray; @@ -3473,7 +3473,7 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, ASSERT(pEnv); CFX_WideString sIconFileName = pEnv->JS_fieldBrowse(); - if (sIconFileName.IsEmpty()) + if (sIconFileName.IsEmpty()) { vRet = 1; return TRUE; @@ -3483,7 +3483,7 @@ FX_BOOL Field::buttonImportIcon(IFXJS_Context* cc, const CJS_Parameters& params, ASSERT(pInterForm != NULL); CPDF_Stream* pStream = pInterForm->LoadImageFromFile(sIconFileName); - if (!pStream) + if (!pStream) { vRet = -1; return TRUE; @@ -3617,7 +3617,7 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val ASSERT(pFormField != NULL); swSort.Add(new CFX_WideString(pFormField->GetFullName())); - + } swSort.Sort(JS_COMPARESTRING); @@ -3637,11 +3637,11 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pObj); ASSERT(pJSField != NULL); - Field* pField = (Field*)pJSField->GetEmbedObject(); + Field* pField = (Field*)pJSField->GetEmbedObject(); ASSERT(pField != NULL); pField->AttachField(m_pJSDoc, *pStr); - + CJS_Value FormFieldValue(m_isolate); FormFieldValue = pJSField; FormFieldArray.SetElement(j, FormFieldValue); @@ -3653,7 +3653,7 @@ FX_BOOL Field::getArray(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val swSort.RemoveAll(); return TRUE; } - + FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) { ASSERT(m_pDocument != NULL); @@ -3800,7 +3800,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val CPDFSDK_Widget* pWidget = NULL; if (nCount == 1) - { + { pWidget = pInterForm->GetWidget(pFormField->GetControl(0)); } else @@ -3815,7 +3815,7 @@ FX_BOOL Field::setFocus(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Val for (int32_t i=0; i<nCount; i++) { if (CPDFSDK_Widget* pTempWidget = pInterForm->GetWidget(pFormField->GetControl(i))) - { + { if (pTempWidget->GetPDFPage() == pCurPageView->GetPDFPage()) { pWidget = pTempWidget; diff --git a/fpdfsdk/src/javascript/Icon.cpp b/fpdfsdk/src/javascript/Icon.cpp index 8c05116643..6b3e02e1ec 100644 --- a/fpdfsdk/src/javascript/Icon.cpp +++ b/fpdfsdk/src/javascript/Icon.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -20,7 +20,7 @@ BEGIN_JS_STATIC_PROP(CJS_Icon) JS_STATIC_PROP_ENTRY(name) END_JS_STATIC_PROP() -BEGIN_JS_STATIC_METHOD(CJS_Icon) +BEGIN_JS_STATIC_METHOD(CJS_Icon) END_JS_STATIC_METHOD() IMPLEMENT_JS_CLASS(CJS_Icon,Icon) diff --git a/fpdfsdk/src/javascript/JS_Context.cpp b/fpdfsdk/src/javascript/JS_Context.cpp index 11bb092734..f41cf9ec13 100644 --- a/fpdfsdk/src/javascript/JS_Context.cpp +++ b/fpdfsdk/src/javascript/JS_Context.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -14,7 +14,7 @@ /* -------------------------- CJS_Context -------------------------- */ -CJS_Context::CJS_Context(CJS_Runtime* pRuntime) : +CJS_Context::CJS_Context(CJS_Runtime* pRuntime) : m_pRuntime(pRuntime), m_bBusy(FALSE), m_bMsgBoxEnable(TRUE) @@ -41,17 +41,17 @@ CPDFSDK_Document* CJS_Context::GetReaderDocument() CPDFDoc_Environment* CJS_Context::GetReaderApp() { ASSERT(m_pRuntime != NULL); - + return m_pRuntime->GetReaderApp(); } FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info) { if (m_bBusy) - { + { info = JSGetStringFromID(this, IDS_STRING_JSBUSY); return FALSE; - } + } m_bBusy = TRUE; @@ -66,7 +66,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri } FXJSErr error ={NULL,NULL, 0}; - int nRet = 0; + int nRet = 0; if (script.GetLength() > 0) { @@ -99,7 +99,7 @@ FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideStri m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType()); m_pEventHandler->Destroy(); - m_bBusy = FALSE; + m_bBusy = FALSE; return nRet >= 0; } @@ -343,7 +343,7 @@ void CJS_Context::OnExternal_Exec() void CJS_Context::OnBatchExec(CPDFSDK_Document* pTarget) { - ASSERT(m_pEventHandler != NULL); + ASSERT(m_pEventHandler != NULL); m_pEventHandler->OnBatchExec(pTarget); } diff --git a/fpdfsdk/src/javascript/JS_EventHandler.cpp b/fpdfsdk/src/javascript/JS_EventHandler.cpp index 1fab82f74e..7d27c66f6b 100644 --- a/fpdfsdk/src/javascript/JS_EventHandler.cpp +++ b/fpdfsdk/src/javascript/JS_EventHandler.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -57,41 +57,41 @@ void CJS_EventHandler::OnDoc_Open(CPDFSDK_Document* pDoc, const CFX_WideString& Initial(JET_DOC_OPEN); m_pTargetDoc = pDoc; - m_strTargetName = strTargetName; + m_strTargetName = strTargetName; } void CJS_EventHandler::OnDoc_WillPrint(CPDFSDK_Document* pDoc) { Initial(JET_DOC_WILLPRINT); - m_pTargetDoc = pDoc; + m_pTargetDoc = pDoc; } void CJS_EventHandler::OnDoc_DidPrint(CPDFSDK_Document* pDoc) { Initial(JET_DOC_DIDPRINT); - - m_pTargetDoc = pDoc; + + m_pTargetDoc = pDoc; } void CJS_EventHandler::OnDoc_WillSave(CPDFSDK_Document* pDoc) { Initial(JET_DOC_WILLSAVE); - m_pTargetDoc = pDoc; + m_pTargetDoc = pDoc; } void CJS_EventHandler::OnDoc_DidSave(CPDFSDK_Document* pDoc) { - Initial(JET_DOC_DIDSAVE); - - m_pTargetDoc = pDoc; + Initial(JET_DOC_DIDSAVE); + + m_pTargetDoc = pDoc; } void CJS_EventHandler::OnDoc_WillClose(CPDFSDK_Document* pDoc) { Initial(JET_DOC_WILLCLOSE); - m_pTargetDoc = pDoc; + m_pTargetDoc = pDoc; } void CJS_EventHandler::OnPage_Open(CPDFSDK_Document* pDoc) @@ -104,21 +104,21 @@ void CJS_EventHandler::OnPage_Open(CPDFSDK_Document* pDoc) void CJS_EventHandler::OnPage_Close(CPDFSDK_Document* pDoc) { Initial(JET_PAGE_CLOSE); - + m_pTargetDoc = pDoc; } void CJS_EventHandler::OnPage_InView(CPDFSDK_Document* pDoc) { Initial(JET_PAGE_INVIEW); - + m_pTargetDoc = pDoc; } void CJS_EventHandler::OnPage_OutView(CPDFSDK_Document* pDoc) { Initial(JET_PAGE_OUTVIEW); - + m_pTargetDoc = pDoc; } @@ -140,16 +140,16 @@ void CJS_EventHandler::OnField_MouseExit(FX_BOOL bModifier, FX_BOOL bShift, CPDF m_bModifier = bModifier; m_bShift = bShift; ASSERT(pTarget != NULL); - m_strTargetName = pTarget->GetFullName(); + m_strTargetName = pTarget->GetFullName(); } void CJS_EventHandler::OnField_MouseDown(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget) { Initial(JET_FIELD_MOUSEDOWN); m_eEventType = JET_FIELD_MOUSEDOWN; - + m_bModifier = bModifier; - m_bShift = bShift; + m_bShift = bShift; ASSERT(pTarget != NULL); m_strTargetName = pTarget->GetFullName(); } @@ -164,13 +164,13 @@ void CJS_EventHandler::OnField_MouseUp(FX_BOOL bModifier, FX_BOOL bShift, CPDF_F m_strTargetName = pTarget->GetFullName(); } -void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, +void CJS_EventHandler::OnField_Focus(FX_BOOL bModifier, FX_BOOL bShift, CPDF_FormField* pTarget, const CFX_WideString& Value) { Initial(JET_FIELD_FOCUS); m_bModifier = bModifier; - m_bShift = bShift; + m_bShift = bShift; ASSERT(pTarget != NULL); m_strTargetName = pTarget->GetFullName(); m_pValue = (CFX_WideString*)&Value; @@ -185,7 +185,7 @@ void CJS_EventHandler::OnField_Blur(FX_BOOL bModifier, FX_BOOL bShift, CPDF_Form m_bShift = bShift; ASSERT(pTarget != NULL); m_strTargetName = pTarget->GetFullName(); - m_pValue = (CFX_WideString*)&Value; + m_pValue = (CFX_WideString*)&Value; } void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange, @@ -196,7 +196,7 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange, FX_BOOL bFieldFull, FX_BOOL& bRc) { Initial(JET_FIELD_KEYSTROKE); - + m_nCommitKey = 0; m_pWideStrChange = &strChange; m_WideStrChangeEx = strChangeEx; @@ -204,11 +204,11 @@ void CJS_EventHandler::OnField_Keystroke(CFX_WideString &strChange, m_bModifier = bModifier; m_pISelEnd = &nSelEnd; m_pISelStart = &nSelStart; - m_bShift = bShift; + m_bShift = bShift; ASSERT(pTarget != NULL); m_strTargetName = pTarget->GetFullName(); m_pValue = &Value; - m_bWillCommit = bWillCommit; + m_bWillCommit = bWillCommit; m_pbRc = &bRc; m_bFieldFull = bFieldFull; } @@ -218,19 +218,19 @@ void CJS_EventHandler::OnField_Validate(CFX_WideString& strChange, const CFX_Wid CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) { Initial(JET_FIELD_VALIDATE); - + m_pWideStrChange = &strChange; - m_WideStrChangeEx = strChangeEx; + m_WideStrChangeEx = strChangeEx; m_bKeyDown = bKeyDown; m_bModifier = bModifier; m_bShift = bShift; ASSERT(pTarget != NULL); m_strTargetName = pTarget->GetFullName(); - m_pValue = &Value; - m_pbRc = &bRc; + m_pValue = &Value; + m_pbRc = &bRc; } -void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, +void CJS_EventHandler::OnField_Calculate(CPDF_FormField* pSource, CPDF_FormField* pTarget, CFX_WideString& Value, FX_BOOL& bRc) { Initial(JET_FIELD_CALCULATE); @@ -248,7 +248,7 @@ void CJS_EventHandler::OnField_Format(CPDF_FormField* pTarget, FX_BOOL bWillCommit) { Initial(JET_FIELD_FORMAT); - + m_nCommitKey = 0; ASSERT(pTarget != NULL); m_strTargetName = pTarget->GetFullName(); @@ -349,15 +349,15 @@ void CJS_EventHandler::OnScreen_OutView(FX_BOOL bModifier, FX_BOOL bShift, CPDFS void CJS_EventHandler::OnLink_MouseUp(CPDFSDK_Document* pTarget) { Initial(JET_LINK_MOUSEUP); - - m_pTargetDoc = pTarget; + + m_pTargetDoc = pTarget; } void CJS_EventHandler::OnBookmark_MouseUp(CPDF_Bookmark* pBookMark) { Initial(JET_BOOKMARK_MOUSEUP); - m_pTargetBookMark = pBookMark; + m_pTargetBookMark = pBookMark; } void CJS_EventHandler::OnMenu_Exec(CPDFSDK_Document* pTarget, const CFX_WideString& strTargetName) @@ -377,7 +377,7 @@ void CJS_EventHandler::OnBatchExec(CPDFSDK_Document* pTarget) { Initial(JET_BATCH_EXEC); - m_pTargetDoc = pTarget; + m_pTargetDoc = pTarget; } void CJS_EventHandler::OnConsole_Exec() @@ -477,13 +477,13 @@ const FX_WCHAR* CJS_EventHandler::Name() case JET_DOC_WILLPRINT: return L"WillPrint"; case JET_DOC_WILLSAVE: return L"WillSave"; case JET_EXTERNAL_EXEC: return L"Exec"; - case JET_FIELD_FOCUS: + case JET_FIELD_FOCUS: case JET_SCREEN_FOCUS: return L"Focus"; - case JET_FIELD_BLUR: + case JET_FIELD_BLUR: case JET_SCREEN_BLUR: return L"Blur"; case JET_FIELD_MOUSEDOWN: case JET_SCREEN_MOUSEDOWN: return L"Mouse Down"; - case JET_FIELD_MOUSEUP: + case JET_FIELD_MOUSEUP: case JET_SCREEN_MOUSEUP: return L"Mouse Up"; case JET_FIELD_MOUSEENTER: case JET_SCREEN_MOUSEENTER: return L"Mouse Enter"; @@ -495,11 +495,11 @@ const FX_WCHAR* CJS_EventHandler::Name() case JET_FIELD_VALIDATE: return L"Validate"; case JET_LINK_MOUSEUP: return L"Mouse Up"; case JET_MENU_EXEC: return L"Exec"; - case JET_PAGE_OPEN: + case JET_PAGE_OPEN: case JET_SCREEN_OPEN: return L"Open"; case JET_PAGE_CLOSE: case JET_SCREEN_CLOSE: return L"Close"; - case JET_SCREEN_INVIEW: + case JET_SCREEN_INVIEW: case JET_PAGE_INVIEW: return L"InView"; case JET_PAGE_OUTVIEW: case JET_SCREEN_OUTVIEW: return L"OutView"; @@ -516,7 +516,7 @@ const FX_WCHAR* CJS_EventHandler::Type() { case JET_APP_INIT: return L"App"; case JET_BATCH_EXEC: return L"Batch"; - case JET_BOOKMARK_MOUSEUP: return L"BookMark"; + case JET_BOOKMARK_MOUSEUP: return L"BookMark"; case JET_CONSOLE_EXEC: return L"Console"; case JET_DOC_DIDPRINT: case JET_DOC_DIDSAVE: @@ -545,7 +545,7 @@ const FX_WCHAR* CJS_EventHandler::Type() case JET_SCREEN_MOUSEEXIT: case JET_SCREEN_INVIEW: case JET_SCREEN_OUTVIEW: return L"Screen"; - case JET_LINK_MOUSEUP: return L"Link"; + case JET_LINK_MOUSEUP: return L"Link"; case JET_MENU_EXEC: return L"Menu"; case JET_PAGE_OPEN: case JET_PAGE_CLOSE: @@ -563,7 +563,7 @@ FX_BOOL& CJS_EventHandler::Rc() if (m_pbRc != NULL) return *m_pbRc; else - { + { return m_bRcDu; } } @@ -614,7 +614,7 @@ Field* CJS_EventHandler::Source() pDocument->AttachDoc(m_pTargetDoc); else pDocument->AttachDoc(m_pJSContext->GetReaderDocument()); - + //if (m_pSourceField == NULL) // return NULL; //CRAO_Widget *pWidget = IBCL_Widget::GetWidget(m_pSourceField); @@ -623,10 +623,10 @@ Field* CJS_EventHandler::Source() //CFX_WideString csFieldName = pFormField->GetFullName(); CJS_Field * pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj); ASSERT(pJSField != NULL); - Field * pField = (Field *)pJSField->GetEmbedObject(); + Field * pField = (Field *)pJSField->GetEmbedObject(); ASSERT(pField != NULL); pField->AttachField(pDocument, m_strSourceName); - return pField; + return pField; } Field* CJS_EventHandler::Target_Field() @@ -648,15 +648,15 @@ Field* CJS_EventHandler::Target_Field() pDocument->AttachDoc(m_pTargetDoc); else pDocument->AttachDoc(m_pJSContext->GetReaderDocument()); - + CJS_Field* pJSField = (CJS_Field*)JS_GetPrivate(pFieldObj); ASSERT(pJSField != NULL); - Field* pField = (Field *)pJSField->GetEmbedObject(); + Field* pField = (Field *)pJSField->GetEmbedObject(); ASSERT(pField != NULL); pField->AttachField(pDocument, m_strTargetName); - return pField; + return pField; } CFX_WideString& CJS_EventHandler::Value() diff --git a/fpdfsdk/src/javascript/JS_GlobalData.cpp b/fpdfsdk/src/javascript/JS_GlobalData.cpp index 0fa2189453..e17f305d36 100644 --- a/fpdfsdk/src/javascript/JS_GlobalData.cpp +++ b/fpdfsdk/src/javascript/JS_GlobalData.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -121,7 +121,7 @@ CJS_GlobalData::CJS_GlobalData(CPDFDoc_Environment* pApp) : m_pApp(pApp) { // IBaseAnnot* pBaseAnnot = IBaseAnnot::GetBaseAnnot(m_pApp); // ASSERT(pBaseAnnot != NULL); -// +// // m_sFilePath = pBaseAnnot->GetUserPath(); m_sFilePath += SDK_JS_GLOBALDATA_FILENAME; @@ -268,7 +268,7 @@ void CJS_GlobalData::SetGlobalVariableObject(const FX_CHAR* propname, const CJS_ pNewData->data.sKey = sPropName; pNewData->data.nType = JS_GLOBALDATA_TYPE_OBJECT; pNewData->data.objData.Copy(array); - + m_arrayGlobalData.Add(pNewData); } } @@ -277,12 +277,12 @@ void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname) { ASSERT(propname != NULL); CFX_ByteString sPropName = propname; - + sPropName.TrimLeft(); sPropName.TrimRight(); - + if (sPropName.GetLength() == 0) return; - + if (CJS_GlobalData_Element* pData = GetGlobalVariable(sPropName)) { pData->data.nType = JS_GLOBALDATA_TYPE_NULL; @@ -292,7 +292,7 @@ void CJS_GlobalData::SetGlobalVariableNull(const FX_CHAR* propname) CJS_GlobalData_Element* pNewData = new CJS_GlobalData_Element; pNewData->data.sKey = sPropName; pNewData->data.nType = JS_GLOBALDATA_TYPE_NULL; - + m_arrayGlobalData.Add(pNewData); } } diff --git a/fpdfsdk/src/javascript/JS_Object.cpp b/fpdfsdk/src/javascript/JS_Object.cpp index 9f2d0f8258..bb7d6c4108 100644 --- a/fpdfsdk/src/javascript/JS_Object.cpp +++ b/fpdfsdk/src/javascript/JS_Object.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -46,7 +46,7 @@ CPDFSDK_PageView* FXJS_GetPageView(IFXJS_Context* cc) /* --------------------------------- CJS_EmbedObj --------------------------------- */ -CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : +CJS_EmbedObj::CJS_EmbedObj(CJS_Object* pJSObject) : m_pJSObject(pJSObject) { } @@ -76,7 +76,7 @@ CJS_Timer* CJS_EmbedObj::BeginTimer(CPDFDoc_Environment* pApp, FX_UINT nElapse) { CJS_Timer* pTimer = new CJS_Timer(this,pApp); pTimer->SetJSTimer(nElapse); - + return pTimer; } diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index d8fea8d768..2ffc9ff988 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -48,7 +48,7 @@ void CJS_RuntimeFactory::AddRef() m_nRef++; } void CJS_RuntimeFactory::Release() -{ +{ if(m_bInit) { //to do.Should be implemented as atom manipulation. @@ -85,7 +85,7 @@ CJS_GlobalData* CJS_RuntimeFactory::NewGlobalData(CPDFDoc_Environment* pApp) void CJS_RuntimeFactory::ReleaseGlobalData() { m_nGlobalDataCount--; - + if (m_nGlobalDataCount <= 0) { delete m_pGlobalData; @@ -178,21 +178,21 @@ FX_BOOL CJS_Runtime::InitJSObjects() if (CJS_Position::Init(*this, JS_STATIC) < 0) return FALSE; if (CJS_ScaleHow::Init(*this, JS_STATIC) < 0) return FALSE; if (CJS_ScaleWhen::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_Style::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_Zoomtype::Init(*this, JS_STATIC) < 0) return FALSE; //9 - 11 if (CJS_App::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_Color::Init(*this, JS_STATIC) < 0) return FALSE; if (CJS_Console::Init(*this, JS_STATIC) < 0) return FALSE; //12 - 14 - if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE; - if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE; - if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE; + if (CJS_Document::Init(*this, JS_DYNAMIC) < 0) return FALSE; + if (CJS_Event::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_Field::Init(*this, JS_DYNAMIC) < 0) return FALSE; //15 - 17 - if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE; + if (CJS_Global::Init(*this, JS_STATIC) < 0) return FALSE; if (CJS_Icon::Init(*this, JS_DYNAMIC) < 0) return FALSE; if (CJS_Util::Init(*this, JS_STATIC) < 0) return FALSE; @@ -373,7 +373,7 @@ FX_BOOL CJS_Runtime::GetHValueByName(const CFX_ByteStringC& utf8Name, FXJSE_HVAL //v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsolate(), m_context); v8::Local<v8::Value> propvalue = context->Global()->Get(v8::String::NewFromUtf8(GetIsolate(), name, v8::String::kNormalString, utf8Name.GetLength())); - + if (propvalue.IsEmpty()) { FXJSE_Value_SetUndefined(hValue); return FALSE; @@ -398,6 +398,6 @@ FX_BOOL CJS_Runtime::SetHValueByName(const CFX_ByteStringC& utf8Name, FXJSE_HVAL //v8::Local<v8::Context> tmpCotext = v8::Local<v8::Context>::New(GetIsolate(), m_context); v8::Local<v8::Value> propvalue = v8::Local<v8::Value>::New(GetIsolate(),((CFXJSE_Value*)hValue)->DirectGetValue()); context->Global()->Set(v8::String::NewFromUtf8(pIsolate, name, v8::String::kNormalString, utf8Name.GetLength()), propvalue); - + return TRUE; } diff --git a/fpdfsdk/src/javascript/JS_Value.cpp b/fpdfsdk/src/javascript/JS_Value.cpp index 5bca831710..058f2eaf45 100644 --- a/fpdfsdk/src/javascript/JS_Value.cpp +++ b/fpdfsdk/src/javascript/JS_Value.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -35,39 +35,39 @@ CJS_Value::CJS_Value(v8::Isolate* isolate, const float &fValue):m_isolate(isolat operator =(fValue); } -CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, const double &dValue):m_isolate(isolate) { operator =(dValue); } -CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, JSFXObject pJsObj):m_isolate(isolate) { operator =(pJsObj); } -CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object* pJsObj):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Object* pJsObj):m_isolate(isolate) { operator =(pJsObj); } -CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Document* pJsDoc):m_isolate(isolate) { m_eType = VT_object; if (pJsDoc) m_pValue = (JSFXObject)*pJsDoc; } -CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_WCHAR* pWstr):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_WCHAR* pWstr):m_isolate(isolate) { operator =(pWstr); } -CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, const FX_CHAR* pStr):m_isolate(isolate) { operator = (pStr); } -CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Array& array):m_isolate(isolate) +CJS_Value::CJS_Value(v8::Isolate* isolate, CJS_Array& array):m_isolate(isolate) { operator = (array); } @@ -215,7 +215,7 @@ void CJS_Value::SetNull() } void CJS_Value::operator = (const FX_CHAR* pStr) -{ +{ operator = (CFX_WideString::FromLocal(pStr).c_str()); } @@ -256,7 +256,7 @@ FXJSVALUETYPE CJS_Value::GetType() const return VT_unknown; } -FX_BOOL CJS_Value::IsArrayObject() const +FX_BOOL CJS_Value::IsArrayObject() const { if(m_pValue.IsEmpty()) return FALSE; return m_pValue->IsArray(); @@ -294,12 +294,12 @@ FX_BOOL CJS_Value::ConvertToDate(CJS_Date &date) const return TRUE; } - return FALSE; + return FALSE; } /* ---------------------------- CJS_PropValue ---------------------------- */ -CJS_PropValue::CJS_PropValue(const CJS_Value &value) : +CJS_PropValue::CJS_PropValue(const CJS_Value &value) : CJS_Value(value), m_bIsSetting(0) { @@ -472,7 +472,7 @@ CJS_Array::CJS_Array(v8::Isolate* isolate):m_isolate(isolate) } CJS_Array::~CJS_Array() -{ +{ } void CJS_Array::Attach(v8::Local<v8::Array> pArray) @@ -522,16 +522,16 @@ CJS_Date::CJS_Date(v8::Isolate* isolate) :m_isolate(isolate) { } -CJS_Date::CJS_Date(v8::Isolate* isolate,double dMsec_time) +CJS_Date::CJS_Date(v8::Isolate* isolate,double dMsec_time) { m_isolate = isolate; - m_pDate = JS_NewDate(isolate,dMsec_time); + m_pDate = JS_NewDate(isolate,dMsec_time); } -CJS_Date::CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec) +CJS_Date::CJS_Date(v8::Isolate* isolate,int year, int mon, int day,int hour, int min, int sec) { m_isolate = isolate; - m_pDate = JS_NewDate(isolate,MakeDate(year,mon,day,hour,min,sec,0)); + m_pDate = JS_NewDate(isolate,MakeDate(year,mon,day,hour,min,sec,0)); } double CJS_Date::MakeDate(int year, int mon, int day,int hour, int min, int sec,int ms) diff --git a/fpdfsdk/src/javascript/PublicMethods.cpp b/fpdfsdk/src/javascript/PublicMethods.cpp index c3fb8c3b2e..3a0ac00097 100644 --- a/fpdfsdk/src/javascript/PublicMethods.cpp +++ b/fpdfsdk/src/javascript/PublicMethods.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -174,13 +174,13 @@ FX_BOOL CJS_PublicMethods::maskSatisfied(wchar_t c_Change,wchar_t c_Mask) switch (c_Mask) { case L'9': - return IsDigit(c_Change); + return IsDigit(c_Change); case L'A': - return IsAlphabetic(c_Change); + return IsAlphabetic(c_Change); case L'O': - return IsAlphaNumeric(c_Change); + return IsAlphaNumeric(c_Change); case L'X': - return TRUE; + return TRUE; default: return (c_Change == c_Mask); } @@ -300,7 +300,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig CFX_WideString swDigits; while (p <= pEnd) - { + { c = *p; if (IsDigit(c)) @@ -308,7 +308,7 @@ double CJS_PublicMethods::ParseNumber(const FX_WCHAR* swSource, FX_BOOL& bAllDig swDigits += c; bDigitExist = TRUE; } - else + else { switch (c) { @@ -454,11 +454,11 @@ CJS_Array CJS_PublicMethods::AF_MakeArrayFromList(v8::Isolate* isolate, CJS_Valu StrArray.SetElement(nIndex, CJS_Value(isolate, StrTrim(pSub).c_str())); delete []pSub; - + nIndex ++; p = ++pTemp; } - + } return StrArray; } @@ -477,7 +477,7 @@ int CJS_PublicMethods::ParseStringInteger(const CFX_WideString& string,int nStar { nRet = nRet * 10 + (c - '0'); nSkip = i - nStart + 1; - if (nSkip >= nMaxStep) + if (nSkip >= nMaxStep) break; } else @@ -531,7 +531,7 @@ double CJS_PublicMethods::ParseNormalDate(const CFX_WideString & value, FX_BOOL& if (IsDigit((wchar_t)c)) { number[nIndex++] = ParseStringInteger(value, i, nSkip, 4); - i += nSkip; + i += nSkip; } else { @@ -1066,34 +1066,34 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete } if(!pEvent->m_pValue) return FALSE; - CFX_WideString& Value = pEvent->Value(); + CFX_WideString& Value = pEvent->Value(); CFX_ByteString strValue = StrTrim(CFX_ByteString::FromUnicode(Value)); - + if (strValue.IsEmpty()) return TRUE; - + int iDec = params[0].ToInt(); int iSepStyle = params[1].ToInt(); int iNegStyle = params[2].ToInt(); // params[3] is iCurrStyle, it's not used. std::wstring wstrCurrency(params[4].ToCFXWideString().c_str()); FX_BOOL bCurrencyPrepend = params[5].ToBool(); - + if (iDec < 0) iDec = -iDec; - + if (iSepStyle < 0 || iSepStyle > 3) iSepStyle = 0; - + if (iNegStyle < 0 || iNegStyle > 3) iNegStyle = 0; - - + + ////////////////////////////////////////////////////// //for processing decimal places strValue.Replace(",", "."); double dValue = atof(strValue); if (iDec > 0) dValue += DOUBLE_CORRECT;// - + int iDec2; FX_BOOL bNagative = FALSE; @@ -1117,7 +1117,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete strValue = "0" + strValue; } iDec2 = 0; - + } int iMax = strValue.GetLength(); if (iDec2 > iMax) @@ -1126,7 +1126,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete { strValue += "0"; } - iMax = iDec2+1; + iMax = iDec2+1; } /////////////////////////////////////////////////////// //for processing seperator style @@ -1142,7 +1142,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete strValue.Insert(iDec2, ','); iMax++; } - + if (iDec2 == 0) strValue.Insert(iDec2, '0'); } @@ -1153,18 +1153,18 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete cSeperator = ','; else cSeperator = '.'; - + int iDecPositive,iDecNagative; iDecPositive = iDec2; - iDecNagative = iDec2; - + iDecNagative = iDec2; + for (iDecPositive = iDec2 -3; iDecPositive > 0;iDecPositive -= 3) { strValue.Insert(iDecPositive, cSeperator); iMax++; } } - + ////////////////////////////////////////////////////////////////////// //for processing currency string @@ -1175,9 +1175,9 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete strValue2 = wstrCurrency + strValue2; else strValue2 = strValue2 + wstrCurrency; - - - + + + ///////////////////////////////////////////////////////////////////////// //for processing negative style if (bNagative) @@ -1203,9 +1203,9 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete arColor.SetElement(1,vColElm); vColElm = 0; arColor.SetElement(2,vColElm); - + arColor.SetElement(3,vColElm); - + CJS_PropValue vProp(isolate); vProp.StartGetting(); vProp<<arColor; @@ -1228,11 +1228,11 @@ FX_BOOL CJS_PublicMethods::AFNumber_Format(IFXJS_Context* cc, const CJS_Paramete arColor.SetElement(1,vColElm); arColor.SetElement(2,vColElm); arColor.SetElement(3,vColElm); - + CJS_PropValue vProp(isolate); vProp.StartGetting(); fTarget->textColor(cc,vProp,sError); - + CJS_Array aProp(isolate); vProp.ConvertToArray(aProp); @@ -1264,16 +1264,16 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); ASSERT(pEvent != NULL); - + if(params.size() < 2) return FALSE; int iSepStyle = params[1].ToInt(); - + if (iSepStyle < 0 || iSepStyle > 3) iSepStyle = 0; if(!pEvent->m_pValue) return FALSE; - CFX_WideString & val = pEvent->Value(); + CFX_WideString & val = pEvent->Value(); CFX_WideString & w_strChange = pEvent->Change(); CFX_WideString w_strValue = val; @@ -1283,7 +1283,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param CFX_WideString wstrValue = StrLTrim(w_strValue.c_str()); if (wstrValue.IsEmpty()) return TRUE; - + CFX_WideString swTemp = wstrValue; swTemp.Replace(L",", L"."); if (!IsNumber(swTemp.c_str())) @@ -1326,7 +1326,7 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param cSep = L','; break; } - + FX_BOOL bHasSep = (w_strValue2.find(cSep) != -1); for (std::wstring::iterator it = w_strChange2.begin(); it != w_strChange2.end(); it++) { @@ -1367,16 +1367,16 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param bHasSign = TRUE; continue; } - + if (!IsDigit(*it)) - { + { FX_BOOL &bRc = pEvent->Rc(); bRc = FALSE; return TRUE; } } - - + + std::wstring w_prefix = w_strValue2.substr(0,pEvent->SelStart()); std::wstring w_postfix; if (pEvent->SelEnd()<(int)w_strValue2.length()) @@ -1384,8 +1384,8 @@ FX_BOOL CJS_PublicMethods::AFNumber_Keystroke(IFXJS_Context* cc, const CJS_Param w_strValue2 = w_prefix + w_strChange2 + w_postfix; w_strValue = w_strValue2.c_str(); val = w_strValue; - return TRUE; - + return TRUE; + } //function AFPercent_Format(nDec, sepStyle) @@ -1441,7 +1441,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet strValue = "0" + strValue; } iDec2 = 0; - + } int iMax = strValue.GetLength(); if (iDec2 > iMax) @@ -1450,7 +1450,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet { strValue += "0"; } - iMax = iDec2+1; + iMax = iDec2+1; } /////////////////////////////////////////////////////// //for processing seperator style @@ -1466,7 +1466,7 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet strValue.Insert(iDec2, ','); iMax++; } - + if (iDec2 == 0) strValue.Insert(iDec2, '0'); } @@ -1477,11 +1477,11 @@ FX_BOOL CJS_PublicMethods::AFPercent_Format(IFXJS_Context* cc, const CJS_Paramet cSeperator = ','; else cSeperator = '.'; - + int iDecPositive,iDecNagative; iDecPositive = iDec2; iDecNagative = iDec2; - + for (iDecPositive = iDec2 -3; iDecPositive > 0; iDecPositive -= 3) { strValue.Insert(iDecPositive,cSeperator); @@ -1569,7 +1569,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) { FX_WCHAR c = strValue.GetAt(i); if(c == L' ' || c == L':') - { + { wsArray.Add(sTemp); sTemp = L""; continue; @@ -1577,7 +1577,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) sTemp += c; } - + wsArray.Add(sTemp); if(wsArray.GetSize() != 8)return 0; @@ -1607,7 +1607,7 @@ double CJS_PublicMethods::MakeInterDate(CFX_WideString strValue) { dRet = JS_DateParse(strValue.c_str()); } - + return dRet; } @@ -1793,24 +1793,24 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet if(!pEvent->m_pValue) return FALSE; - CFX_WideString& Value = pEvent->Value(); + CFX_WideString& Value = pEvent->Value(); std::string strSrc = CFX_ByteString::FromUnicode(Value).c_str(); - - switch (iIndex) + + switch (iIndex) { - case 0: + case 0: cFormat = "99999"; break; - case 1: + case 1: cFormat = "99999-9999"; break; - case 2: + case 2: { std::string NumberStr; - util::printx("9999999999", strSrc,NumberStr); + util::printx("9999999999", strSrc,NumberStr); if (NumberStr.length() >= 10 ) cFormat = "(999) 999-9999"; - else + else cFormat = "999-9999"; break; } @@ -1818,7 +1818,7 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Format(IFXJS_Context* cc, const CJS_Paramet cFormat = "999-99-9999"; break; } - + std::string strDes; util::printx(cFormat,strSrc,strDes); Value = CFX_WideString::FromLocal(strDes.c_str()); @@ -1946,23 +1946,23 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para std::string strSrc = CFX_ByteString::FromUnicode(val).c_str(); std::wstring wstrChange = pEvent->Change().c_str(); - switch (iIndex) + switch (iIndex) { - case 0: + case 0: cFormat = "99999"; break; - case 1: + case 1: //cFormat = "99999-9999"; cFormat = "999999999"; break; - case 2: + case 2: { std::string NumberStr; - util::printx("9999999999", strSrc,NumberStr); + util::printx("9999999999", strSrc,NumberStr); if (strSrc.length() + wstrChange.length() > 7 ) //cFormat = "(999) 999-9999"; cFormat = "9999999999"; - else + else //cFormat = "999-9999"; cFormat = "9999999"; break; @@ -1972,11 +1972,11 @@ FX_BOOL CJS_PublicMethods::AFSpecial_Keystroke(IFXJS_Context* cc, const CJS_Para cFormat = "999999999"; break; } - + CJS_Parameters params2; CJS_Value vMask(isolate, cFormat.c_str()); params2.push_back(vMask); - + return AFSpecial_KeystrokeEx(cc,params2,vRet,sError); } @@ -2199,7 +2199,7 @@ FX_BOOL CJS_PublicMethods::AFSimple_Calculate(IFXJS_Context* cc, const CJS_Param return TRUE; } -/* This function validates the current event to ensure that its value is +/* This function validates the current event to ensure that its value is ** within the specified range. */ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError) @@ -2209,7 +2209,7 @@ FX_BOOL CJS_PublicMethods::AFRange_Validate(IFXJS_Context* cc, const CJS_Paramet CJS_EventHandler* pEvent = pContext->GetEventHandler(); ASSERT(pEvent != NULL); - if (params.size() != 4) + if (params.size() != 4) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); return FALSE; @@ -2260,7 +2260,7 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); - if (params.size() != 1) + if (params.size() != 1) { sError = JSGetStringFromID(pContext, IDS_STRING_JSPARAMERROR); return FALSE; @@ -2295,7 +2295,7 @@ FX_BOOL CJS_PublicMethods::AFExtractNums(IFXJS_Context* cc, const CJS_Parameters if (sPart.GetLength() > 0) { - nums.SetElement(nIndex,CJS_Value(isolate,sPart.c_str())); + nums.SetElement(nIndex,CJS_Value(isolate,sPart.c_str())); } if (nums.GetLength() > 0) diff --git a/fpdfsdk/src/javascript/color.cpp b/fpdfsdk/src/javascript/color.cpp index 7f36be0920..a2bbadcd51 100644 --- a/fpdfsdk/src/javascript/color.cpp +++ b/fpdfsdk/src/javascript/color.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -32,13 +32,13 @@ END_JS_STATIC_CONST() BEGIN_JS_STATIC_PROP(CJS_Color) JS_STATIC_PROP_ENTRY(black) JS_STATIC_PROP_ENTRY(blue) - JS_STATIC_PROP_ENTRY(cyan) + JS_STATIC_PROP_ENTRY(cyan) JS_STATIC_PROP_ENTRY(dkGray) JS_STATIC_PROP_ENTRY(gray) JS_STATIC_PROP_ENTRY(green) JS_STATIC_PROP_ENTRY(ltGray) JS_STATIC_PROP_ENTRY(magenta) - JS_STATIC_PROP_ENTRY(red) + JS_STATIC_PROP_ENTRY(red) JS_STATIC_PROP_ENTRY(transparent) JS_STATIC_PROP_ENTRY(white) JS_STATIC_PROP_ENTRY(yellow) diff --git a/fpdfsdk/src/javascript/console.cpp b/fpdfsdk/src/javascript/console.cpp index f13017022b..ed9b1fbc56 100644 --- a/fpdfsdk/src/javascript/console.cpp +++ b/fpdfsdk/src/javascript/console.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" diff --git a/fpdfsdk/src/javascript/event.cpp b/fpdfsdk/src/javascript/event.cpp index fb57e741ee..f57b1fb607 100644 --- a/fpdfsdk/src/javascript/event.cpp +++ b/fpdfsdk/src/javascript/event.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -43,12 +43,12 @@ BEGIN_JS_STATIC_PROP(CJS_Event) JS_STATIC_PROP_ENTRY(willCommit) END_JS_STATIC_PROP() -BEGIN_JS_STATIC_METHOD(CJS_Event) +BEGIN_JS_STATIC_METHOD(CJS_Event) END_JS_STATIC_METHOD() IMPLEMENT_JS_CLASS(CJS_Event,event) -event::event(CJS_Object * pJsObject) : CJS_EmbedObj(pJsObject) +event::event(CJS_Object * pJsObject) : CJS_EmbedObj(pJsObject) { } @@ -86,7 +86,7 @@ FX_BOOL event::changeEx(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sE ASSERT(pEvent != NULL); vp << pEvent->ChangeEx(); - return TRUE; + return TRUE; } FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) @@ -103,7 +103,7 @@ FX_BOOL event::commitKey(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& s } FX_BOOL event::fieldFull(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) -{ +{ CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -248,7 +248,7 @@ FX_BOOL event::selEnd(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErr } FX_BOOL event::selStart(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) -{ +{ CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); CJS_EventHandler* pEvent = pContext->GetEventHandler(); @@ -288,7 +288,7 @@ FX_BOOL event::shift(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro FX_BOOL event::source(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError) { - if (!vp.IsGetting())return FALSE; + if (!vp.IsGetting())return FALSE; CJS_Context* pContext = (CJS_Context*)cc; ASSERT(pContext != NULL); diff --git a/fpdfsdk/src/javascript/global.cpp b/fpdfsdk/src/javascript/global.cpp index b7908dc993..e829d7fb19 100644 --- a/fpdfsdk/src/javascript/global.cpp +++ b/fpdfsdk/src/javascript/global.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/IJavaScript.h" @@ -104,9 +104,9 @@ FX_BOOL CJS_Global::InitInstance(IFXJS_Context* cc) global_alternate* pGlobal = (global_alternate*)GetEmbedObject(); ASSERT(pGlobal != NULL); - + pGlobal->Initial(pContext->GetReaderApp()); - + return TRUE; }; @@ -335,10 +335,10 @@ void global_alternate::CommitGlobalPersisitentVariables() FX_POSITION pos = m_mapGlobal.GetStartPosition(); while (pos) { - CFX_ByteString name; + CFX_ByteString name; js_global_data* pData = NULL; m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData); - + if (pData) { if (pData->bDeleted) @@ -390,7 +390,7 @@ void global_alternate::ObjectToArray(v8::Local<v8::Object> pObj, CJS_GlobalVaria for (int i=0; i<nObjElements; i++) { - + CFX_WideString ws = JS_ToString(isolate, JS_GetArrayElement(isolate, pKeyList, i)); CFX_ByteString sKey = ws.UTF8Encode(); @@ -489,7 +489,7 @@ void global_alternate::DestroyGlobalPersisitentVariables() FX_POSITION pos = m_mapGlobal.GetStartPosition(); while (pos) { - CFX_ByteString name; + CFX_ByteString name; js_global_data* pData = NULL; m_mapGlobal.GetNextAssoc(pos, name, (void*&)pData); delete pData; @@ -499,7 +499,7 @@ void global_alternate::DestroyGlobalPersisitentVariables() } -FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, +FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, double dData, bool bData, const CFX_ByteString& sData, JSObject pData, bool bDefaultPersistent) { if (propname == NULL) return FALSE; @@ -545,7 +545,7 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, break; default: return FALSE; - } + } return TRUE; } @@ -595,7 +595,7 @@ FX_BOOL global_alternate::SetGlobalVariables(const FX_CHAR* propname, int nType, break; default: return FALSE; - } + } m_mapGlobal.SetAt(propname, (void*)pNewData); diff --git a/fpdfsdk/src/javascript/util.cpp b/fpdfsdk/src/javascript/util.cpp index 97bddec5c1..22e1c6dd99 100644 --- a/fpdfsdk/src/javascript/util.cpp +++ b/fpdfsdk/src/javascript/util.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/javascript/JavaScript.h" @@ -152,7 +152,7 @@ FX_BOOL util::printf(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& iOffend = c_ConvChar.find(L"%",iOffset+1); std::wstring strSub; if (iOffend == -1) - strSub = c_ConvChar.substr(iOffset); + strSub = c_ConvChar.substr(iOffset); else strSub = c_ConvChar.substr(iOffset ,iOffend - iOffset); c_strConvers.push_back(strSub); @@ -235,7 +235,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& switch (nFormat) { case 0: - swResult.Format(L"D:%04d%02d%02d%02d%02d%02d", + swResult.Format(L"D:%04d%02d%02d%02d%02d%02d", jsDate.GetYear(), jsDate.GetMonth() + 1, jsDate.GetDay(), @@ -244,7 +244,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& jsDate.GetSeconds()); break; case 1: - swResult.Format(L"%04d.%02d.%02d %02d:%02d:%02d", + swResult.Format(L"%04d.%02d.%02d %02d:%02d:%02d", jsDate.GetYear(), jsDate.GetMonth() + 1, jsDate.GetDay(), @@ -253,7 +253,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& jsDate.GetSeconds()); break; case 2: - swResult.Format(L"%04d/%02d/%02d %02d:%02d:%02d", + swResult.Format(L"%04d/%02d/%02d %02d:%02d:%02d", jsDate.GetYear(), jsDate.GetMonth() + 1, jsDate.GetDay(), @@ -373,7 +373,7 @@ FX_BOOL util::printd(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& void util::printd(const std::wstring &cFormat2, CJS_Date jsDate, bool bXFAPicture, std::wstring &cPurpose) { std::wstring cFormat = cFormat2; - + if (bXFAPicture) { return ; //currently, it doesn't support XFAPicture. @@ -588,8 +588,8 @@ FX_BOOL util::scand(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& { FX_BOOL bWrongFormat = FALSE; dDate = CJS_PublicMethods::MakeRegularDate(sDate,sFormat,bWrongFormat); - } - + } + if (!JS_PortIsNan(dDate)) { CJS_Date date(isolate,dDate); diff --git a/fpdfsdk/src/jsapi/fxjs_v8.cpp b/fpdfsdk/src/jsapi/fxjs_v8.cpp index 3ab27e2d4a..fadfbc092f 100644 --- a/fpdfsdk/src/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/src/jsapi/fxjs_v8.cpp @@ -1,11 +1,11 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../../core/include/fxcrt/fx_basic.h" -#include "../../../core/include/fxcrt/fx_ext.h" +#include "../../../core/include/fxcrt/fx_ext.h" #include "../../include/jsapi/fxjs_v8.h" #include "../../include/fsdk_define.h" #include "time.h" @@ -80,7 +80,7 @@ int JS_DefineObj(IJS_Runtime* pJSRuntime, const wchar_t* sObjName, FXJSOBJTYPE e v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); CFX_PtrArray* pArray = (CFX_PtrArray*)isolate->GetData(1); - if(!pArray) + if(!pArray) { pArray = FX_NEW CFX_PtrArray(); isolate->SetData(1, pArray); @@ -312,7 +312,7 @@ void JS_ReleaseRuntime(IJS_Runtime* pJSRuntime, v8::Global<v8::Context>& v8Persi isolate->SetData(2,NULL); } -void JS_Initial() +void JS_Initial() { } void JS_Release() @@ -627,7 +627,7 @@ v8::Local<v8::Array> JS_NewArray(IJS_Runtime* pJSRuntime) } unsigned JS_PutArrayElement(IJS_Runtime* pJSRuntime, v8::Local<v8::Array> pArray,unsigned index,v8::Local<v8::Value> pValue,FXJSVALUETYPE eType) -{ +{ if(pArray.IsEmpty()) return 0; if (pArray->Set(pJSRuntime->GetCurrentContext(), index, pValue).IsNothing()) return 0; return 1; @@ -804,7 +804,7 @@ int _getDaylightSavingTA(double d) } double _Mod(double x, double y) -{ +{ double r = fmod(x, y); if (r < 0) r += y; return r; @@ -914,29 +914,29 @@ int _DateFromTime(double t) int month = _MonthFromTime(t); switch (month) { - case 0: + case 0: return day+1; - case 1: + case 1: return day-30; - case 2: + case 2: return day-58-leap; - case 3: + case 3: return day-89-leap; - case 4: + case 4: return day-119-leap; - case 5: + case 5: return day-150-leap; - case 6: + case 6: return day-180-leap; - case 7: + case 7: return day-211-leap; - case 8: + case 8: return day-242-leap; - case 9: + case 9: return day-272-leap; - case 10: + case 10: return day-303-leap; - case 11: + case 11: return day-333-leap; default: return 0; @@ -993,7 +993,7 @@ double JS_DateParse(const wchar_t* string) v8::HandleScope scope(pIsolate); v8::Local<v8::Context> context = pIsolate->GetCurrentContext(); - + //Use the built-in object method. v8::Local<v8::Value> v = context->Global()->Get(context, v8::String::NewFromUtf8(pIsolate, "Date", v8::NewStringType::kNormal).ToLocalChecked()).ToLocalChecked(); if(v->IsObject()) diff --git a/fpdfsdk/src/pdfwindow/PWL_Button.cpp b/fpdfsdk/src/pdfwindow/PWL_Button.cpp index f95469aa93..84962285c4 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Button.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Button.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" @@ -37,7 +37,7 @@ FX_BOOL CPWL_Button::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag) m_bMouseDown = TRUE; SetCapture(); - + return TRUE; } diff --git a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp index e050f3400e..84a8b3d186 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Caret.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Caret.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" @@ -48,7 +48,7 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse CFX_PathData path; path.SetPointCount(2); - + FX_FLOAT fCaretX = rcRect.left + m_fWidth * 0.5f; FX_FLOAT fCaretTop = rcRect.top; FX_FLOAT fCaretBottom = rcRect.bottom; @@ -84,7 +84,7 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptOffset) { if (IsVisible() && m_bFlash) - { + { CFX_ByteTextBuf sCaret; CPDF_Rect rcRect = GetCaretRect(); @@ -96,14 +96,14 @@ void CPWL_Caret::GetCaretApp(CFX_ByteTextBuf & sAppStream,const CPDF_Point & ptO sCaret << "q\n"; if (!rcClip.IsEmpty()) { - sCaret << rcClip.left << " " << rcClip.bottom + 2.5f << " " + sCaret << rcClip.left << " " << rcClip.bottom + 2.5f << " " << rcClip.right - rcClip.left << " " << rcClip.top - rcClip.bottom - 4.5f << " re W n\n"; } sCaret << m_fWidth << " w\n0 G\n"; sCaret << rcRect.left + m_fWidth/2 << " " << rcRect.bottom << " m\n"; - sCaret << rcRect.left + m_fWidth/2 << " " << rcRect.top << " l S\nQ\n"; + sCaret << rcRect.left + m_fWidth/2 << " " << rcRect.top << " l S\nQ\n"; - sAppStream << sCaret; + sAppStream << sCaret; } } @@ -118,7 +118,7 @@ void CPWL_Caret::TimerProc() { if (m_nDelay > 0) { - m_nDelay--; + m_nDelay--; } else { @@ -138,10 +138,10 @@ CPDF_Rect CPWL_Caret::GetCaretRect() const void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPDF_Point & ptFoot) { if (bVisible) - { + { if (IsVisible()) { - if (m_ptHead.x != ptHead.x || m_ptHead.y != ptHead.y || + if (m_ptHead.x != ptHead.x || m_ptHead.y != ptHead.y || m_ptFoot.x != ptFoot.x || m_ptFoot.y != ptFoot.y) { m_ptHead = ptHead; @@ -159,13 +159,13 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD EndTimer(); BeginTimer(PWL_CARET_FLASHINTERVAL); - + CPWL_Wnd::SetVisible(TRUE); m_bFlash = TRUE; - //Move(GetCaretRect(),FALSE,TRUE); + //Move(GetCaretRect(),FALSE,TRUE); Move(m_rcInvalid, FALSE, TRUE); - } + } } else { @@ -177,7 +177,7 @@ void CPWL_Caret::SetCaret(FX_BOOL bVisible, const CPDF_Point & ptHead, const CPD { EndTimer(); CPWL_Wnd::SetVisible(FALSE); - } + } } } @@ -187,8 +187,8 @@ void CPWL_Caret::InvalidateRect(CPDF_Rect * pRect) { CPDF_Rect rcRefresh = CPWL_Utils::InflateRect(*pRect,0.5f); rcRefresh.top += 1; - rcRefresh.bottom -= 1; - + rcRefresh.bottom -= 1; + CPWL_Wnd::InvalidateRect(&rcRefresh); } else diff --git a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp index f9ca5a5837..f946ecd16d 100644 --- a/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_ComboBox.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" @@ -29,15 +29,15 @@ FX_BOOL CPWL_CBListBox::OnLButtonUp(const CPDF_Point & point, FX_DWORD nFlag) if (m_bMouseDown) { ReleaseCapture(); - m_bMouseDown = FALSE; + m_bMouseDown = FALSE; if (ClientHitTest(point)) { if (CPWL_Wnd * pParent = GetParentWindow()) { - pParent->OnNotify(this,PNM_LBUTTONUP,0,PWL_MAKEDWORD(point.x,point.y)); + pParent->OnNotify(this,PNM_LBUTTONUP,0,PWL_MAKEDWORD(point.x,point.y)); } - + FX_BOOL bExit = FALSE; OnNotifySelChanged(FALSE,bExit, nFlag); if (bExit) return FALSE; @@ -61,7 +61,7 @@ FX_BOOL CPWL_CBListBox::OnKeyDownWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWO case FWL_VKEY_Left: case FWL_VKEY_End: case FWL_VKEY_Right: - break; + break; } switch (nChar) @@ -114,12 +114,12 @@ FX_BOOL CPWL_CBListBox::OnCharWithExit(FX_WORD nChar, FX_BOOL & bExit, FX_DWORD void CPWL_CBButton::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) { CPWL_Wnd::GetThisAppearanceStream(sAppStream); - + CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect(); - + if (IsVisible() && !rectWnd.IsEmpty()) { - CFX_ByteTextBuf sButton; + CFX_ByteTextBuf sButton; CPDF_Point ptCenter = GetCenterPoint(); @@ -139,7 +139,7 @@ void CPWL_CBButton::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) sButton << pt1.x << " " << pt1.y << " l f\n"; sAppStream << "q\n" << sButton << "Q\n"; - } + } } } @@ -148,7 +148,7 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p CPWL_Wnd::DrawThisAppearance(pDevice,pUser2Device); CPDF_Rect rectWnd = CPWL_Wnd::GetWindowRect(); - + if (IsVisible() && !rectWnd.IsEmpty()) { CPDF_Point ptCenter = GetCenterPoint(); @@ -170,8 +170,8 @@ void CPWL_CBButton::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* p path.SetPoint(2, pt3.x, pt3.y, FXPT_LINETO); path.SetPoint(3, pt1.x, pt1.y, FXPT_LINETO); - pDevice->DrawPath(&path, pUser2Device, NULL, - CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,GetTransparency()), + pDevice->DrawPath(&path, pUser2Device, NULL, + CPWL_Utils::PWLColorToFXColor(PWL_DEFAULT_BLACKCOLOR,GetTransparency()), 0, FXFILL_ALTERNATE); } } @@ -184,10 +184,10 @@ FX_BOOL CPWL_CBButton::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag) SetCapture(); if (CPWL_Wnd * pParent = GetParentWindow()) - { + { pParent->OnNotify(this,PNM_LBUTTONDOWN,0,PWL_MAKEDWORD(point.x,point.y)); } - + return TRUE; } @@ -334,11 +334,11 @@ void CPWL_ComboBox::CreateButton(const PWL_CREATEPARAM & cp) { if (!m_pButton) { - m_pButton = new CPWL_CBButton; + m_pButton = new CPWL_CBButton; PWL_CREATEPARAM bcp = cp; bcp.pParentWnd = this; - bcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND; + bcp.dwFlags = PWS_VISIBLE | PWS_CHILD | PWS_BORDER | PWS_BACKGROUND; bcp.sBackgroundColor = PWL_SCROLLBAR_BKCOLOR; bcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR; bcp.dwBorderWidth = 2; @@ -372,7 +372,7 @@ void CPWL_ComboBox::CreateListBox(const PWL_CREATEPARAM & cp) lcp.sBorderColor = PWL_DEFAULT_BLACKCOLOR; if (cp.sBackgroundColor.nColorType == COLORTYPE_TRANSPARENT) - lcp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR; + lcp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR; m_pList->Create(lcp); } @@ -391,7 +391,7 @@ void CPWL_ComboBox::RePosChildWnd() FX_FLOAT fOldWindowHeight = m_rcOldWindow.Height(); FX_FLOAT fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2; - + switch (m_nPopupWhere) { case 0: @@ -399,7 +399,7 @@ void CPWL_ComboBox::RePosChildWnd() if (rcButton.left < rclient.left) rcButton.left = rclient.left; - + rcButton.bottom = rcButton.top - fOldClientHeight; rcEdit.right = rcButton.left - 1.0f; @@ -420,7 +420,7 @@ void CPWL_ComboBox::RePosChildWnd() if (rcButton.left < rclient.left) rcButton.left = rclient.left; - + rcButton.top = rcButton.bottom + fOldClientHeight; rcEdit.right = rcButton.left - 1.0f; @@ -436,7 +436,7 @@ void CPWL_ComboBox::RePosChildWnd() rcList.bottom += fOldWindowHeight; break; - } + } if (m_pButton) m_pButton->Move(rcButton,TRUE,FALSE); @@ -446,17 +446,17 @@ void CPWL_ComboBox::RePosChildWnd() if (m_pList) { - m_pList->SetVisible(TRUE); + m_pList->SetVisible(TRUE); m_pList->Move(rcList,TRUE,FALSE); m_pList->ScrollToListItem(m_nSelectItem); } } else - { + { CPDF_Rect rcButton = rcClient; - rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH; - + rcButton.left = rcButton.right - PWL_COMBOBOX_BUTTON_WIDTH; + if (rcButton.left < rcClient.left) rcButton.left = rcClient.left; @@ -530,7 +530,7 @@ void CPWL_ComboBox::SetPopup(FX_BOOL bPopup) rcWindow.top += fPopupRet; break; } - + m_nPopupWhere = nWhere; Move(rcWindow, TRUE, TRUE); @@ -572,7 +572,7 @@ FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag)) { if (bExit) return FALSE; - SetSelectText(); + SetSelectText(); } } return TRUE; @@ -592,7 +592,7 @@ FX_BOOL CPWL_ComboBox::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) if (m_pList->OnKeyDownWithExit(nChar,bExit,nFlag)) { if (bExit) return FALSE; - SetSelectText(); + SetSelectText(); } } return TRUE; @@ -614,7 +614,7 @@ FX_BOOL CPWL_ComboBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) if (HasFlag(PCBS_ALLOWCUSTOMTEXT)) { - return m_pEdit->OnChar(nChar,nFlag); + return m_pEdit->OnChar(nChar,nFlag); } else { @@ -652,7 +652,7 @@ void CPWL_ComboBox::OnNotify(CPWL_Wnd* pWnd, FX_DWORD msg, intptr_t wParam, intp if (m_pEdit && m_pList) { if (pWnd == m_pList) - { + { SetSelectText(); SelectAll(); m_pEdit->SetFocus(); diff --git a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp index 856adcf686..627e7a85d9 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Edit.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Edit.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../../core/include/fxcrt/fx_safe_types.h" @@ -16,7 +16,7 @@ /* ---------------------------- CPWL_Edit ------------------------------ */ -CPWL_Edit::CPWL_Edit() : m_pFillerNotify(NULL), +CPWL_Edit::CPWL_Edit() : m_pFillerNotify(NULL), m_pSpellCheck(NULL), m_bFocus(FALSE) { @@ -42,9 +42,9 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText) CFX_WideString swText = csText; if (HasFlag(PES_RICH)) - { + { CFX_ByteString sValue = CFX_ByteString::FromUnicode(swText); - + if (CXML_Element * pXML = CXML_Element::Parse(sValue.c_str(), sValue.GetLength())) { int32_t nCount = pXML->CountChildren(); @@ -65,7 +65,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText) { swSection += pSubElement->GetContent(j); } - + if (bFirst)bFirst = FALSE; else swText += FWL_VKEY_Return; @@ -76,7 +76,7 @@ void CPWL_Edit::SetText(const FX_WCHAR* csText) delete pXML; } - } + } m_pEdit->SetText(swText.c_str()); } @@ -101,7 +101,7 @@ void CPWL_Edit::RePosChildWnd() CPDF_Rect CPWL_Edit::GetClientRect() const { CPDF_Rect rcClient = CPWL_Utils::DeflateRect(GetWindowRect(),(FX_FLOAT)(GetBorderWidth()+GetInnerBorderWidth())); - + if (CPWL_ScrollBar * pVSB = GetVScrollBar()) { if (pVSB->IsVisible()) @@ -230,7 +230,7 @@ void CPWL_Edit::OnCreated() } void CPWL_Edit::SetParamByFlag() -{ +{ if (HasFlag(PES_RIGHT)) { m_pEdit->SetAlignmentH(2, FALSE); @@ -302,40 +302,40 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) { case PBS_SOLID: { - sLine << "q\n" << GetBorderWidth() << " w\n" - << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"; + sLine << "q\n" << GetBorderWidth() << " w\n" + << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n"; for (int32_t i=1;i<nCharArray;i++) { sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " " << rcClient.bottom << " m\n" << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " " - << rcClient.top << " l S\n"; + << rcClient.top << " l S\n"; } - sLine << "Q\n"; + sLine << "Q\n"; } - break; + break; case PBS_DASH: { - sLine << "q\n" << GetBorderWidth() << " w\n" + sLine << "q\n" << GetBorderWidth() << " w\n" << CPWL_Utils::GetColorAppStream(GetBorderColor(),FALSE) << " 2 J 0 j\n" - << "[" << GetBorderDash().nDash << " " - << GetBorderDash().nGap << "] " + << "[" << GetBorderDash().nDash << " " + << GetBorderDash().nGap << "] " << GetBorderDash().nPhase << " d\n"; - for (int32_t i=1;i<nCharArray;i++) + for (int32_t i=1;i<nCharArray;i++) { sLine << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " " << rcClient.bottom << " m\n" << rcClient.left + ((rcClient.right - rcClient.left)/nCharArray)*i << " " - << rcClient.top << " l S\n"; + << rcClient.top << " l S\n"; } sLine << "Q\n"; } break; - } + } } sAppStream << sLine; @@ -358,22 +358,22 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) sText << CPWL_Utils::GetColorAppStream(PWL_DEFAULT_SELBACKCOLOR) << sEditSel ; wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelBefore); - CFX_ByteString sEditBefore = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset, - &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar()); + CFX_ByteString sEditBefore = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset, + &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar()); if (sEditBefore.GetLength() > 0) sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEditBefore << "ET\n"; wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelect); - CFX_ByteString sEditMid = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset, - &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar()); + CFX_ByteString sEditMid = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset, + &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar()); if (sEditMid.GetLength() > 0) sText << "BT\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_GRAY,1)) << sEditMid << "ET\n"; wrTemp = CPWL_Utils::OverlapWordRange(wrVisible,wrSelAfter); - CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset, - &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar()); + CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset, + &wrTemp, !HasFlag(PES_CHARARRAY), m_pEdit->GetPasswordChar()); if (sEditAfter.GetLength() > 0) sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEditAfter<< "ET\n"; @@ -389,7 +389,7 @@ void CPWL_Edit::GetThisAppearanceStream(CFX_ByteTextBuf & sAppStream) { CPDF_Rect rcClient = GetClientRect(); sAppStream << "q\n/Tx BMC\n"; - + if (!HasFlag(PES_TEXTOVERFLOW)) sAppStream << rcClient.left << " " << rcClient.bottom << " " << rcClient.right - rcClient.left << " " << rcClient.top - rcClient.bottom << " re W n\n"; @@ -432,10 +432,10 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser rcClient.top, FXPT_LINETO); } if (path.GetPointCount() > 0) - pDevice->DrawPath(&path, pUser2Device, &gsd,0, + pDevice->DrawPath(&path, pUser2Device, &gsd,0, CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE); } - break; + break; case PBS_DASH: { CFX_GraphStateData gsd; @@ -461,7 +461,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser CPWL_Utils::PWLColorToFXColor(GetBorderColor(),255), FXFILL_ALTERNATE); } break; - } + } } CPDF_Rect rcClip; @@ -495,7 +495,7 @@ FX_BOOL CPWL_Edit::OnLButtonDown(const CPDF_Point & point, FX_DWORD nFlag) if (m_bMouseDown) InvalidateRect(); - m_bMouseDown = TRUE; + m_bMouseDown = TRUE; SetCapture(); m_pEdit->OnMouseDown(point,IsSHIFTpressed(nFlag),IsCTRLpressed(nFlag)); @@ -530,7 +530,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) if (m_bMouseDown) return FALSE; CPWL_Wnd::OnRButtonUp(point, nFlag); - + if (!HasFlag(PES_TEXTOVERFLOW) && !ClientHitTest(point)) return TRUE; IFX_SystemHandler* pSH = GetSystemHandler(); @@ -556,13 +556,13 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) CFX_ByteString sLatin = CFX_ByteString::FromUnicode(swLatin); if (!m_pSpellCheck->CheckWord(sLatin)) - { + { m_pSpellCheck->SuggestWords(sLatin,sSuggestWords); int32_t nSuggest = sSuggestWords.GetSize(); for (int32_t nWord=0; nWord<nSuggest; nWord++) - { + { pSH->AppendMenuItem(hPopup, WM_PWLEDIT_SUGGEST+nWord, sSuggestWords[nWord].UTF8Decode()); } @@ -579,7 +579,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) if (HasFlag(PES_UNDO)) { - pSH->AppendMenuItem(hPopup, WM_PWLEDIT_UNDO, + pSH->AppendMenuItem(hPopup, WM_PWLEDIT_UNDO, pProvider ? pProvider->LoadPopupMenuString(0) : L"&Undo"); pSH->AppendMenuItem(hPopup, WM_PWLEDIT_REDO, pProvider ? pProvider->LoadPopupMenuString(1) : L"&Redo"); @@ -591,13 +591,13 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) pSH->EnableMenuItem(hPopup, WM_PWLEDIT_REDO, FALSE); } - pSH->AppendMenuItem(hPopup, WM_PWLEDIT_CUT, + pSH->AppendMenuItem(hPopup, WM_PWLEDIT_CUT, pProvider ? pProvider->LoadPopupMenuString(2) : L"Cu&t"); - pSH->AppendMenuItem(hPopup, WM_PWLEDIT_COPY, + pSH->AppendMenuItem(hPopup, WM_PWLEDIT_COPY, pProvider ? pProvider->LoadPopupMenuString(3) : L"&Copy"); - pSH->AppendMenuItem(hPopup, WM_PWLEDIT_PASTE, + pSH->AppendMenuItem(hPopup, WM_PWLEDIT_PASTE, pProvider ? pProvider->LoadPopupMenuString(4) : L"&Paste"); - pSH->AppendMenuItem(hPopup, WM_PWLEDIT_DELETE, + pSH->AppendMenuItem(hPopup, WM_PWLEDIT_DELETE, pProvider ? pProvider->LoadPopupMenuString(5) : L"&Delete"); CFX_WideString swText = pSH->GetClipboardText(GetAttachedHWnd()); @@ -615,7 +615,7 @@ FX_BOOL CPWL_Edit::OnRButtonUp(const CPDF_Point & point, FX_DWORD nFlag) { pSH->EnableMenuItem(hPopup, WM_PWLEDIT_CUT, FALSE); pSH->EnableMenuItem(hPopup, WM_PWLEDIT_DELETE, FALSE); - pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE); + pSH->EnableMenuItem(hPopup, WM_PWLEDIT_PASTE, FALSE); } if (HasFlag(PES_PASSWORD)) @@ -717,10 +717,10 @@ void CPWL_Edit::OnSetFocus() void CPWL_Edit::OnKillFocus() { ShowVScrollBar(FALSE); - + m_pEdit->SelectNone(); SetCaret(FALSE, CPDF_Point(0.0f,0.0f), CPDF_Point(0.0f,0.0f)); - + SetCharSet(0); if (!IsReadOnly()) @@ -775,7 +775,7 @@ CFX_ByteString CPWL_Edit::GetTextAppearanceStream(const CPDF_Point & ptOffset) c { CFX_ByteTextBuf sRet; CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit,ptOffset); - + if (sEdit.GetLength() > 0) { sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit << "ET\n"; @@ -838,7 +838,7 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray) { if (HasFlag(PES_CHARARRAY) && nCharArray > 0) { - m_pEdit->SetCharArray(nCharArray); + m_pEdit->SetCharArray(nCharArray); m_pEdit->SetTextOverflow(TRUE); if (HasFlag(PWS_AUTOFONTSIZE)) @@ -883,7 +883,7 @@ void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow) pScroll->SetVisible(TRUE); CPDF_Rect rcWindow = GetWindowRect(); m_rcOldWindow = rcWindow; - rcWindow.right += PWL_SCROLLBAR_WIDTH; + rcWindow.right += PWL_SCROLLBAR_WIDTH; Move(rcWindow, TRUE, TRUE); } } @@ -893,7 +893,7 @@ void CPWL_Edit::ShowVScrollBar(FX_BOOL bShow) { pScroll->SetVisible(FALSE); Move(m_rcOldWindow, TRUE, TRUE); - } + } } } } @@ -936,7 +936,7 @@ FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) if (nSelStart == nSelEnd) nSelEnd = nSelStart + 1; m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), FWL_VKEY_Delete, strChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag); - if (!bRC) return FALSE; + if (!bRC) return FALSE; if (bExit) return FALSE; } } @@ -961,7 +961,7 @@ FX_BOOL CPWL_Edit::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) } /** -*In case of implementation swallow the OnKeyDown event. +*In case of implementation swallow the OnKeyDown event. *If the event is swallowed, implementation may do other unexpected things, which is not the control means to do. */ FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag) @@ -971,7 +971,7 @@ FX_BOOL CPWL_Edit::IsProceedtoOnChar(FX_WORD nKeyCode, FX_DWORD nFlag) FX_BOOL bAlt = IsALTpressed(nFlag); if(bCtrl && !bAlt) { - //hot keys for edit control. + //hot keys for edit control. switch(nKeyCode) { case 'C': @@ -1033,7 +1033,7 @@ FX_BOOL CPWL_Edit::OnChar(FX_WORD nChar, FX_DWORD nFlag) swChange += nChar; break; } - + CFX_WideString strChangeEx; m_pFillerNotify->OnBeforeKeyStroke(TRUE, GetAttachedData(), nKeyCode, swChange, strChangeEx, nSelStart, nSelEnd, TRUE, bRC, bExit, nFlag); } @@ -1225,10 +1225,10 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOO if (IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator()) { - CPVT_Word wordinfo; - CPVT_WordPlace wpStart(place),wpEnd(place); - pIterator->SetAt(place); - + CPVT_Word wordinfo; + CPVT_WordPlace wpStart(place),wpEnd(place); + pIterator->SetAt(place); + if (bLatin) { while (pIterator->NextWord()) @@ -1238,7 +1238,7 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOO wpEnd = pIterator->GetAt(); continue; } - else + else break; }; } @@ -1251,7 +1251,7 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOO wpEnd = pIterator->GetAt(); continue; } - else + else break; }; } @@ -1263,7 +1263,7 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOO do { if (pIterator->GetWord(wordinfo) && FX_EDIT_ISLATINWORD(wordinfo.Word)) - { + { continue; } else @@ -1279,7 +1279,7 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOO do { if (pIterator->GetWord(wordinfo) && PWL_ISARABICWORD(wordinfo.Word)) - { + { continue; } else @@ -1292,7 +1292,7 @@ CPVT_WordRange CPWL_Edit::GetSameWordsRange(const CPVT_WordPlace & place, FX_BOO } range.Set(wpStart,wpEnd); - } + } return range; } @@ -1301,13 +1301,13 @@ void CPWL_Edit::AjustArabicWords(const CPVT_WordRange& wr) { } -void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, +void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, const CPDF_Point& ptOffset, CFX_ArrayTemplate<CPDF_TextObject*>& ObjArray) { IFX_Edit::GeneratePageObjects(pPageObjects, m_pEdit, ptOffset, NULL, CPWL_Utils::PWLColorToFXColor(GetTextColor(),GetTransparency()), ObjArray); } -void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, +void CPWL_Edit::GeneratePageObjects(CPDF_PageObjects* pPageObjects, const CPDF_Point& ptOffset) { CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; diff --git a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp index f266da001c..71174dfb0a 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Icon.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Icon.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" @@ -97,7 +97,7 @@ CFX_ByteString CPWL_Image::GetImageAlias() { if (m_pPDFStream) { - if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict()) + if (CPDF_Dictionary * pDict = m_pPDFStream->GetDict()) { return pDict->GetString("Name"); } @@ -187,7 +187,7 @@ void CPWL_Icon::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale) { fHScale = 1.0f; fVScale = 1.0f; - + if (m_pPDFStream) { FX_FLOAT fImageWidth,fImageHeight; diff --git a/fpdfsdk/src/pdfwindow/PWL_Label.cpp b/fpdfsdk/src/pdfwindow/PWL_Label.cpp index 35af3ee91b..e1780c69a8 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Label.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Label.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" @@ -64,7 +64,7 @@ FX_FLOAT CPWL_Label::GetFontSize() const } void CPWL_Label::SetParamByFlag() -{ +{ if (HasFlag(PES_LEFT)) { m_pEdit->SetAlignmentH(0); @@ -158,7 +158,7 @@ CFX_ByteString CPWL_Label::GetTextAppearanceStream(const CPDF_Point & ptOffset) { CFX_ByteTextBuf sRet; CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit,ptOffset); - + if (sEdit.GetLength() > 0) { sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit << "ET\n"; diff --git a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp index 4864cabc11..76b2bd333a 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Signature.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Signature.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" @@ -42,7 +42,7 @@ void CPWL_Signature_Image::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Ma FX_FLOAT x, y; pUser2Device->Transform(rcClient.left, rcClient.top, x, y); - pDevice->StretchDIBits(m_pImage, (int32_t)x, (int32_t)y, + pDevice->StretchDIBits(m_pImage, (int32_t)x, (int32_t)y, (int32_t)rcClient.Width(), (int32_t)rcClient.Height()); } } @@ -61,12 +61,12 @@ void CPWL_Signature_Image::GetScale(FX_FLOAT & fHScale,FX_FLOAT & fVScale) CPDF_Rect rcClient = GetClientRect(); fHScale = rcClient.Width() / fImageW; - fVScale = rcClient.Height() / fImageH; + fVScale = rcClient.Height() / fImageH; } /* --------------------------------- CPWL_Signature --------------------------------- */ -CPWL_Signature::CPWL_Signature() : +CPWL_Signature::CPWL_Signature() : m_pText(NULL), m_pDescription(NULL), m_pImage(NULL), @@ -136,7 +136,7 @@ void CPWL_Signature::RePosChildWnd() CPDF_Rect rcDescription = rcClient; FX_BOOL bTextVisible = m_bTextExist && m_pText->GetText().GetLength() > 0; - + if ((bTextVisible || m_bImageExist) && m_pDescription->GetText().GetLength() > 0) { @@ -202,11 +202,11 @@ void CPWL_Signature::DrawThisAppearance(CFX_RenderDevice* pDevice, CPDF_Matrix* path.SetPoint(1, rcClient.right, (rcClient.top + rcClient.bottom) * 0.5f, FXPT_LINETO); CFX_GraphStateData gsd; - gsd.SetDashCount(2); + gsd.SetDashCount(2); gsd.m_DashArray[0] = 6.0f; gsd.m_DashArray[1] = 6.0f; - gsd.m_DashPhase = 0; - + gsd.m_DashPhase = 0; + gsd.m_LineWidth = 10.0f; pDevice->DrawPath(&path, pUser2Device, &gsd, 0, ArgbEncode(255,255,0,0), FXFILL_ALTERNATE); */ diff --git a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp index 6eade26b50..90fa8f880d 100644 --- a/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_SpecialButton.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" diff --git a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp index b22846931f..b9ba7661af 100644 --- a/fpdfsdk/src/pdfwindow/PWL_Utils.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_Utils.cpp @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "../../include/pdfwindow/PDFWindow.h" @@ -145,45 +145,45 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox) const int32_t num = 8; - CPWL_Point pts[num*3] = + CPWL_Point pts[num*3] = { //1 - CPWL_Point(0.28f, 0.52f), + CPWL_Point(0.28f, 0.52f), CPWL_Point(0.27f, 0.48f), CPWL_Point(0.29f, 0.40f), //2 - CPWL_Point(0.30f, 0.33f), + CPWL_Point(0.30f, 0.33f), CPWL_Point(0.31f, 0.29f), CPWL_Point(0.31f, 0.28f), //3 - CPWL_Point(0.39f, 0.28f), + CPWL_Point(0.39f, 0.28f), CPWL_Point(0.49f, 0.29f), CPWL_Point(0.77f, 0.67f), //4 - CPWL_Point(0.76f, 0.68f), + CPWL_Point(0.76f, 0.68f), CPWL_Point(0.78f, 0.69f), CPWL_Point(0.76f, 0.75f), //5 - CPWL_Point(0.76f, 0.75f), + CPWL_Point(0.76f, 0.75f), CPWL_Point(0.73f, 0.80f), CPWL_Point(0.68f, 0.75f), //6 - CPWL_Point(0.68f, 0.74f), + CPWL_Point(0.68f, 0.74f), CPWL_Point(0.68f, 0.74f), CPWL_Point(0.44f, 0.47f), //7 - CPWL_Point(0.43f, 0.47f), + CPWL_Point(0.43f, 0.47f), CPWL_Point(0.40f, 0.47f), CPWL_Point(0.41f, 0.58f), //8 - CPWL_Point(0.40f, 0.60f), + CPWL_Point(0.40f, 0.60f), CPWL_Point(0.28f, 0.66f), CPWL_Point(0.30f, 0.56f) }; @@ -211,7 +211,7 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CPDF_Rect & crBBox) FX_FLOAT px2 = pts[n2].x - pts[nNext].x; FX_FLOAT py2 = pts[n2].y - pts[nNext].y; - csAP << pts[nCur].x + px1 * PWL_BEZIER << " " << pts[nCur].y + py1 * PWL_BEZIER << " " + csAP << pts[nCur].x + px1 * PWL_BEZIER << " " << pts[nCur].y + py1 * PWL_BEZIER << " " << pts[nNext].x + px2 * PWL_BEZIER << " " << pts[nNext].y + py2 * PWL_BEZIER << " " << pts[nNext].x << " " << pts[nNext].y << " c\n"; } @@ -236,28 +236,28 @@ CFX_ByteString CPWL_Utils::GetAP_Circle(const CPDF_Rect & crBBox) FX_FLOAT px = pt2.x - pt1.x; FX_FLOAT py = pt2.y - pt1.y; - csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " + csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " << pt2.x - px * PWL_BEZIER << " " << pt2.y << " " << pt2.x << " " << pt2.y << " c\n"; px = pt3.x - pt2.x; py = pt2.y - pt3.y; - csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " + csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " << pt3.x << " " << pt3.y + py * PWL_BEZIER << " " << pt3.x << " " << pt3.y << " c\n"; px = pt3.x - pt4.x; py = pt3.y - pt4.y; - csAP << pt3.x << " " << pt3.y - py * PWL_BEZIER << " " + csAP << pt3.x << " " << pt3.y - py * PWL_BEZIER << " " << pt4.x + px * PWL_BEZIER << " " << pt4.y << " " << pt4.x << " " << pt4.y << " c\n"; px = pt4.x - pt1.x; py = pt1.y - pt4.y; - csAP << pt4.x - px * PWL_BEZIER << " " << pt4.y << " " + csAP << pt4.x - px * PWL_BEZIER << " " << pt4.y << " " << pt1.x << " " << pt1.y - py * PWL_BEZIER << " " << pt1.x << " " << pt1.y << " c\n"; @@ -287,7 +287,7 @@ CFX_ByteString CPWL_Utils::GetAP_Diamond(const CPDF_Rect & crBBox) CPDF_Point pt2(crBBox.left + fWidth / 2,crBBox.top); CPDF_Point pt3(crBBox.right,crBBox.bottom + fHeight / 2); CPDF_Point pt4(crBBox.left + fWidth / 2,crBBox.bottom); - + csAP << pt1.x << " " << pt1.y << " m\n"; csAP << pt2.x << " " << pt2.y << " l\n"; csAP << pt3.x << " " << pt3.y << " l\n"; @@ -316,7 +316,7 @@ CFX_ByteString CPWL_Utils::GetAP_Star(const CPDF_Rect & crBBox) FX_FLOAT fRadius = (crBBox.top - crBBox.bottom)/(1+(FX_FLOAT)cos(PWL_PI/5.0f)); CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(crBBox.top + crBBox.bottom) / 2.0f); - + FX_FLOAT px[5],py[5]; FX_FLOAT fAngel = PWL_PI/10.0f; @@ -355,7 +355,7 @@ CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CPDF_Rect & crBBox,FX_FLOAT fR FX_FLOAT px,py; - csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << " " << cos(fRotate) << " " + csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << " " << cos(fRotate) << " " << crBBox.left + fWidth / 2 << " " << crBBox.bottom + fHeight / 2 << " cm\n"; @@ -364,14 +364,14 @@ CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CPDF_Rect & crBBox,FX_FLOAT fR px = pt2.x - pt1.x; py = pt2.y - pt1.y; - csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " + csAP << pt1.x << " " << pt1.y + py * PWL_BEZIER << " " << pt2.x - px * PWL_BEZIER << " " << pt2.y << " " << pt2.x << " " << pt2.y << " c\n"; px = pt3.x - pt2.x; py = pt2.y - pt3.y; - csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " + csAP << pt2.x + px * PWL_BEZIER << " " << pt2.y << " " << pt3.x << " " << pt3.y + py * PWL_BEZIER << " " << pt3.x << " " << pt3.y << " c\n"; @@ -425,9 +425,9 @@ CFX_ByteString CPWL_Utils::GetRectFillAppStream(const CPDF_Rect & rect,const CPW { sAppStream << "q\n" << sColor; sAppStream << rect.left << " " << rect.bottom << " " - << rect.right - rect.left << " " << rect.top - rect.bottom << " re f\nQ\n"; + << rect.right - rect.left << " " << rect.top - rect.bottom << " re f\nQ\n"; } - + return sAppStream.GetByteString(); } @@ -438,9 +438,9 @@ CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CPDF_Rect & rect,const C CFX_ByteString sColor = GetColorAppStream(color,TRUE); if (sColor.GetLength() > 0) { - sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n"; + sAppStream << "q\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << "f\nQ\n"; } - + return sAppStream.GetByteString(); } @@ -457,13 +457,13 @@ CPDF_Rect CPWL_Utils::GetCenterSquare(const CPDF_Rect & rect) return CPDF_Rect(fCenterX - fRadius,fCenterY - fRadius,fCenterX + fRadius,fCenterY + fRadius); } -CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange, +CFX_ByteString CPWL_Utils::GetEditAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange, FX_BOOL bContinuous, FX_WORD SubWord) { return IFX_Edit::GetEditAppearanceStream(pEdit,ptOffset,pRange,bContinuous,SubWord); } -CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, +CFX_ByteString CPWL_Utils::GetEditSelAppStream(IFX_Edit* pEdit, const CPDF_Point & ptOffset, const CPVT_WordRange * pRange) { return IFX_Edit::GetSelectAppearanceStream(pEdit,ptOffset,pRange); @@ -496,7 +496,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter FX_FLOAT fStartX = 0.0f; FX_FLOAT fEndX = 0.0f; FX_FLOAT fY = 0.0f; - FX_FLOAT fStep = 0.0f; + FX_FLOAT fStep = 0.0f; FX_BOOL bBreak = FALSE; @@ -508,7 +508,7 @@ static CFX_ByteString GetWordSpellCheckAppearanceStream(IFX_Edit_Iterator* pIter { CPVT_WordPlace place = pIterator->GetAt(); - CPVT_Line line; + CPVT_Line line; if (pIterator->GetLine(line)) { fY = line.ptLine.y; @@ -577,7 +577,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); - if (pRange && place.WordCmp(pRange->EndPos) > 0) break; + if (pRange && place.WordCmp(pRange->EndPos) > 0) break; CPVT_Word word; if (pIterator->GetWord(word)) @@ -587,7 +587,7 @@ CFX_ByteString CPWL_Utils::GetSpellCheckAppStream(IFX_Edit* pEdit, IPWL_SpellChe if (!bLatinWord) { wpWordStart = place; - bLatinWord = TRUE; + bLatinWord = TRUE; } sWord += (char)word.Word; @@ -671,12 +671,12 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, IFX_Edit_FontMap * pFontMap, CPDF_Stream * pIconStream, CPDF_IconFit & IconFit, - const CFX_WideString & sLabel, + const CFX_WideString & sLabel, const CPWL_Color & crText, FX_FLOAT fFontSize, int32_t nLayOut) { - const FX_FLOAT fAutoFontScale = 1.0f / 3.0f; + const FX_FLOAT fAutoFontScale = 1.0f / 3.0f; if (IFX_Edit * pEdit = IFX_Edit::NewEdit()) { @@ -731,14 +731,14 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, fHeight = rcLabelContent.Height(); if (rcBBox.bottom + fHeight > rcBBox.top) - { - rcIcon = CPDF_Rect(0,0,0,0); + { + rcIcon = CPDF_Rect(0,0,0,0); rcLabel = rcBBox; } else { rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcBBox.bottom + fHeight); - rcIcon = CPDF_Rect(rcBBox.left,rcLabel.top,rcBBox.right,rcBBox.top); + rcIcon = CPDF_Rect(rcBBox.left,rcLabel.top,rcBBox.right,rcBBox.top); } } } @@ -764,14 +764,14 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, fHeight = rcLabelContent.Height(); if (rcBBox.bottom + fHeight > rcBBox.top) - { - rcIcon = CPDF_Rect(0,0,0,0); + { + rcIcon = CPDF_Rect(0,0,0,0); rcLabel = rcBBox; } else { rcLabel = CPDF_Rect(rcBBox.left,rcBBox.top - fHeight,rcBBox.right,rcBBox.top); - rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcLabel.bottom); + rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.right,rcLabel.bottom); } } } @@ -793,9 +793,9 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top); if (rcLabelContent.Width() < fWidth * fAutoFontScale) - { + { } - else + else { if (rcLabelContent.Width() < fWidth) { @@ -821,7 +821,7 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, else { rcLabel = CPDF_Rect(rcBBox.right - fWidth,rcBBox.bottom,rcBBox.right,rcBBox.top); - rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top); + rcIcon = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcLabel.left,rcBBox.top); } } } @@ -843,9 +843,9 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top); if (rcLabelContent.Width() < fWidth * fAutoFontScale) - { + { } - else + else { if (rcLabelContent.Width() < fWidth) { @@ -871,8 +871,8 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CPDF_Rect & rcBBox, else { rcLabel = CPDF_Rect(rcBBox.left,rcBBox.bottom,rcBBox.left + fWidth,rcBBox.top); - rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top); - } + rcIcon = CPDF_Rect(rcLabel.right,rcBBox.bottom,rcBBox.right,rcBBox.top); + } } } else @@ -928,16 +928,16 @@ CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color & color,const FX_B CFX_ByteTextBuf sColorStream; switch (color.nColorType) - { + { case COLORTYPE_RGB: - sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " + sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " << (bFillOrStroke ? "rg" : "RG") << "\n"; break; case COLORTYPE_GRAY: sColorStream << color.fColor1 << " " << (bFillOrStroke ? "g" : "G") << "\n"; break; case COLORTYPE_CMYK: - sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " << color.fColor4 << " " + sColorStream << color.fColor1 << " " << color.fColor2 << " " << color.fColor3 << " " << color.fColor4 << " " << (bFillOrStroke ? "k" : "K") << "\n"; break; } @@ -972,7 +972,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f { sAppStream << sColor; sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n"; - sAppStream << fLeft + fWidth << " " << fBottom + fWidth << " " + sAppStream << fLeft + fWidth << " " << fBottom + fWidth << " " << fRight - fLeft - fWidth * 2 << " " << fTop - fBottom - fWidth * 2 << " re\n"; sAppStream << "f*\n"; } @@ -1021,8 +1021,8 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f { sAppStream << sColor; sAppStream << fLeft << " " << fBottom << " " << fRight - fLeft << " " << fTop - fBottom << " re\n"; - sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " " - << fRight - fLeft - fHalfWidth * 2 << " " << fTop - fBottom - fHalfWidth * 2 << " re f*\n"; + sAppStream << fLeft + fHalfWidth << " " << fBottom + fHalfWidth << " " + << fRight - fLeft - fHalfWidth * 2 << " " << fTop - fBottom - fHalfWidth * 2 << " re f*\n"; } break; case PBS_UNDERLINED: @@ -1036,7 +1036,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CPDF_Rect & rect, FX_FLOAT f } break; } - + sAppStream << "Q\n"; } @@ -1050,7 +1050,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F CFX_ByteTextBuf sAppStream; CFX_ByteString sColor; - + @@ -1068,7 +1068,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F sColor = CPWL_Utils::GetColorAppStream(color,FALSE); if (sColor.GetLength() > 0) { - sAppStream << "q\n" << fWidth << " w\n" << sColor + sAppStream << "q\n" << fWidth << " w\n" << sColor << CPWL_Utils::GetAP_Circle(CPWL_Utils::DeflateRect(rect,fWidth / 2.0f)) << " S\nQ\n"; } @@ -1079,11 +1079,11 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F sColor = CPWL_Utils::GetColorAppStream(color,FALSE); if (sColor.GetLength() > 0) { - sAppStream << "q\n" << fWidth << " w\n" - << "[" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n" + sAppStream << "q\n" << fWidth << " w\n" + << "[" << dash.nDash << " " << dash.nGap << "] " << dash.nPhase << " d\n" << sColor << CPWL_Utils::GetAP_Circle(CPWL_Utils::DeflateRect(rect,fWidth / 2.0f)) << " S\nQ\n"; - } + } } break; case PBS_BEVELED: @@ -1096,7 +1096,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F sAppStream << "q\n" << fHalfWidth << " w\n" << sColor << CPWL_Utils::GetAP_Circle(rect) << " S\nQ\n"; - } + } sColor = CPWL_Utils::GetColorAppStream(crLeftTop,FALSE); if (sColor.GetLength() > 0) @@ -1104,7 +1104,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F sAppStream << "q\n" << fHalfWidth << " w\n" << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f) << " S\nQ\n"; - } + } sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE); if (sColor.GetLength() > 0) @@ -1112,7 +1112,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F sAppStream << "q\n" << fHalfWidth << " w\n" << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f) << " S\nQ\n"; - } + } } break; case PBS_INSET: @@ -1133,7 +1133,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F sAppStream << "q\n" << fHalfWidth << " w\n" << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI/4.0f) << " S\nQ\n"; - } + } sColor = CPWL_Utils::GetColorAppStream(crRightBottom,FALSE); if (sColor.GetLength() > 0) @@ -1141,11 +1141,11 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(const CPDF_Rect & rect, FX_F sAppStream << "q\n" << fHalfWidth << " w\n" << sColor << CPWL_Utils::GetAP_HalfCircle(CPWL_Utils::DeflateRect(rect,fHalfWidth * 0.75f),PWL_PI*5/4.0f) << " S\nQ\n"; - } + } } break; } - + sAppStream << "Q\n"; } @@ -1173,7 +1173,7 @@ CPWL_Color CPWL_Utils::SubstractColor(const CPWL_Color & sColor,FX_FLOAT fColorS sRet.fColor3 = PWL_MAX(sColor.fColor3 - fColorSub,0.0f); sRet.fColor4 = PWL_MAX(sColor.fColor4 - fColorSub,0.0f); break; - } + } return sRet; } @@ -1200,7 +1200,7 @@ CPWL_Color CPWL_Utils::DevideColor(const CPWL_Color & sColor,FX_FLOAT fColorDevi sRet.fColor3 /= fColorDevide; sRet.fColor4 /= fColorDevide; break; - } + } return sRet; } @@ -1262,7 +1262,7 @@ CFX_ByteString CPWL_Utils::GetCheckBoxAppStream(const CPDF_Rect & rcBBox, case PCS_CROSS: return GetAppStream_Cross(rcCenter,crText); case PCS_DIAMOND: - return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText); + return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText); case PCS_SQUARE: return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText); case PCS_STAR: @@ -1285,7 +1285,7 @@ CFX_ByteString CPWL_Utils::GetRadioButtonAppStream(const CPDF_Rect & rcBBox, case PCS_CROSS: return GetAppStream_Cross(rcCenter,crText); case PCS_DIAMOND: - return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText); + return GetAppStream_Diamond(ScaleRect(rcCenter,2.0f/3.0f),crText); case PCS_SQUARE: return GetAppStream_Square(ScaleRect(rcCenter,2.0f/3.0f),crText); case PCS_STAR: @@ -1300,12 +1300,12 @@ CFX_ByteString CPWL_Utils::GetDropButtonAppStream(const CPDF_Rect & rcBBox) if (!rcBBox.IsEmpty()) { sAppStream << "q\n" << CPWL_Utils::GetColorAppStream(CPWL_Color(COLORTYPE_RGB,220.0f/255.0f,220.0f/255.0f,220.0f/255.0f),TRUE); - sAppStream << rcBBox.left << " " << rcBBox.bottom << " " + sAppStream << rcBBox.left << " " << rcBBox.bottom << " " << rcBBox.right - rcBBox.left << " " << rcBBox.top - rcBBox.bottom << " re f\n"; sAppStream << "Q\n"; - sAppStream << "q\n" << - CPWL_Utils::GetBorderAppStream(rcBBox,2,CPWL_Color(COLORTYPE_GRAY,0),CPWL_Color(COLORTYPE_GRAY,1),CPWL_Color(COLORTYPE_GRAY,0.5),PBS_BEVELED,CPWL_Dash(3,0,0)) + sAppStream << "q\n" << + CPWL_Utils::GetBorderAppStream(rcBBox,2,CPWL_Color(COLORTYPE_GRAY,0),CPWL_Color(COLORTYPE_GRAY,1),CPWL_Color(COLORTYPE_GRAY,0.5),PBS_BEVELED,CPWL_Dash(3,0,0)) << "Q\n"; CPDF_Point ptCenter = CPDF_Point((rcBBox.left + rcBBox.right)/2,(rcBBox.top + rcBBox.bottom)/2); @@ -1422,7 +1422,7 @@ void CPWL_Utils::DrawFillRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Devi const FX_COLORREF & color) { CFX_PathData path; - CPDF_Rect rcTemp(rect); + CPDF_Rect rcTemp(rect); path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top); pDevice->DrawPath(&path, pUser2Device, NULL, color, 0, FXFILL_WINDING); } @@ -1444,9 +1444,9 @@ void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2De const FX_COLORREF & color, FX_FLOAT fWidth) { CFX_PathData path; - CPDF_Rect rcTemp(rect); + CPDF_Rect rcTemp(rect); path.AppendRect(rcTemp.left,rcTemp.bottom,rcTemp.right,rcTemp.top); - + CFX_GraphStateData gsd; gsd.m_LineWidth = fWidth; @@ -1484,7 +1484,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device fStepGray = (nEndGray - nStartGray) / rect.Height(); for (FX_FLOAT fy=rect.bottom+0.5f; fy<=rect.top-0.5f; fy+=1.0f) - { + { int32_t nGray = nStartGray + (int32_t)(fStepGray * (fy-rect.bottom)); CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(rect.left, fy), CPDF_Point(rect.right, fy), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); @@ -1496,7 +1496,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device fStepGray = (nEndGray - nStartGray) / rect.Width(); for (FX_FLOAT fx=rect.left+0.5f; fx<=rect.right-0.5f; fx+=1.0f) - { + { int32_t nGray = nStartGray + (int32_t)(fStepGray * (fx-rect.left)); CPWL_Utils::DrawStrokeLine(pDevice, pUser2Device, CPDF_Point(fx, rect.bottom), CPDF_Point(fx, rect.top), ArgbEncode(nTransparancy, nGray, nGray, nGray), 1.5f); @@ -1541,17 +1541,17 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device path.SetPoint(4, fLeft + fWidth / 2.0f, fBottom + fWidth / 2.0f, FXPT_LINETO); CFX_GraphStateData gsd; - gsd.SetDashCount(2); + gsd.SetDashCount(2); gsd.m_DashArray[0] = 3.0f; gsd.m_DashArray[1] = 3.0f; - gsd.m_DashPhase = 0; - + gsd.m_DashPhase = 0; + gsd.m_LineWidth = fWidth; - pDevice->DrawPath(&path, pUser2Device, &gsd, 0, PWLColorToFXColor(color,nTransparancy), FXFILL_WINDING); - } + pDevice->DrawPath(&path, pUser2Device, &gsd, 0, PWLColorToFXColor(color,nTransparancy), FXFILL_WINDING); + } break; case PBS_BEVELED: - case PBS_INSET: + case PBS_INSET: { CFX_GraphStateData gsd; gsd.m_LineWidth = fHalfWidth; @@ -1597,7 +1597,7 @@ void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device path.SetPointCount(2); path.SetPoint(0, fLeft, fBottom + fWidth / 2, FXPT_MOVETO); path.SetPoint(1, fRight, fBottom + fWidth / 2, FXPT_LINETO); - + CFX_GraphStateData gsd; gsd.m_LineWidth = fWidth; @@ -1636,7 +1636,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV FX_FLOAT fStartX = 0.0f; FX_FLOAT fEndX = 0.0f; FX_FLOAT fY = 0.0f; - FX_FLOAT fStep = 0.0f; + FX_FLOAT fStep = 0.0f; FX_BOOL bBreak = FALSE; @@ -1648,7 +1648,7 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV { CPVT_WordPlace place = pIterator->GetAt(); - CPVT_Line line; + CPVT_Line line; if (pIterator->GetLine(line)) { fY = line.ptLine.y; @@ -1693,8 +1693,8 @@ static void AddSpellCheckObj(CFX_PathData & PathData, IFX_Edit* pEdit, const CPV } } -void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, - const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, +void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IFX_Edit* pEdit, + const CPDF_Rect& rcClip, const CPDF_Point& ptOffset, const CPVT_WordRange* pRange, IPWL_SpellCheck * pSpellCheck) { const FX_COLORREF crSpell = ArgbEncode(255,255,0,0); @@ -1729,14 +1729,14 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse else pIterator->SetAt(0); - CPVT_WordPlace oldplace; + CPVT_WordPlace oldplace; while (pIterator->NextWord()) { CPVT_WordPlace place = pIterator->GetAt(); - if (pRange && place.WordCmp(pRange->EndPos) > 0) break; + if (pRange && place.WordCmp(pRange->EndPos) > 0) break; - CPVT_Word word; + CPVT_Word word; if (pIterator->GetWord(word)) { if (FX_EDIT_ISLATINWORD(word.Word)) @@ -1744,7 +1744,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse if (!bLatinWord) { wpWordStart = place; - bLatinWord = TRUE; + bLatinWord = TRUE; } sLatinWord += (char)word.Word; @@ -1757,7 +1757,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse { if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord)) { - AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); + AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); pIterator->SetAt(place); } } @@ -1766,7 +1766,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse sLatinWord.Empty(); } - + oldplace = place; } else @@ -1777,7 +1777,7 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse { if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord)) { - AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); + AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); pIterator->SetAt(place); } } @@ -1788,16 +1788,16 @@ void CPWL_Utils::DrawEditSpellCheck(CFX_RenderDevice* pDevice, CPDF_Matrix* pUse } } - if (!sLatinWord.IsEmpty()) + if (!sLatinWord.IsEmpty()) { if (pSpellCheck && !pSpellCheck->CheckWord(sLatinWord)) { - AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); + AddSpellCheckObj(pathSpell,pEdit,CPVT_WordRange(wpWordStart,oldplace)); } } } } - + CFX_GraphStateData gsd; gsd.m_LineWidth = 0; if (pathSpell.GetPointCount() > 0) @@ -1848,7 +1848,7 @@ CPWL_Color CPWL_Utils::GetReverseColor(const CPWL_Color& color) return crRet; } -CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill, +CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect, const CPWL_Color& crFill, const CPWL_Color& crStroke) { CFX_ByteString sAppStream = CPWL_Utils::GetColorAppStream(crStroke, FALSE); @@ -1860,7 +1860,7 @@ CFX_ByteString CPWL_Utils::GetIconAppStream(int32_t nType, const CPDF_Rect& rect switch (nType) { case PWL_ICONTYPE_CHECKMARK: - GetGraphics_Checkmark(sPath, path, rect, PWLPT_STREAM); + GetGraphics_Checkmark(sPath, path, rect, PWLPT_STREAM); break; case PWL_ICONTYPE_CIRCLE: GetGraphics_Circle(sPath, path, rect, PWLPT_STREAM); @@ -2005,7 +2005,7 @@ void CPWL_Utils::DrawIconAppStream(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser return; } - pDevice->DrawPath(&path, pUser2Device, &gsd, + pDevice->DrawPath(&path, pUser2Device, &gsd, PWLColorToFXColor(crFill,nTransparancy), PWLColorToFXColor(crStroke,nTransparancy), FXFILL_ALTERNATE); } @@ -2014,10 +2014,10 @@ void CPWL_Utils::GetGraphics_Checkmark(CFX_ByteString& sPathData, CFX_PathData& FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f, crBBox.bottom + fHeight * 2 / 5.0f),PWLPT_MOVETO), - CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZIER*(fWidth / 7.0f - fWidth / 15.0f), + CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 15.0f + PWL_BEZIER*(fWidth / 7.0f - fWidth / 15.0f), crBBox.bottom + fHeight * 2 / 5.0f + PWL_BEZIER*(fHeight * 2 / 7.0f - fHeight * 2 / 5.0f)), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth / 4.5f + PWL_BEZIER*(fWidth / 5.0f - fWidth / 4.5f), crBBox.bottom + fHeight / 16.0f + PWL_BEZIER*(fHeight / 5.0f - fHeight / 16.0f)), PWLPT_BEZIERTO), @@ -2097,7 +2097,7 @@ void CPWL_Utils::GetGraphics_Comment(CFX_ByteString& sPathData, CFX_PathData& pa FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/15.0f, crBBox.top - fHeight/6.0f + PWL_BEZIER*(fHeight/6.0f - fHeight/10.0f)), PWLPT_BEZIERTO), @@ -2144,7 +2144,7 @@ void CPWL_Utils::GetGraphics_Cross(CFX_ByteString& sPathData, CFX_PathData& path //FX_FLOAT fcatercorner = (FX_FLOAT)sqrt(fWidth*fWidth + fHeight*fHeight); CPWL_Point center_point(crBBox.left + fWidth/2, crBBox.bottom + fHeight/2); - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(center_point.x, center_point.y + fHeight/10.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(center_point.x + fWidth*0.3f, center_point.y + fHeight/10.0f + fWidth*0.3f), PWLPT_LINETO), @@ -2172,7 +2172,7 @@ void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*(fHeight/60.0f - fHeight/2.0f)), PWLPT_BEZIERTO), @@ -2183,14 +2183,14 @@ void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + PWL_BEZIER*fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO), - CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO), + CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f - PWL_BEZIER*fWidth*29/60.0f, crBBox.top - fHeight/60.0f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f + PWL_BEZIER*fHeight*29/60.0f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60.0f, crBBox.bottom + fHeight/2.0f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO), - CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO), + CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f + PWL_BEZIER*fWidth*0.23f, crBBox.bottom + fHeight*0.87f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.23f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO), @@ -2216,14 +2216,14 @@ void CPWL_Utils::GetGraphics_Help(CFX_ByteString& sPathData, CFX_PathData& path, CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.5f - PWL_BEZIER*fWidth*0.13f, crBBox.bottom + fHeight*0.77f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f + PWL_BEZIER*fHeight*0.13f), PWLPT_BEZIERTO), - CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO), + CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.37f, crBBox.top - fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f - fWidth*0.1f*0.6f), PWLPT_BEZIERTO), - CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO), + CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.27f, crBBox.top - fHeight*0.36f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.56f, crBBox.bottom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f - PWL_BEZIER*fWidth*0.095f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO), - CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO), + CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.505f + PWL_BEZIER*fWidth*0.065f, crBBox.bottom + fHeight*0.185f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f + PWL_BEZIER*fHeight*0.055f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth*0.44f, crBBox.bottom + fHeight*0.13f), PWLPT_BEZIERTO), @@ -2246,7 +2246,7 @@ void CPWL_Utils::GetGraphics_InsertText(CFX_ByteString& sPathData, CFX_PathData& FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10, crBBox.bottom + fHeight/10), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2, crBBox.top - fHeight*2/15), PWLPT_LINETO), @@ -2272,7 +2272,7 @@ void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, CicleCenter.x = crBBox.left + fWidth*0.15f; CicleCenter.y = k*(CicleCenter.x - crBBox.right) + crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f, -fWidth/30.0f/k + tail.y), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(tail.x + fWidth/30.0f - fWidth*0.18f, -k*fWidth*0.18f - fWidth/30/k + tail.y), PWLPT_LINETO), @@ -2302,7 +2302,7 @@ void CPWL_Utils::GetGraphics_Key(CFX_ByteString& sPathData, CFX_PathData& path, CPWL_PathData(CPWL_Point(tail.x - fWidth/30 - fWidth*0.45f - fWidth*0.18f, fWidth*0.05f/k - k*fWidth*0.45f + fWidth/30/k + tail.y - fHeight*0.05f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f - fWidth*0.45f, -k*fWidth*0.45f + fWidth/30.0f/k + tail.y), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(tail.x - fWidth/30.0f, fWidth/30.0f/k + tail.y), PWLPT_LINETO), - CPWL_PathData(CPWL_Point(tail.x + fWidth/30, -fWidth/30/k + tail.y), PWLPT_LINETO), + CPWL_PathData(CPWL_Point(tail.x + fWidth/30, -fWidth/30/k + tail.y), PWLPT_LINETO), CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f, k*fWidth*0.08f + CicleCenter.y), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.08f + fWidth*0.1f, -fWidth*0.1f/k + k*fWidth*0.08f + CicleCenter.y), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(CicleCenter.x + fWidth*0.22f + fWidth*0.1f, k*fWidth*0.22f + CicleCenter.y - fWidth*0.1f/k), PWLPT_BEZIERTO), @@ -2323,7 +2323,7 @@ void CPWL_Utils::GetGraphics_NewParagraph(CFX_ByteString& sPathData, CFX_PathDat FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/20.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/10.0f, crBBox.top - fHeight/2.0f), PWLPT_LINETO), @@ -2366,7 +2366,7 @@ void CPWL_Utils::GetGraphics_TextNote(CFX_ByteString& sPathData, CFX_PathData& p FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.right - fWidth*3/10.0f, crBBox.bottom + fHeight/15.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*7/10.0f, crBBox.bottom + fHeight*4/15.0f), PWLPT_LINETO), @@ -2425,7 +2425,7 @@ void CPWL_Utils::GetGraphics_RightArrow(CFX_ByteString& sPathData, CFX_PathData& FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.right - fWidth/15.0f, crBBox.top - fHeight/2.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f + fWidth/8.0f, crBBox.bottom + fHeight/5.0f), PWLPT_LINETO), @@ -2450,7 +2450,7 @@ void CPWL_Utils::GetGraphics_RightPointer(CFX_ByteString& sPathData, CFX_PathDat FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30.0f, crBBox.top - fHeight/2.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/30.0f, crBBox.bottom + fHeight/6.0f), PWLPT_LINETO), @@ -2471,7 +2471,7 @@ void CPWL_Utils::GetGraphics_Star(CFX_ByteString& sPathData, CFX_PathData& path, fLongRadius = fLongRadius * 0.7f; FX_FLOAT fShortRadius = fLongRadius * 0.55f; CPDF_Point ptCenter = CPDF_Point((crBBox.left + crBBox.right) / 2.0f,(crBBox.top + crBBox.bottom) / 2.0f); - + FX_FLOAT px1[5], py1[5]; FX_FLOAT px2[5], py2[5]; @@ -2518,7 +2518,7 @@ void CPWL_Utils::GetGraphics_UpArrow(CFX_ByteString& sPathData, CFX_PathData& pa FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth/2.0f, crBBox.top - fHeight/15.0f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth/10.0f, crBBox.top - fWidth*3/5.0f), PWLPT_LINETO), @@ -2547,7 +2547,7 @@ void CPWL_Utils::GetGraphics_UpLeftArrow(CFX_ByteString& sPathData, CFX_PathData tail.x = crBBox.left + fWidth*4/5.0f; tail.y = k*(tail.x - crBBox.right) + rightdown.y; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth/20.0f, k*(crBBox.left + fWidth/20.0f - rightdown.x) + rightdown.y), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(fHeight*17/60.0f/k + tail.x + fWidth/10.0f + fWidth/5.0f, @@ -2573,7 +2573,7 @@ void CPWL_Utils::GetGraphics_Graph(CFX_ByteString& sPathData, CFX_PathData& path FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.05f, crBBox.top - fWidth*0.15f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.15f), PWLPT_LINETO), @@ -2611,7 +2611,7 @@ void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.top - fHeight*0.25f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60, crBBox.bottom + fHeight*0.25f), PWLPT_LINETO), @@ -2623,7 +2623,7 @@ void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30, crBBox.top - fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.top - fHeight*0.33f + fHeight/15*0.5f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.top - fHeight*0.33f), PWLPT_BEZIERTO), - + CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.bottom + fHeight*0.2f), PWLPT_LINETO), CPWL_PathData(CPWL_Point(crBBox.right - fWidth/30 - fWidth*0.12f, crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_BEZIERTO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth/60 + fWidth*0.12f, crBBox.bottom + fHeight*0.2f - (fWidth*57/60.0f - fWidth*0.24f)*0.25f), PWLPT_BEZIERTO), @@ -2658,7 +2658,7 @@ void CPWL_Utils::GetGraphics_Paperclip(CFX_ByteString& sPathData, CFX_PathData& if(type == PWLPT_STREAM) sPathData = GetAppStreamFromArray(PathArray, 33); else - GetPathDataFromArray(path, PathArray, 33); + GetPathDataFromArray(path, PathArray, 33); } void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& path, const CPDF_Rect& crBBox, const PWL_PATH_TYPE type) @@ -2666,7 +2666,7 @@ void CPWL_Utils::GetGraphics_Attachment(CFX_ByteString& sPathData, CFX_PathData& FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.25f, crBBox.top - fHeight*0.1f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.23f), PWLPT_LINETO), @@ -2710,7 +2710,7 @@ void CPWL_Utils::GetGraphics_Tag(CFX_ByteString& sPathData, CFX_PathData& path, FX_FLOAT fWidth = crBBox.right - crBBox.left; FX_FLOAT fHeight = crBBox.top - crBBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.4f, crBBox.top - fHeight*0.1f), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crBBox.left + fWidth*0.1f, crBBox.top - fHeight*0.5f), PWLPT_LINETO), @@ -2746,7 +2746,7 @@ void CPWL_Utils::GetGraphics_Foxit(CFX_ByteString& sPathData, CFX_PathData& path FX_FLOAT fWidth = crInBox.right - crInBox.left; FX_FLOAT fHeight = crInBox.top - crInBox.bottom; - CPWL_PathData PathArray[] = + CPWL_PathData PathArray[] = { CPWL_PathData(CPWL_Point(crInBox.left, crInBox.top), PWLPT_MOVETO), CPWL_PathData(CPWL_Point(crInBox.left + fWidth*0.45f, crInBox.top), PWLPT_LINETO), diff --git a/fpdfsdk/src/resource.h b/fpdfsdk/src/resource.h index 1ba20957a6..1729807951 100644 --- a/fpdfsdk/src/resource.h +++ b/fpdfsdk/src/resource.h @@ -1,7 +1,7 @@ // Copyright 2014 PDFium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. - + // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #ifndef FPDFSDK_SRC_RESOURCE_H_ |