summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-11-08 19:57:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-08 19:57:00 +0000
commitf96dfed065f9c6789811f43b69cd5ab4d85466ac (patch)
tree77da02be4215167c7c13faaf88c3ffe13d3eb91c /xfa
parent3305678c7c954ba11be0ed089f7acd2b09af0779 (diff)
downloadpdfium-f96dfed065f9c6789811f43b69cd5ab4d85466ac.tar.xz
Convert CXFA_FFDoc::SavePackage to accept a CXFA_Node
This CL converts SavePackage to accept the CXFA_Node to export instead of the HASHCODE of the object to retrieve. This simplifies the code in SavePackage as we don't have to detect if this is the Xfa hashcode. Change-Id: I73ef9c4aa3d16f433e2d4568fab5f6d34c214635 Reviewed-on: https://pdfium-review.googlesource.com/18111 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffdoc.cpp7
-rw-r--r--xfa/fxfa/cxfa_ffdoc.h2
2 files changed, 3 insertions, 6 deletions
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index 626defb7d2..640ac39178 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -393,13 +393,10 @@ RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(
return pDibSource;
}
-bool CXFA_FFDoc::SavePackage(XFA_HashCode code,
+bool CXFA_FFDoc::SavePackage(CXFA_Node* pNode,
const RetainPtr<IFX_SeekableStream>& pFile,
CFX_ChecksumContext* pCSContext) {
- CXFA_Document* doc = m_pDocumentParser->GetDocument();
- auto pExport = pdfium::MakeUnique<CXFA_DataExporter>(doc);
- CXFA_Node* pNode = code == XFA_HASHCODE_Xfa ? doc->GetRoot()
- : ToNode(doc->GetXFAObject(code));
+ auto pExport = pdfium::MakeUnique<CXFA_DataExporter>(GetXFADoc());
if (!pNode)
return !!pExport->Export(pFile);
diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h
index 490b023f0d..10ffa36275 100644
--- a/xfa/fxfa/cxfa_ffdoc.h
+++ b/xfa/fxfa/cxfa_ffdoc.h
@@ -75,7 +75,7 @@ class CXFA_FFDoc {
int32_t& iImageYDpi);
CFGAS_PDFFontMgr* GetPDFFontMgr() const { return m_pPDFFontMgr.get(); }
- bool SavePackage(XFA_HashCode code,
+ bool SavePackage(CXFA_Node* pNode,
const RetainPtr<IFX_SeekableStream>& pFile,
CFX_ChecksumContext* pCSContext);
bool ImportData(const RetainPtr<IFX_SeekableStream>& pStream,