summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp15
1 files changed, 4 insertions, 11 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(