summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp15
-rw-r--r--core/fpdfapi/parser/cpdf_document.h1
2 files changed, 4 insertions, 12 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index 1dd801de69..63556de250 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -196,22 +196,15 @@ std::unique_ptr<CPDF_Object> CPDF_Document::ParseIndirectObject(
return m_pParser ? m_pParser->ParseIndirectObject(objnum) : nullptr;
}
-void CPDF_Document::LoadDocInternal() {
+bool CPDF_Document::TryInit() {
SetLastObjNum(m_pParser->GetLastObjNum());
CPDF_Object* pRootObj = GetOrParseIndirectObject(m_pParser->GetRootObjNum());
- if (!pRootObj)
- return;
-
- m_pRootDict = pRootObj->GetDict();
- if (!m_pRootDict)
- return;
-}
+ if (pRootObj)
+ m_pRootDict = pRootObj->GetDict();
-bool CPDF_Document::TryInit() {
- LoadDocInternal();
LoadPages();
- return GetRoot() && (GetPageCount() > 0);
+ return GetRoot() && GetPageCount() > 0;
}
CPDF_Parser::Error CPDF_Document::LoadDoc(
diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h
index 1cbc5fcc42..09bfb21550 100644
--- a/core/fpdfapi/parser/cpdf_document.h
+++ b/core/fpdfapi/parser/cpdf_document.h
@@ -135,7 +135,6 @@ class CPDF_Document : public Observable<CPDF_Document>,
int* index,
int level) const;
std::unique_ptr<CPDF_Object> ParseIndirectObject(uint32_t objnum) override;
- void LoadDocInternal();
size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict);
const CPDF_Dictionary* GetPagesDict() const;
CPDF_Dictionary* GetPagesDict();