Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(995)

Unified Diff: xfa/fxfa/app/xfa_ffdoc.cpp

Issue 2323523002: Remove unused code in CPDFXFA_Document (Closed)
Patch Set: Review feedback Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h ('k') | xfa/fxfa/app/xfa_ffsignature.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_ffdoc.cpp
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index 4e69db4eea119962422c004785c19483a7326056..1aed9c640ea47a34f626d97f9a6d6b449a6cb848 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -235,60 +235,14 @@ void XFA_XPDPacket_MergeRootNode(CXFA_Node* pOriginRoot, CXFA_Node* pNewRoot) {
}
}
}
+
int32_t CXFA_FFDoc::DoLoad(IFX_Pause* pPause) {
int32_t iStatus = m_pDocumentParser->DoParse(pPause);
- if (iStatus == XFA_PARSESTATUS_Done && !m_pPDFDoc) {
- CXFA_Node* pPDFNode = ToNode(
- m_pDocumentParser->GetDocument()->GetXFAObject(XFA_HASHCODE_Pdf));
- if (!pPDFNode) {
- return XFA_PARSESTATUS_SyntaxErr;
- }
- CFDE_XMLNode* pPDFXML = pPDFNode->GetXMLMappingNode();
- if (pPDFXML->GetType() != FDE_XMLNODE_Element) {
- return XFA_PARSESTATUS_SyntaxErr;
- }
- int32_t iBufferSize = 0;
- uint8_t* pByteBuffer = nullptr;
- IFX_FileRead* pXFAReader = nullptr;
- if (XFA_GetPDFContentsFromPDFXML(pPDFXML, pByteBuffer, iBufferSize)) {
- pXFAReader = FX_CreateMemoryStream(pByteBuffer, iBufferSize, TRUE);
- } else {
- CFX_WideString wsHref;
- static_cast<CFDE_XMLElement*>(pPDFXML)->GetString(L"href", wsHref);
- if (!wsHref.IsEmpty()) {
- pXFAReader = GetDocProvider()->OpenLinkedFile(this, wsHref);
- }
- }
- if (!pXFAReader)
- return XFA_PARSESTATUS_SyntaxErr;
-
- CPDF_Document* pPDFDocument =
- GetDocProvider()->OpenPDF(this, pXFAReader, TRUE);
- ASSERT(!m_pPDFDoc);
- if (!OpenDoc(pPDFDocument))
- return XFA_PARSESTATUS_SyntaxErr;
-
- CXFA_Document* doc = m_pDocumentParser->GetDocument();
- std::unique_ptr<CXFA_SimpleParser> pParser(
- new CXFA_SimpleParser(doc, true));
- if (!pParser)
- return XFA_PARSESTATUS_SyntaxErr;
-
- CXFA_Node* pRootNode = nullptr;
- if (pParser->StartParse(m_pStream, XFA_XDPPACKET_XDP) ==
- XFA_PARSESTATUS_Ready &&
- pParser->DoParse(nullptr) == XFA_PARSESTATUS_Done) {
- pRootNode = pParser->GetRootNode();
- }
- if (pRootNode && doc->GetRoot()) {
- XFA_XPDPacket_MergeRootNode(doc->GetRoot(), pRootNode);
- iStatus = XFA_PARSESTATUS_Done;
- } else {
- iStatus = XFA_PARSESTATUS_StatusErr;
- }
- }
+ if (iStatus == XFA_PARSESTATUS_Done && !m_pPDFDoc)
+ return XFA_PARSESTATUS_SyntaxErr;
return iStatus;
}
+
void CXFA_FFDoc::StopLoad() {
m_pApp->GetXFAFontMgr()->LoadDocFonts(this);
m_dwDocType = XFA_DOCTYPE_Static;
« no previous file with comments | « fpdfsdk/fpdfxfa/include/fpdfxfa_doc.h ('k') | xfa/fxfa/app/xfa_ffsignature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698