diff options
author | Lei Zhang <thestig@chromium.org> | 2018-10-09 21:15:17 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-09 21:15:17 +0000 |
commit | 8153561249b45ba45f6e393cc081eb1101f3f7a6 (patch) | |
tree | 142c4cd8a56aa73b2874d0f6d95777ff4a9eb4c0 /core | |
parent | 8c62883bdb9d695069a483133ddc96d5b85ec472 (diff) | |
download | pdfium-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')
33 files changed, 79 insertions, 33 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator.cpp b/core/fpdfapi/edit/cpdf_creator.cpp index 0823146b15..a42cfaa852 100644 --- a/core/fpdfapi/edit/cpdf_creator.cpp +++ b/core/fpdfapi/edit/cpdf_creator.cpp @@ -12,6 +12,7 @@ #include "core/fpdfapi/edit/cpdf_flateencoder.h" #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_crypto_handler.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_parser.h" diff --git a/core/fpdfapi/edit/cpdf_flateencoder.cpp b/core/fpdfapi/edit/cpdf_flateencoder.cpp index a42b256ed2..ba04d7d938 100644 --- a/core/fpdfapi/edit/cpdf_flateencoder.cpp +++ b/core/fpdfapi/edit/cpdf_flateencoder.cpp @@ -9,6 +9,7 @@ #include <memory> #include "constants/stream_dict_common.h" +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_name.h" #include "core/fpdfapi/parser/cpdf_number.h" #include "core/fpdfapi/parser/fpdf_parser_decode.h" diff --git a/core/fpdfapi/edit/cpdf_flateencoder.h b/core/fpdfapi/edit/cpdf_flateencoder.h index 14ca7cec16..5fc5fe947f 100644 --- a/core/fpdfapi/edit/cpdf_flateencoder.h +++ b/core/fpdfapi/edit/cpdf_flateencoder.h @@ -9,13 +9,13 @@ #include <memory> -#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "core/fxcrt/fx_memory.h" #include "core/fxcrt/maybe_owned.h" #include "core/fxcrt/retain_ptr.h" #include "third_party/base/span.h" +class CPDF_Dictionary; class CPDF_Stream; class CPDF_FlateEncoder { diff --git a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp index 99bb42e3b4..249dd8ef0d 100644 --- a/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp +++ b/core/fpdfapi/edit/cpdf_pagecontentgenerator_unittest.cpp @@ -13,6 +13,7 @@ #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/page/cpdf_pathobject.h" #include "core/fpdfapi/page/cpdf_textobject.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_parser.h" diff --git a/core/fpdfapi/font/cfx_stockfontarray.cpp b/core/fpdfapi/font/cfx_stockfontarray.cpp index 3b61e11f36..0aa984dec9 100644 --- a/core/fpdfapi/font/cfx_stockfontarray.cpp +++ b/core/fpdfapi/font/cfx_stockfontarray.cpp @@ -9,9 +9,10 @@ #include <memory> #include <utility> +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fxcrt/fx_memory.h" -CFX_StockFontArray::CFX_StockFontArray() {} +CFX_StockFontArray::CFX_StockFontArray() = default; CFX_StockFontArray::~CFX_StockFontArray() { for (size_t i = 0; i < FX_ArraySize(m_StockFonts); ++i) { diff --git a/core/fpdfapi/font/cpdf_cmapmanager.cpp b/core/fpdfapi/font/cpdf_cmapmanager.cpp index c33759cd11..8eebd89b30 100644 --- a/core/fpdfapi/font/cpdf_cmapmanager.cpp +++ b/core/fpdfapi/font/cpdf_cmapmanager.cpp @@ -10,6 +10,7 @@ #include "core/fpdfapi/font/cpdf_cid2unicodemap.h" #include "core/fpdfapi/font/cpdf_cmap.h" +#include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" CPDF_CMapManager::CPDF_CMapManager() {} diff --git a/core/fpdfapi/page/cpdf_meshstream.cpp b/core/fpdfapi/page/cpdf_meshstream.cpp index 57a5dd1da1..7503ccb625 100644 --- a/core/fpdfapi/page/cpdf_meshstream.cpp +++ b/core/fpdfapi/page/cpdf_meshstream.cpp @@ -9,6 +9,7 @@ #include "core/fpdfapi/page/cpdf_colorspace.h" #include "core/fpdfapi/page/cpdf_function.h" #include "core/fpdfapi/parser/cpdf_array.h" +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "third_party/base/span.h" namespace { diff --git a/core/fpdfapi/page/cpdf_sampledfunc.cpp b/core/fpdfapi/page/cpdf_sampledfunc.cpp index 143aeb4f8a..d898daadc5 100644 --- a/core/fpdfapi/page/cpdf_sampledfunc.cpp +++ b/core/fpdfapi/page/cpdf_sampledfunc.cpp @@ -7,6 +7,7 @@ #include "core/fpdfapi/page/cpdf_sampledfunc.h" #include "core/fpdfapi/parser/cpdf_array.h" +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fxcrt/cfx_bitstream.h" #include "core/fxcrt/cfx_fixedbufgrow.h" #include "core/fxcrt/fx_safe_types.h" diff --git a/core/fpdfapi/page/cpdf_streamparser.h b/core/fpdfapi/page/cpdf_streamparser.h index 062527813c..af181ffbd1 100644 --- a/core/fpdfapi/page/cpdf_streamparser.h +++ b/core/fpdfapi/page/cpdf_streamparser.h @@ -10,7 +10,6 @@ #include <memory> #include <utility> -#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fpdfapi/parser/cpdf_object.h" #include "core/fpdfapi/parser/cpdf_stream.h" @@ -18,6 +17,8 @@ #include "core/fxcrt/weak_ptr.h" #include "third_party/base/span.h" +class CPDF_Dictionary; + class CPDF_StreamParser { public: enum SyntaxType { EndOfData, Number, Keyword, Name, Others }; diff --git a/core/fpdfapi/parser/cpdf_object_walker.h b/core/fpdfapi/parser/cpdf_object_walker.h index e0fd35de29..0af683c01c 100644 --- a/core/fpdfapi/parser/cpdf_object_walker.h +++ b/core/fpdfapi/parser/cpdf_object_walker.h @@ -8,9 +8,11 @@ #include <memory> #include <stack> -#include "core/fpdfapi/parser/cpdf_dictionary.h" +#include "core/fxcrt/fx_string.h" #include "core/fxcrt/unowned_ptr.h" +class CPDF_Object; + // Walk on all non-null sub-objects in an object in depth, include itself, // like in flat list. class CPDF_ObjectWalker { @@ -42,7 +44,7 @@ class CPDF_ObjectWalker { size_t current_depth() const { return current_depth_; } const CPDF_Object* GetParent() const { return parent_object_.Get(); } - ByteString dictionary_key() const { return dict_key_; } + const ByteString& dictionary_key() const { return dict_key_; } private: static std::unique_ptr<SubobjectIterator> MakeIterator( diff --git a/core/fpdfapi/parser/cpdf_stream.h b/core/fpdfapi/parser/cpdf_stream.h index aada80e35c..4f1eb05478 100644 --- a/core/fpdfapi/parser/cpdf_stream.h +++ b/core/fpdfapi/parser/cpdf_stream.h @@ -11,7 +11,6 @@ #include <set> #include <sstream> -#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_object.h" #include "core/fxcrt/fx_stream.h" diff --git a/core/fpdfapi/parser/cpdf_stream_acc.cpp b/core/fpdfapi/parser/cpdf_stream_acc.cpp index 7956124c62..c87e404186 100644 --- a/core/fpdfapi/parser/cpdf_stream_acc.cpp +++ b/core/fpdfapi/parser/cpdf_stream_acc.cpp @@ -8,6 +8,7 @@ #include <utility> +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/fpdf_parser_decode.h" CPDF_StreamAcc::CPDF_StreamAcc(const CPDF_Stream* pStream) diff --git a/core/fpdfapi/parser/cpdf_stream_acc.h b/core/fpdfapi/parser/cpdf_stream_acc.h index e725041e80..37e21d26d8 100644 --- a/core/fpdfapi/parser/cpdf_stream_acc.h +++ b/core/fpdfapi/parser/cpdf_stream_acc.h @@ -9,7 +9,6 @@ #include <memory> -#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" @@ -17,6 +16,8 @@ #include "core/fxcrt/retain_ptr.h" #include "third_party/base/span.h" +class CPDF_Dictionary; + class CPDF_StreamAcc final : public Retainable { public: template <typename T, typename... Args> diff --git a/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp b/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp index 1fbb342548..146bd4b77b 100644 --- a/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp +++ b/core/fpdfapi/parser/cpdf_stream_acc_unittest.cpp @@ -4,8 +4,8 @@ #include "core/fpdfapi/parser/cpdf_stream_acc.h" +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream.h" - #include "core/fxcrt/cfx_memorystream.h" #include "core/fxcrt/fx_stream.h" #include "testing/gtest/include/gtest/gtest.h" 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(); diff --git a/core/fxcodec/jbig2/JBig2_BitStream_unittest.cpp b/core/fxcodec/jbig2/JBig2_BitStream_unittest.cpp index b66d8b0651..37e8536def 100644 --- a/core/fxcodec/jbig2/JBig2_BitStream_unittest.cpp +++ b/core/fxcodec/jbig2/JBig2_BitStream_unittest.cpp @@ -7,6 +7,7 @@ #include <memory> #include <utility> +#include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/base/ptr_util.h" |