summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp8
-rw-r--r--core/fpdfapi/fpdf_parser/include/cpdf_document.h26
2 files changed, 15 insertions, 19 deletions
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index 36f622664d..45b8711efd 100644
--- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -929,7 +929,7 @@ int32_t CPDF_Creator::WriteIndirectObjectToStream(const CPDF_Object* pObj) {
}
if (pDict) {
- if (pDict == m_pDocument->m_pRootDict || pDict == m_pEncryptDict)
+ if (pDict == m_pDocument->GetRoot() || pDict == m_pEncryptDict)
return 1;
if (pDict->IsSignatureDict())
return 1;
@@ -1749,17 +1749,17 @@ int32_t CPDF_Creator::WriteDoc_Stage4(IFX_Pause* pPause) {
if (m_File.AppendString("\r\n/Root ") < 0) {
return -1;
}
- if (m_File.AppendDWord(m_pDocument->m_pRootDict->GetObjNum()) < 0) {
+ if (m_File.AppendDWord(m_pDocument->GetRoot()->GetObjNum()) < 0) {
return -1;
}
if (m_File.AppendString(" 0 R\r\n") < 0) {
return -1;
}
- if (m_pDocument->m_pInfoDict) {
+ if (m_pDocument->GetInfo()) {
if (m_File.AppendString("/Info ") < 0) {
return -1;
}
- if (m_File.AppendDWord(m_pDocument->m_pInfoDict->GetObjNum()) < 0) {
+ if (m_File.AppendDWord(m_pDocument->GetInfo()->GetObjNum()) < 0) {
return -1;
}
if (m_File.AppendString(" 0 R\r\n") < 0) {
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
index 4bbbb277d4..1cc32dc3b2 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
@@ -97,9 +97,8 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
FX_BOOL bTranslateName = FALSE);
#endif
- protected:
- friend class CPDF_Creator;
- friend class CPDF_Parser;
+ private:
+ friend class CPDF_TestDocument;
// Retrieve page count information by getting count value from the tree nodes
int RetrievePageCount() const;
@@ -113,6 +112,15 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
int& index,
int level = 0);
CPDF_Object* ParseIndirectObject(uint32_t objnum) override;
+ void LoadDocInternal();
+ size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict);
+ CPDF_Dictionary* GetPagesDict() const;
+ CPDF_Dictionary* ProcessbCJK(
+ CPDF_Dictionary* pBaseDict,
+ int charset,
+ FX_BOOL bVert,
+ CFX_ByteString basefont,
+ std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert);
std::unique_ptr<CPDF_Parser> m_pParser;
CPDF_Dictionary* m_pRootDict;
@@ -125,18 +133,6 @@ class CPDF_Document : public CPDF_IndirectObjectHolder {
std::unique_ptr<CPDF_DocRenderData> m_pDocRender;
std::unique_ptr<JBig2_DocumentContext> m_pCodecContext;
std::unique_ptr<CPDF_LinkList> m_pLinksContext;
-
- private:
- void LoadDocInternal();
- size_t CalculateEncodingDict(int charset, CPDF_Dictionary* pBaseDict);
- CPDF_Dictionary* GetPagesDict() const;
- CPDF_Dictionary* ProcessbCJK(
- CPDF_Dictionary* pBaseDict,
- int charset,
- FX_BOOL bVert,
- CFX_ByteString basefont,
- std::function<void(FX_WCHAR, FX_WCHAR, CPDF_Array*)> Insert);
-
CFX_ArrayTemplate<uint32_t> m_PageList;
};