diff options
author | thestig <thestig@chromium.org> | 2016-10-15 18:31:04 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-10-15 18:31:04 -0700 |
commit | 4dc112664e9d87c0d450ee3349a5091c624a3363 (patch) | |
tree | 151cbfb71dc8cda4b31a982bb2caf1985f55f5de /core | |
parent | c25a4219431c90a95233a08f25eecc921abbf3ed (diff) | |
download | pdfium-4dc112664e9d87c0d450ee3349a5091c624a3363.tar.xz |
Fix some nits in cpdf_annotlist.cpp.
Review-Url: https://codereview.chromium.org/2395693002
Diffstat (limited to 'core')
-rw-r--r-- | core/fpdfdoc/cpdf_annotlist.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp index f73ace9791..b626115de1 100644 --- a/core/fpdfdoc/cpdf_annotlist.cpp +++ b/core/fpdfdoc/cpdf_annotlist.cpp @@ -6,6 +6,9 @@ #include "core/fpdfdoc/cpdf_annotlist.h" +#include <memory> +#include <utility> + #include "core/fpdfapi/page/cpdf_page.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fpdfapi/parser/cpdf_reference.h" @@ -64,11 +67,13 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage) CPDF_Dictionary* pRoot = m_pDocument->GetRoot(); CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm"); - FX_BOOL bRegenerateAP = - pAcroForm && pAcroForm->GetBooleanFor("NeedAppearances"); + bool bRegenerateAP = pAcroForm && pAcroForm->GetBooleanFor("NeedAppearances"); for (size_t i = 0; i < pAnnots->GetCount(); ++i) { CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i)); - if (!pDict || pDict->GetStringFor("Subtype") == "Popup") { + if (!pDict) + continue; + const CFX_ByteString subtype = pDict->GetStringFor("Subtype"); + if (subtype == "Popup") { // Skip creating Popup annotations in the PDF document since PDFium // provides its own Popup annotations. continue; @@ -76,7 +81,7 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage) pAnnots->ConvertToIndirectObjectAt(i, m_pDocument); m_AnnotList.push_back( std::unique_ptr<CPDF_Annot>(new CPDF_Annot(pDict, m_pDocument, false))); - if (bRegenerateAP && pDict->GetStringFor("Subtype") == "Widget" && + if (bRegenerateAP && subtype == "Widget" && CPDF_InterForm::IsUpdateAPEnabled()) { FPDF_GenerateAP(m_pDocument, pDict); } |