summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-09 21:15:17 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-09 21:15:17 +0000
commit8153561249b45ba45f6e393cc081eb1101f3f7a6 (patch)
tree142c4cd8a56aa73b2874d0f6d95777ff4a9eb4c0 /core/fpdfdoc
parent8c62883bdb9d695069a483133ddc96d5b85ec472 (diff)
downloadpdfium-8153561249b45ba45f6e393cc081eb1101f3f7a6.tar.xz
Do IWYU for cpdf_dictionary.h.
Move some method implementations out of headers in the process. Change-Id: I8701e360d4addd9aec39fe887d932209985d2443 Reviewed-on: https://pdfium-review.googlesource.com/c/43608 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/cpdf_aaction.cpp4
-rw-r--r--core/fpdfdoc/cpdf_action.cpp13
-rw-r--r--core/fpdfdoc/cpdf_action.h8
-rw-r--r--core/fpdfdoc/cpdf_annot.cpp1
-rw-r--r--core/fpdfdoc/cpdf_annotlist.cpp1
-rw-r--r--core/fpdfdoc/cpdf_bookmark.cpp1
-rw-r--r--core/fpdfdoc/cpdf_bookmarktree.cpp3
-rw-r--r--core/fpdfdoc/cpdf_docjsactions.cpp1
-rw-r--r--core/fpdfdoc/cpdf_formcontrol.cpp7
-rw-r--r--core/fpdfdoc/cpdf_formcontrol.h2
-rw-r--r--core/fpdfdoc/cpdf_formfield.cpp5
-rw-r--r--core/fpdfdoc/cpdf_formfield.h17
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp1
-rw-r--r--core/fpdfdoc/cpdf_link.cpp5
-rw-r--r--core/fpdfdoc/cpdf_linklist.cpp5
-rw-r--r--core/fpdfdoc/cpdf_occontext.cpp1
-rw-r--r--core/fpdfdoc/cpdf_structtree.cpp6
-rw-r--r--core/fpdfdoc/cpdf_viewerpreferences.cpp3
18 files changed, 59 insertions, 25 deletions
diff --git a/core/fpdfdoc/cpdf_aaction.cpp b/core/fpdfdoc/cpdf_aaction.cpp
index 8d954697b4..109e82b406 100644
--- a/core/fpdfdoc/cpdf_aaction.cpp
+++ b/core/fpdfdoc/cpdf_aaction.cpp
@@ -6,6 +6,8 @@
#include "core/fpdfdoc/cpdf_aaction.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
+
namespace {
constexpr const char* g_sAATypes[] = {
@@ -43,7 +45,7 @@ CPDF_AAction::CPDF_AAction(const CPDF_Dictionary* pDict) : m_pDict(pDict) {}
CPDF_AAction::CPDF_AAction(const CPDF_AAction& that) = default;
-CPDF_AAction::~CPDF_AAction() {}
+CPDF_AAction::~CPDF_AAction() = default;
bool CPDF_AAction::ActionExist(AActionType eType) const {
return m_pDict && m_pDict->KeyExist(g_sAATypes[eType]);
diff --git a/core/fpdfdoc/cpdf_action.cpp b/core/fpdfdoc/cpdf_action.cpp
index 49d143a1bd..6238b05299 100644
--- a/core/fpdfdoc/cpdf_action.cpp
+++ b/core/fpdfdoc/cpdf_action.cpp
@@ -8,6 +8,7 @@
#include "constants/stream_dict_common.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfdoc/cpdf_filespec.h"
#include "core/fpdfdoc/cpdf_nametree.h"
@@ -103,6 +104,18 @@ ByteString CPDF_Action::GetURI(const CPDF_Document* pDoc) const {
return csURI;
}
+bool CPDF_Action::GetHideStatus() const {
+ return m_pDict->GetBooleanFor("H", true);
+}
+
+ByteString CPDF_Action::GetNamedAction() const {
+ return m_pDict->GetStringFor("N");
+}
+
+uint32_t CPDF_Action::GetFlags() const {
+ return m_pDict->GetIntegerFor("Flags");
+}
+
WideString CPDF_Action::GetJavaScript() const {
WideString csJS;
if (!m_pDict)
diff --git a/core/fpdfdoc/cpdf_action.h b/core/fpdfdoc/cpdf_action.h
index 43bf123b71..f0f86796eb 100644
--- a/core/fpdfdoc/cpdf_action.h
+++ b/core/fpdfdoc/cpdf_action.h
@@ -7,10 +7,10 @@
#ifndef CORE_FPDFDOC_CPDF_ACTION_H_
#define CORE_FPDFDOC_CPDF_ACTION_H_
-#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfdoc/cpdf_dest.h"
#include "core/fxcrt/fx_string.h"
+class CPDF_Dictionary;
class CPDF_Document;
class CPDF_Action {
@@ -46,9 +46,9 @@ class CPDF_Action {
CPDF_Dest GetDest(CPDF_Document* pDoc) const;
WideString GetFilePath() const;
ByteString GetURI(const CPDF_Document* pDoc) const;
- bool GetHideStatus() const { return m_pDict->GetBooleanFor("H", true); }
- ByteString GetNamedAction() const { return m_pDict->GetStringFor("N"); }
- uint32_t GetFlags() const { return m_pDict->GetIntegerFor("Flags"); }
+ bool GetHideStatus() const;
+ ByteString GetNamedAction() const;
+ uint32_t GetFlags() const;
WideString GetJavaScript() const;
size_t GetSubActionsCount() const;
CPDF_Action GetSubAction(size_t iIndex) const;
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 89bcdee108..432cf8c528 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -13,6 +13,7 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_boolean.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/render/cpdf_rendercontext.h"
#include "core/fpdfapi/render/cpdf_renderoptions.h"
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index 496fcc6db3..c6e0f63c4b 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -12,6 +12,7 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_number.h"
diff --git a/core/fpdfdoc/cpdf_bookmark.cpp b/core/fpdfdoc/cpdf_bookmark.cpp
index 34398439c5..7f7958b52a 100644
--- a/core/fpdfdoc/cpdf_bookmark.cpp
+++ b/core/fpdfdoc/cpdf_bookmark.cpp
@@ -10,6 +10,7 @@
#include <vector>
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfdoc/cpdf_nametree.h"
#include "core/fxge/fx_dib.h"
diff --git a/core/fpdfdoc/cpdf_bookmarktree.cpp b/core/fpdfdoc/cpdf_bookmarktree.cpp
index 3b178f01b1..fc72db9c4a 100644
--- a/core/fpdfdoc/cpdf_bookmarktree.cpp
+++ b/core/fpdfdoc/cpdf_bookmarktree.cpp
@@ -6,11 +6,12 @@
#include "core/fpdfdoc/cpdf_bookmarktree.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
CPDF_BookmarkTree::CPDF_BookmarkTree(CPDF_Document* pDoc) : m_pDocument(pDoc) {}
-CPDF_BookmarkTree::~CPDF_BookmarkTree() {}
+CPDF_BookmarkTree::~CPDF_BookmarkTree() = default;
CPDF_Bookmark CPDF_BookmarkTree::GetFirstChild(
const CPDF_Bookmark& parent) const {
diff --git a/core/fpdfdoc/cpdf_docjsactions.cpp b/core/fpdfdoc/cpdf_docjsactions.cpp
index 2f6c5b2f1d..2e6560b949 100644
--- a/core/fpdfdoc/cpdf_docjsactions.cpp
+++ b/core/fpdfdoc/cpdf_docjsactions.cpp
@@ -6,6 +6,7 @@
#include "core/fpdfdoc/cpdf_docjsactions.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfdoc/cpdf_nametree.h"
CPDF_DocJSActions::CPDF_DocJSActions(CPDF_Document* pDoc) : m_pDocument(pDoc) {
diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp
index 64c3dcaf46..fcf2175f9d 100644
--- a/core/fpdfdoc/cpdf_formcontrol.cpp
+++ b/core/fpdfdoc/cpdf_formcontrol.cpp
@@ -10,6 +10,7 @@
#include "core/fpdfapi/page/cpdf_form.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
@@ -32,7 +33,11 @@ CPDF_FormControl::CPDF_FormControl(CPDF_FormField* pField,
m_pWidgetDict(pWidgetDict),
m_pForm(m_pField->GetForm()) {}
-CPDF_FormControl::~CPDF_FormControl() {}
+CPDF_FormControl::~CPDF_FormControl() = default;
+
+CFX_FloatRect CPDF_FormControl::GetRect() const {
+ return m_pWidgetDict->GetRectFor("Rect");
+}
ByteString CPDF_FormControl::GetOnStateName() const {
ASSERT(GetType() == CPDF_FormField::CheckBox ||
diff --git a/core/fpdfdoc/cpdf_formcontrol.h b/core/fpdfdoc/cpdf_formcontrol.h
index e3a84e3b55..d29be14ed6 100644
--- a/core/fpdfdoc/cpdf_formcontrol.h
+++ b/core/fpdfdoc/cpdf_formcontrol.h
@@ -48,7 +48,7 @@ class CPDF_FormControl {
const CPDF_InterForm* GetInterForm() const { return m_pForm.Get(); }
CPDF_FormField* GetField() const { return m_pField; }
CPDF_Dictionary* GetWidget() const { return m_pWidgetDict.Get(); }
- CFX_FloatRect GetRect() const { return m_pWidgetDict->GetRectFor("Rect"); }
+ CFX_FloatRect GetRect() const;
void DrawControl(CFX_RenderDevice* pDevice,
CFX_Matrix* pMatrix,
diff --git a/core/fpdfdoc/cpdf_formfield.cpp b/core/fpdfdoc/cpdf_formfield.cpp
index 7694aea898..4ff853dc9a 100644
--- a/core/fpdfdoc/cpdf_formfield.cpp
+++ b/core/fpdfdoc/cpdf_formfield.cpp
@@ -13,6 +13,7 @@
#include "constants/form_flags.h"
#include "core/fpdfapi/parser/cfdf_document.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_number.h"
@@ -303,6 +304,10 @@ ByteString CPDF_FormField::GetDefaultStyle() const {
return pObj ? pObj->GetString() : "";
}
+void CPDF_FormField::SetOpt(std::unique_ptr<CPDF_Object> pOpt) {
+ m_pDict->SetFor("Opt", std::move(pOpt));
+}
+
WideString CPDF_FormField::GetValue(bool bDefault) const {
if (GetType() == CheckBox || GetType() == RadioButton)
return GetCheckValue(bDefault);
diff --git a/core/fpdfdoc/cpdf_formfield.h b/core/fpdfdoc/cpdf_formfield.h
index 1f070848c7..13771fc983 100644
--- a/core/fpdfdoc/cpdf_formfield.h
+++ b/core/fpdfdoc/cpdf_formfield.h
@@ -17,6 +17,13 @@
#include "core/fxcrt/unowned_ptr.h"
#include "third_party/base/stl_util.h"
+class CPDF_Dictionary;
+class CPDF_Font;
+class CPDF_FormControl;
+class CPDF_InterForm;
+class CPDF_Object;
+class CPDF_String;
+
enum class NotificationOption { kDoNotNotify = 0, kNotify };
enum class FormFieldType : uint8_t {
@@ -70,12 +77,6 @@ constexpr FormFieldType kFormFieldTypes[kFormFieldTypeCount] = {
#endif // PDF_ENABLE_XFA
};
-class CPDF_Dictionary;
-class CPDF_Font;
-class CPDF_FormControl;
-class CPDF_InterForm;
-class CPDF_String;
-
const CPDF_Object* FPDF_GetFieldAttr(const CPDF_Dictionary* pFieldDict,
const char* name);
CPDF_Object* FPDF_GetFieldAttr(CPDF_Dictionary* pFieldDict, const char* name);
@@ -178,9 +179,7 @@ class CPDF_FormField {
m_ControlList.emplace_back(pFormControl);
}
- void SetOpt(std::unique_ptr<CPDF_Object> pOpt) {
- m_pDict->SetFor("Opt", std::move(pOpt));
- }
+ void SetOpt(std::unique_ptr<CPDF_Object> pOpt);
private:
WideString GetValue(bool bDefault) const;
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 8a88791ee9..207dc73d77 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -15,6 +15,7 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cfdf_document.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_name.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
diff --git a/core/fpdfdoc/cpdf_link.cpp b/core/fpdfdoc/cpdf_link.cpp
index f7aec4087e..d5f24b1c46 100644
--- a/core/fpdfdoc/cpdf_link.cpp
+++ b/core/fpdfdoc/cpdf_link.cpp
@@ -7,15 +7,16 @@
#include "core/fpdfdoc/cpdf_link.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfdoc/cpdf_nametree.h"
-CPDF_Link::CPDF_Link() {}
+CPDF_Link::CPDF_Link() = default;
CPDF_Link::CPDF_Link(CPDF_Dictionary* pDict) : m_pDict(pDict) {}
CPDF_Link::CPDF_Link(const CPDF_Link& that) = default;
-CPDF_Link::~CPDF_Link() {}
+CPDF_Link::~CPDF_Link() = default;
CFX_FloatRect CPDF_Link::GetRect() {
return m_pDict->GetRectFor("Rect");
diff --git a/core/fpdfdoc/cpdf_linklist.cpp b/core/fpdfdoc/cpdf_linklist.cpp
index 0f56612e66..43b4d45510 100644
--- a/core/fpdfdoc/cpdf_linklist.cpp
+++ b/core/fpdfdoc/cpdf_linklist.cpp
@@ -8,10 +8,11 @@
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
-CPDF_LinkList::CPDF_LinkList() {}
+CPDF_LinkList::CPDF_LinkList() = default;
-CPDF_LinkList::~CPDF_LinkList() {}
+CPDF_LinkList::~CPDF_LinkList() = default;
const std::vector<CPDF_Dictionary*>* CPDF_LinkList::GetPageLinks(
CPDF_Page* pPage) {
diff --git a/core/fpdfdoc/cpdf_occontext.cpp b/core/fpdfdoc/cpdf_occontext.cpp
index 727696bdae..f1a83b0450 100644
--- a/core/fpdfdoc/cpdf_occontext.cpp
+++ b/core/fpdfdoc/cpdf_occontext.cpp
@@ -8,6 +8,7 @@
#include "core/fpdfapi/page/cpdf_pageobject.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
namespace {
diff --git a/core/fpdfdoc/cpdf_structtree.cpp b/core/fpdfdoc/cpdf_structtree.cpp
index d0a67876b9..4f8ce0eea6 100644
--- a/core/fpdfdoc/cpdf_structtree.cpp
+++ b/core/fpdfdoc/cpdf_structtree.cpp
@@ -7,6 +7,7 @@
#include "core/fpdfdoc/cpdf_structtree.h"
#include "core/fpdfapi/parser/cpdf_array.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_reference.h"
@@ -37,10 +38,9 @@ std::unique_ptr<CPDF_StructTree> CPDF_StructTree::LoadPage(
CPDF_StructTree::CPDF_StructTree(const CPDF_Document* pDoc)
: m_pTreeRoot(pDoc->GetRoot()->GetDictFor("StructTreeRoot")),
- m_pRoleMap(m_pTreeRoot ? m_pTreeRoot->GetDictFor("RoleMap") : nullptr),
- m_pPage(nullptr) {}
+ m_pRoleMap(m_pTreeRoot ? m_pTreeRoot->GetDictFor("RoleMap") : nullptr) {}
-CPDF_StructTree::~CPDF_StructTree() {}
+CPDF_StructTree::~CPDF_StructTree() = default;
void CPDF_StructTree::LoadPageTree(const CPDF_Dictionary* pPageDict) {
m_pPage = pPageDict;
diff --git a/core/fpdfdoc/cpdf_viewerpreferences.cpp b/core/fpdfdoc/cpdf_viewerpreferences.cpp
index 3359d6344f..0481d5c9c3 100644
--- a/core/fpdfdoc/cpdf_viewerpreferences.cpp
+++ b/core/fpdfdoc/cpdf_viewerpreferences.cpp
@@ -6,13 +6,14 @@
#include "core/fpdfdoc/cpdf_viewerpreferences.h"
+#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_name.h"
CPDF_ViewerPreferences::CPDF_ViewerPreferences(const CPDF_Document* pDoc)
: m_pDoc(pDoc) {}
-CPDF_ViewerPreferences::~CPDF_ViewerPreferences() {}
+CPDF_ViewerPreferences::~CPDF_ViewerPreferences() = default;
bool CPDF_ViewerPreferences::IsDirectionR2L() const {
const CPDF_Dictionary* pDict = GetViewerPreferences();