From f4bb580add3824196dc49cd7de2f7d051019ede8 Mon Sep 17 00:00:00 2001 From: weili Date: Tue, 14 Jun 2016 17:21:14 -0700 Subject: Make code compile with clang_use_chrome_plugin (part II) This change contains files in core directory which were not covered in part I. 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; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2060913003 --- core/fpdfdoc/doc_basic.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'core/fpdfdoc/doc_basic.cpp') diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp index 72f2985cef..3fe182ae78 100644 --- a/core/fpdfdoc/doc_basic.cpp +++ b/core/fpdfdoc/doc_basic.cpp @@ -31,6 +31,7 @@ int CPDF_Dest::GetPageIndex(CPDF_Document* pDoc) { return 0; return pDoc->GetPageIndex(pPage->GetObjNum()); } + uint32_t CPDF_Dest::GetPageObjNum() { CPDF_Array* pArray = ToArray(m_pObj); if (!pArray) @@ -68,6 +69,7 @@ FX_FLOAT CPDF_Dest::GetParam(int index) { CPDF_Array* pArray = ToArray(m_pObj); return pArray ? pArray->GetNumberAt(2 + index) : 0; } + CFX_ByteString CPDF_Dest::GetRemoteName() { return m_pObj ? m_pObj->GetString() : CFX_ByteString(); } @@ -224,6 +226,7 @@ int CPDF_NameTree::GetIndex(const CFX_ByteString& csName) const { } return nIndex; } + CPDF_Object* CPDF_NameTree::LookupValue(int nIndex, CFX_ByteString& csName) const { if (!m_pRoot) { @@ -232,6 +235,7 @@ CPDF_Object* CPDF_NameTree::LookupValue(int nIndex, size_t nCurIndex = 0; return SearchNameNode(m_pRoot, nIndex, nCurIndex, csName, nullptr); } + CPDF_Object* CPDF_NameTree::LookupValue(const CFX_ByteString& csName) const { if (!m_pRoot) { return nullptr; @@ -239,6 +243,7 @@ CPDF_Object* CPDF_NameTree::LookupValue(const CFX_ByteString& csName) const { size_t nIndex = 0; return SearchNameNode(m_pRoot, csName, nIndex, nullptr); } + CPDF_Array* CPDF_NameTree::LookupNamedDest(CPDF_Document* pDoc, const CFX_ByteString& sName) { CPDF_Object* pValue = LookupValue(sName); @@ -442,6 +447,7 @@ static CFX_WideString _MakeLetters(int num) { } return wsLetters; } + static CFX_WideString _GetLabelNumPortion(int num, const CFX_ByteString& bsStyle) { CFX_WideString wsNumPortion; @@ -463,6 +469,40 @@ static CFX_WideString _GetLabelNumPortion(int num, } return wsNumPortion; } + +IPDF_FormNotify::~IPDF_FormNotify() {} + +int IPDF_FormNotify::BeforeValueChange(CPDF_FormField* pField, + const CFX_WideString& csValue) { + return 0; +} + +void IPDF_FormNotify::AfterValueChange(CPDF_FormField* pField) {} + +int IPDF_FormNotify::BeforeSelectionChange(CPDF_FormField* pField, + const CFX_WideString& csValue) { + return 0; +} + +void IPDF_FormNotify::AfterSelectionChange(CPDF_FormField* pField) {} + +void IPDF_FormNotify::AfterCheckedStatusChange(CPDF_FormField* pField) {} + +int IPDF_FormNotify::BeforeFormReset(CPDF_InterForm* pForm) { + return 0; +} + +void IPDF_FormNotify::AfterFormReset(CPDF_InterForm* pForm) {} + +int IPDF_FormNotify::BeforeFormImportData(CPDF_InterForm* pForm) { + return 0; +} + +void IPDF_FormNotify::AfterFormImportData(CPDF_InterForm* pForm) {} + +CPDF_PageLabel::CPDF_PageLabel(CPDF_Document* pDocument) + : m_pDocument(pDocument) {} + CFX_WideString CPDF_PageLabel::GetLabel(int nPage) const { CFX_WideString wsLabel; if (!m_pDocument) { -- cgit v1.2.3