diff options
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/include/formfiller/FFL_ComboBox.h | 3 | ||||
-rw-r--r-- | fpdfsdk/include/formfiller/FFL_IFormFiller.h | 13 | ||||
-rw-r--r-- | fpdfsdk/include/formfiller/FFL_TextField.h | 3 | ||||
-rw-r--r-- | fpdfsdk/include/fsdk_baseannot.h | 11 | ||||
-rw-r--r-- | fpdfsdk/include/fsdk_baseform.h | 19 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfsave.cpp | 25 | ||||
-rw-r--r-- | fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp | 27 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_annothandler.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_baseannot.cpp | 6 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_baseform.cpp | 16 | ||||
-rw-r--r-- | fpdfsdk/src/javascript/JS_Runtime.h | 9 |
11 files changed, 50 insertions, 85 deletions
diff --git a/fpdfsdk/include/formfiller/FFL_ComboBox.h b/fpdfsdk/include/formfiller/FFL_ComboBox.h index c943511c97..f1c8b2d99b 100644 --- a/fpdfsdk/include/formfiller/FFL_ComboBox.h +++ b/fpdfsdk/include/formfiller/FFL_ComboBox.h @@ -55,7 +55,8 @@ class CFFL_ComboBox : public CFFL_FormFiller, // IPWL_Edit_Notify: void OnAddUndo(CPWL_Edit* pEdit) override; - virtual FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView); + // CFFL_FormFiller: + FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override; private: CFX_WideString GetSelectExportText(); diff --git a/fpdfsdk/include/formfiller/FFL_IFormFiller.h b/fpdfsdk/include/formfiller/FFL_IFormFiller.h index 723aa2bcb4..79a8964626 100644 --- a/fpdfsdk/include/formfiller/FFL_IFormFiller.h +++ b/fpdfsdk/include/formfiller/FFL_IFormFiller.h @@ -79,13 +79,6 @@ class CFFL_IFormFiller : public IPWL_Filler_Notify { virtual FX_BOOL OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); virtual FX_BOOL OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag); - virtual void OnPopupPreOpen(void* pPrivateData, - FX_BOOL& bExit, - FX_DWORD nFlag); - virtual void OnPopupPostOpen(void* pPrivateData, - FX_BOOL& bExit, - FX_DWORD nFlag); - CFFL_FormFiller* GetFormFiller(CPDFSDK_Annot* pAnnot, FX_BOOL bRegister); void RemoveFormFiller(CPDFSDK_Annot* pAnnot); @@ -158,6 +151,12 @@ class CFFL_IFormFiller : public IPWL_Filler_Notify { FX_BOOL& bRC, FX_BOOL& bExit, FX_DWORD nFlag) override; + void OnPopupPreOpen(void* pPrivateData, + FX_BOOL& bExit, + FX_DWORD nFlag) override; + void OnPopupPostOpen(void* pPrivateData, + FX_BOOL& bExit, + FX_DWORD nFlag) override; void UnRegisterFormFiller(CPDFSDK_Annot* pAnnot); void SetFocusAnnotTab(CPDFSDK_Annot* pWidget, diff --git a/fpdfsdk/include/formfiller/FFL_TextField.h b/fpdfsdk/include/formfiller/FFL_TextField.h index e8013cdba1..49a0f24e16 100644 --- a/fpdfsdk/include/formfiller/FFL_TextField.h +++ b/fpdfsdk/include/formfiller/FFL_TextField.h @@ -56,7 +56,8 @@ class CFFL_TextField : public CFFL_FormFiller, // IPWL_Edit_Notify: void OnAddUndo(CPWL_Edit* pEdit) override; - virtual FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView); + // CFFL_FormFiller: + FX_BOOL IsFieldFull(CPDFSDK_PageView* pPageView) override; private: CBA_FontMap* m_pFontMap; diff --git a/fpdfsdk/include/fsdk_baseannot.h b/fpdfsdk/include/fsdk_baseannot.h index 706e96435e..58abfff49e 100644 --- a/fpdfsdk/include/fsdk_baseannot.h +++ b/fpdfsdk/include/fsdk_baseannot.h @@ -71,7 +71,6 @@ class CPDFSDK_Annot { CPDFSDK_Annot(CPDFSDK_PageView* pPageView); virtual ~CPDFSDK_Annot(){}; - public: virtual FX_BOOL IsXFAField() { return FALSE; } virtual FX_FLOAT GetMinWidth() const; @@ -79,8 +78,8 @@ class CPDFSDK_Annot { // define layout order to 5. virtual int GetLayoutOrder() const { return 5; } - virtual CPDF_Annot* GetPDFAnnot() { return NULL; } - virtual IXFA_Widget* GetXFAWidget() { return NULL; } + virtual CPDF_Annot* GetPDFAnnot() const { return nullptr; } + virtual IXFA_Widget* GetXFAWidget() const { return nullptr; } virtual CFX_ByteString GetType() const { return ""; } virtual CFX_ByteString GetSubType() const { return ""; } @@ -92,12 +91,11 @@ class CPDFSDK_Annot { CPDF_Matrix* pUser2Device, CPDF_RenderOptions* pOptions) {} - public: CPDF_Page* GetPDFPage(); CPDFXFA_Page* GetPDFXFAPage(); void SetPage(CPDFSDK_PageView* pPageView) { m_pPageView = pPageView; } - CPDFSDK_PageView* GetPageView() { return m_pPageView; } + CPDFSDK_PageView* GetPageView() const { return m_pPageView; } // Tab Order int GetTabOrder(); @@ -128,7 +126,7 @@ class CPDFSDK_BAAnnot : public CPDFSDK_Annot { virtual void SetRect(const CPDF_Rect& rect); virtual CPDF_Rect GetRect() const; - virtual CPDF_Annot* GetPDFAnnot(); + virtual CPDF_Annot* GetPDFAnnot() const; virtual void Annot_OnDraw(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, @@ -205,7 +203,6 @@ class CPDFSDK_BAAnnot : public CPDFSDK_Annot { void ClearCachedAP(); - virtual void ResetAppearance(); void WriteAppearance(const CFX_ByteString& sAPType, const CPDF_Rect& rcBBox, const CPDF_Matrix& matrix, diff --git a/fpdfsdk/include/fsdk_baseform.h b/fpdfsdk/include/fsdk_baseform.h index bcba4c831b..a6716c5748 100644 --- a/fpdfsdk/include/fsdk_baseform.h +++ b/fpdfsdk/include/fsdk_baseform.h @@ -193,9 +193,8 @@ class CPDFSDK_Widget : public CPDFSDK_BAAnnot { void DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device, CPDF_Annot::AppearanceMode mode, - const CPDF_RenderOptions* pOptions); + const CPDF_RenderOptions* pOptions) override; - public: FX_BOOL HitTest(FX_FLOAT pageX, FX_FLOAT pageY); CPDFSDK_InterForm* m_pInterForm; @@ -212,18 +211,14 @@ class CPDFSDK_XFAWidget : public CPDFSDK_Annot { CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm); - virtual ~CPDFSDK_XFAWidget() {} - - public: - virtual FX_BOOL IsXFAField(); - virtual IXFA_Widget* GetXFAWidget() { return m_hXFAWidget; } + ~CPDFSDK_XFAWidget() override {} - virtual CFX_ByteString GetType() const; - virtual CFX_ByteString GetSubType() const { return ""; } + FX_BOOL IsXFAField() override; + IXFA_Widget* GetXFAWidget() const override { return m_hXFAWidget; } + CFX_ByteString GetType() const override; + CFX_ByteString GetSubType() const override { return ""; } + CFX_FloatRect GetRect() const override; - virtual CFX_FloatRect GetRect(); - - public: CPDFSDK_InterForm* GetInterForm() { return m_pInterForm; } private: diff --git a/fpdfsdk/src/fpdfsave.cpp b/fpdfsdk/src/fpdfsave.cpp index 2cfbb81cd0..3a85ba750c 100644 --- a/fpdfsdk/src/fpdfsave.cpp +++ b/fpdfsdk/src/fpdfsave.cpp @@ -135,7 +135,6 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, // 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) { @@ -185,14 +184,10 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, } else { CPDF_Stream* pData = new CPDF_Stream(NULL, 0, NULL); pData->InitStream(pDsfileWrite, pDataDict); - FX_DWORD AppStreamobjnum = pPDFDocument->AddIndirectObject(pData); - CPDF_Reference* pRef = - (CPDF_Reference*)pPDFDocument->GetIndirectObject(AppStreamobjnum); - { - iLast = pArray->GetCount() - 2; - pArray->InsertAt(iLast, CPDF_String::Create("datasets")); - pArray->InsertAt(iLast + 1, pData, pPDFDocument); - } + pPDFDocument->AddIndirectObject(pData); + iLast = pArray->GetCount() - 2; + pArray->InsertAt(iLast, CPDF_String::Create("datasets")); + pArray->InsertAt(iLast + 1, pData, pPDFDocument); } fileList.Add(pDsfileWrite); } @@ -216,14 +211,10 @@ FX_BOOL _SaveXFADocumentData(CPDFXFA_Document* pDocument, } else { CPDF_Stream* pData = new CPDF_Stream(NULL, 0, NULL); pData->InitStream(pfileWrite, pDataDict); - FX_DWORD AppStreamobjnum = pPDFDocument->AddIndirectObject(pData); - CPDF_Reference* pRef = - (CPDF_Reference*)pPDFDocument->GetIndirectObject(AppStreamobjnum); - { - iLast = pArray->GetCount() - 2; - pArray->InsertAt(iLast, CPDF_String::Create("form")); - pArray->InsertAt(iLast + 1, pData, pPDFDocument); - } + pPDFDocument->AddIndirectObject(pData); + iLast = pArray->GetCount() - 2; + pArray->InsertAt(iLast, CPDF_String::Create("form")); + pArray->InsertAt(iLast + 1, pData, pPDFDocument); } fileList.Add(pfileWrite); } diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp index 3197f2a5e7..b965387cc3 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_page.cpp @@ -64,26 +64,23 @@ FX_BOOL CPDFXFA_Page::LoadXFAPageView() { if (!m_pDocument)
return FALSE;
IXFA_Doc* pXFADoc = m_pDocument->GetXFADoc();
- if (pXFADoc) {
- IXFA_DocView* pXFADocView = m_pDocument->GetXFADocView();
- if (!pXFADocView)
- return FALSE;
-
- IXFA_PageView* pPageView = pXFADocView->GetPageView(m_iPageIndex);
- if (!pPageView)
- return FALSE;
+ if (!pXFADoc)
+ return FALSE;
- if (m_pXFAPageView)
- if (m_pXFAPageView == pPageView)
- return TRUE;
+ IXFA_DocView* pXFADocView = m_pDocument->GetXFADocView();
+ if (!pXFADocView)
+ return FALSE;
- m_pXFAPageView = pPageView;
- int iStatus = m_pXFAPageView->LoadPageView(NULL);
+ IXFA_PageView* pPageView = pXFADocView->GetPageView(m_iPageIndex);
+ if (!pPageView)
+ return FALSE;
+ if (m_pXFAPageView == pPageView)
return TRUE;
- }
- return FALSE;
+ m_pXFAPageView = pPageView;
+ (void)m_pXFAPageView->LoadPageView(nullptr);
+ return TRUE;
}
FX_BOOL CPDFXFA_Page::LoadPage() {
diff --git a/fpdfsdk/src/fsdk_annothandler.cpp b/fpdfsdk/src/fsdk_annothandler.cpp index f17ebf1270..e0c49411a9 100644 --- a/fpdfsdk/src/fsdk_annothandler.cpp +++ b/fpdfsdk/src/fsdk_annothandler.cpp @@ -782,9 +782,6 @@ void CPDFSDK_XFAAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, CFX_Matrix mt; mt = *(CFX_Matrix*)pUser2Device; - IXFA_Widget* hWidget = pAnnot->GetXFAWidget(); - ASSERT(hWidget != NULL); - FX_BOOL bIsHighlight = FALSE; if (pSDKDoc->GetFocusAnnot() != pAnnot) bIsHighlight = TRUE; diff --git a/fpdfsdk/src/fsdk_baseannot.cpp b/fpdfsdk/src/fsdk_baseannot.cpp index 126c7a7fdb..1c96936f03 100644 --- a/fpdfsdk/src/fsdk_baseannot.cpp +++ b/fpdfsdk/src/fsdk_baseannot.cpp @@ -518,7 +518,7 @@ CPDFSDK_BAAnnot::~CPDFSDK_BAAnnot() { m_pAnnot = NULL; } -CPDF_Annot* CPDFSDK_BAAnnot::GetPDFAnnot() { +CPDF_Annot* CPDFSDK_BAAnnot::GetPDFAnnot() const { return m_pAnnot; } @@ -571,10 +571,6 @@ CFX_ByteString CPDFSDK_BAAnnot::GetSubType() const { return ""; } -void CPDFSDK_BAAnnot::ResetAppearance() { - ASSERT(FALSE); -} - void CPDFSDK_BAAnnot::DrawAppearance(CFX_RenderDevice* pDevice, const CPDF_Matrix* pUser2Device, CPDF_Annot::AppearanceMode mode, diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index e486310ba2..202f77f571 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -2112,9 +2112,8 @@ FX_BOOL CPDFSDK_Widget::HitTest(FX_FLOAT pageX, FX_FLOAT pageY) { CPDFSDK_XFAWidget::CPDFSDK_XFAWidget(IXFA_Widget* pAnnot, CPDFSDK_PageView* pPageView, CPDFSDK_InterForm* pInterForm) - : CPDFSDK_Annot(pPageView), - m_hXFAWidget(pAnnot), - m_pInterForm(pInterForm) {} + : CPDFSDK_Annot(pPageView), m_pInterForm(pInterForm), m_hXFAWidget(pAnnot) { +} FX_BOOL CPDFSDK_XFAWidget::IsXFAField() { return TRUE; @@ -2124,21 +2123,12 @@ CFX_ByteString CPDFSDK_XFAWidget::GetType() const { return FSDK_XFAWIDGET_TYPENAME; } -CFX_FloatRect CPDFSDK_XFAWidget::GetRect() { +CFX_FloatRect CPDFSDK_XFAWidget::GetRect() const { CPDFSDK_PageView* pPageView = GetPageView(); - ASSERT(pPageView != NULL); - CPDFSDK_Document* pDocument = pPageView->GetSDKDocument(); - ASSERT(pDocument != NULL); - CPDFXFA_Document* pDoc = pDocument->GetDocument(); - ASSERT(pDoc != NULL); - IXFA_DocView* pDocView = pDoc->GetXFADocView(); - ASSERT(pDocView != NULL); - IXFA_WidgetHandler* pWidgetHandler = pDocView->GetWidgetHandler(); - ASSERT(pWidgetHandler != NULL); CFX_RectF rcBBox; pWidgetHandler->GetRect(GetXFAWidget(), rcBBox); diff --git a/fpdfsdk/src/javascript/JS_Runtime.h b/fpdfsdk/src/javascript/JS_Runtime.h index 4772823d7f..01a8827561 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.h +++ b/fpdfsdk/src/javascript/JS_Runtime.h @@ -57,10 +57,11 @@ class CJS_Runtime : public IJS_Runtime { v8::Isolate* GetIsolate() const { return m_isolate; } v8::Local<v8::Context> NewJSContext(); - virtual FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue); - virtual FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, - FXJSE_HVALUE hValue); + // IJS_Runtime: + FX_BOOL GetHValueByName(const CFX_ByteStringC& utf8Name, + FXJSE_HVALUE hValue) override; + FX_BOOL SetHValueByName(const CFX_ByteStringC& utf8Name, + FXJSE_HVALUE hValue) override; void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); |