Add CFDF_Document::GetMutableRoot()
Then update one caller.
Change-Id: Ie640d1bdd35a4f297b661f7abd1ca9e4e7621fe7
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/94754
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/parser/cfdf_document.h b/core/fpdfapi/parser/cfdf_document.h
index cad94d0..e17ee91 100644
--- a/core/fpdfapi/parser/cfdf_document.h
+++ b/core/fpdfapi/parser/cfdf_document.h
@@ -26,7 +26,8 @@
~CFDF_Document() override;
ByteString WriteToString() const;
- CPDF_Dictionary* GetRoot() const { return m_pRootDict.Get(); }
+ const CPDF_Dictionary* GetRoot() const { return m_pRootDict.Get(); }
+ RetainPtr<CPDF_Dictionary> GetMutableRoot() const { return m_pRootDict; }
private:
void ParseStream(RetainPtr<IFX_SeekableReadStream> pFile);
diff --git a/core/fpdfdoc/cpdf_interactiveform.cpp b/core/fpdfdoc/cpdf_interactiveform.cpp
index 810da94..cc2e271 100644
--- a/core/fpdfdoc/cpdf_interactiveform.cpp
+++ b/core/fpdfdoc/cpdf_interactiveform.cpp
@@ -935,7 +935,7 @@
return nullptr;
RetainPtr<CPDF_Dictionary> pMainDict =
- pDoc->GetRoot()->GetMutableDictFor("FDF");
+ pDoc->GetMutableRoot()->GetMutableDictFor("FDF");
if (!pdf_path.IsEmpty()) {
auto pNewDict = pDoc->New<CPDF_Dictionary>();
pNewDict->SetNewFor<CPDF_Name>("Type", "Filespec");