summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-10-09 23:32:10 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-10-09 23:32:10 +0000
commit76ec926e732926e84de9c8b4ef0018464172e73b (patch)
treefb59a9fb517b2d8a326b33cbc834202f903a86f6
parent46ab5abf23910983663b3daeb6dc2f6a98ee24a8 (diff)
downloadpdfium-76ec926e732926e84de9c8b4ef0018464172e73b.tar.xz
Remove default argument to CPDF_Dictionary::GetBooleanFor().chromium/3576
Change-Id: I5b64bc3af90b9557d8e0c456675afe60e463927d Reviewed-on: https://pdfium-review.googlesource.com/c/43612 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.h2
-rw-r--r--core/fpdfdoc/cpdf_annot.cpp3
-rw-r--r--core/fpdfdoc/cpdf_annotlist.cpp3
-rw-r--r--core/fpdfdoc/cpdf_iconfit.cpp2
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp7
5 files changed, 8 insertions, 9 deletions
diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h
index 7b839975a1..a0e678c6fd 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.h
+++ b/core/fpdfapi/parser/cpdf_dictionary.h
@@ -52,7 +52,7 @@ class CPDF_Dictionary final : public CPDF_Object {
WideString GetUnicodeTextFor(const ByteString& key) const;
int GetIntegerFor(const ByteString& key) const;
int GetIntegerFor(const ByteString& key, int default_int) const;
- bool GetBooleanFor(const ByteString& key, bool bDefault = false) const;
+ bool GetBooleanFor(const ByteString& key, bool bDefault) const;
float GetNumberFor(const ByteString& key) const;
const CPDF_Dictionary* GetDictFor(const ByteString& key) const;
CPDF_Dictionary* GetDictFor(const ByteString& key);
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp
index 432cf8c528..89268d493a 100644
--- a/core/fpdfdoc/cpdf_annot.cpp
+++ b/core/fpdfdoc/cpdf_annot.cpp
@@ -119,7 +119,8 @@ CPDF_Annot::~CPDF_Annot() {
void CPDF_Annot::Init() {
m_nSubtype = StringToAnnotSubtype(m_pAnnotDict->GetStringFor("Subtype"));
m_bIsTextMarkupAnnotation = IsTextMarkupAnnotation(m_nSubtype);
- m_bHasGeneratedAP = m_pAnnotDict->GetBooleanFor(kPDFiumKey_HasGeneratedAP);
+ m_bHasGeneratedAP =
+ m_pAnnotDict->GetBooleanFor(kPDFiumKey_HasGeneratedAP, false);
GenerateAPIfNeeded();
}
diff --git a/core/fpdfdoc/cpdf_annotlist.cpp b/core/fpdfdoc/cpdf_annotlist.cpp
index c6e0f63c4b..f6959fb78f 100644
--- a/core/fpdfdoc/cpdf_annotlist.cpp
+++ b/core/fpdfdoc/cpdf_annotlist.cpp
@@ -170,7 +170,8 @@ CPDF_AnnotList::CPDF_AnnotList(CPDF_Page* pPage)
const CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
const CPDF_Dictionary* pAcroForm = pRoot->GetDictFor("AcroForm");
- bool bRegenerateAP = pAcroForm && pAcroForm->GetBooleanFor("NeedAppearances");
+ bool bRegenerateAP =
+ pAcroForm && pAcroForm->GetBooleanFor("NeedAppearances", false);
for (size_t i = 0; i < pAnnots->GetCount(); ++i) {
CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetDirectObjectAt(i));
if (!pDict)
diff --git a/core/fpdfdoc/cpdf_iconfit.cpp b/core/fpdfdoc/cpdf_iconfit.cpp
index 5b3deee93f..bef9eb4ebf 100644
--- a/core/fpdfdoc/cpdf_iconfit.cpp
+++ b/core/fpdfdoc/cpdf_iconfit.cpp
@@ -50,5 +50,5 @@ void CPDF_IconFit::GetIconPosition(float& fLeft, float& fBottom) {
}
bool CPDF_IconFit::GetFittingBounds() {
- return m_pDict ? m_pDict->GetBooleanFor("FB") : false;
+ return m_pDict && m_pDict->GetBooleanFor("FB", false);
}
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index 207dc73d77..5e9e5e51b0 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -577,10 +577,7 @@ uint8_t CPDF_InterForm::GetNativeCharSet() {
}
CPDF_InterForm::CPDF_InterForm(CPDF_Document* pDocument)
- : m_pDocument(pDocument),
- m_pFormDict(nullptr),
- m_pFieldTree(pdfium::MakeUnique<CFieldTree>()),
- m_pFormNotify(nullptr) {
+ : m_pDocument(pDocument), m_pFieldTree(pdfium::MakeUnique<CFieldTree>()) {
CPDF_Dictionary* pRoot = m_pDocument->GetRoot();
if (!pRoot)
return;
@@ -742,7 +739,7 @@ CPDF_FormControl* CPDF_InterForm::GetControlByDict(
}
bool CPDF_InterForm::NeedConstructAP() const {
- return m_pFormDict && m_pFormDict->GetBooleanFor("NeedAppearances");
+ return m_pFormDict && m_pFormDict->GetBooleanFor("NeedAppearances", false);
}
int CPDF_InterForm::CountFieldsInCalculationOrder() {