From 625ad667d0c0c17d5bc11d505f04861d90b45078 Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 15 Jun 2016 11:21:33 -0700 Subject: Make code compile with clang_use_chrome_plugin (part IV) This change mainly contains files in fpdfsdk/ directory. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups plus removing an unused file and splitting cxfa_eventparam out from fxfa.h BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2062313002 --- fpdfsdk/fsdk_baseannot.cpp | 67 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 15 deletions(-) (limited to 'fpdfsdk/fsdk_baseannot.cpp') diff --git a/fpdfsdk/fsdk_baseannot.cpp b/fpdfsdk/fsdk_baseannot.cpp index 21d85500bd..9b214738d8 100644 --- a/fpdfsdk/fsdk_baseannot.cpp +++ b/fpdfsdk/fsdk_baseannot.cpp @@ -430,10 +430,60 @@ CPDFSDK_DateTime& CPDFSDK_DateTime::AddSeconds(int seconds) { CPDFSDK_Annot::CPDFSDK_Annot(CPDFSDK_PageView* pPageView) : m_pPageView(pPageView), m_bSelected(FALSE), m_nTabOrder(-1) {} +CPDFSDK_Annot::~CPDFSDK_Annot() {} + +#ifdef PDF_ENABLE_XFA + +FX_BOOL CPDFSDK_Annot::IsXFAField() { + return FALSE; +} + +CXFA_FFWidget* CPDFSDK_Annot::GetXFAWidget() const { + return nullptr; +} + +#endif // PDF_ENABLE_XFA + +FX_FLOAT CPDFSDK_Annot::GetMinWidth() const { + return kMinWidth; +} + +FX_FLOAT CPDFSDK_Annot::GetMinHeight() const { + return kMinHeight; +} + +int CPDFSDK_Annot::GetLayoutOrder() const { + return 5; +} + +CPDF_Annot* CPDFSDK_Annot::GetPDFAnnot() const { + return nullptr; +} + +CFX_ByteString CPDFSDK_Annot::GetType() const { + return ""; +} + +CFX_ByteString CPDFSDK_Annot::GetSubType() const { + return ""; +} + +void CPDFSDK_Annot::SetRect(const CFX_FloatRect& rect) {} + +CFX_FloatRect CPDFSDK_Annot::GetRect() const { + return CFX_FloatRect(); +} + +void CPDFSDK_Annot::Annot_OnDraw(CFX_RenderDevice* pDevice, + CFX_Matrix* pUser2Device, + CPDF_RenderOptions* pOptions) {} + CPDFSDK_BAAnnot::CPDFSDK_BAAnnot(CPDF_Annot* pAnnot, CPDFSDK_PageView* pPageView) : CPDFSDK_Annot(pPageView), m_pAnnot(pAnnot) {} +CPDFSDK_BAAnnot::~CPDFSDK_BAAnnot() {} + CPDF_Annot* CPDFSDK_BAAnnot::GetPDFAnnot() const { return m_pAnnot; } @@ -446,7 +496,6 @@ void CPDFSDK_Annot::SetSelected(FX_BOOL bSelected) { m_bSelected = bSelected; } -// Tab Order int CPDFSDK_Annot::GetTabOrder() { return m_nTabOrder; } @@ -776,14 +825,6 @@ void CPDFSDK_BAAnnot::WriteAppearance(const CFX_ByteString& sAPType, FALSE); } -FX_FLOAT CPDFSDK_Annot::GetMinWidth() const { - return kMinWidth; -} - -FX_FLOAT CPDFSDK_Annot::GetMinHeight() const { - return kMinHeight; -} - FX_BOOL CPDFSDK_BAAnnot::CreateFormFiller() { return TRUE; } @@ -838,12 +879,6 @@ CPDF_Action CPDFSDK_BAAnnot::GetAAction(CPDF_AAction::AActionType eAAT) { return CPDF_Action(); } -#ifdef PDF_ENABLE_XFA -FX_BOOL CPDFSDK_BAAnnot::IsXFAField() { - return FALSE; -} -#endif // PDF_ENABLE_XFA - void CPDFSDK_BAAnnot::Annot_OnDraw(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device, CPDF_RenderOptions* pOptions) { @@ -865,7 +900,9 @@ CPDF_Page* CPDFSDK_Annot::GetPDFPage() { } #ifdef PDF_ENABLE_XFA + CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; } + #endif // PDF_ENABLE_XFA -- cgit v1.2.3