summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app/xfa_ffdoc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-23 09:17:10 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-23 13:50:52 +0000
commitcdba747a53082a7f36534dffa6a3ad01628e53c3 (patch)
tree4df0b15de7600592588a263deb9a3adee617f417 /xfa/fxfa/app/xfa_ffdoc.cpp
parent1bbedec89cc59df3e305dc25082d9699237d70ab (diff)
downloadpdfium-cdba747a53082a7f36534dffa6a3ad01628e53c3.tar.xz
Cleanup DocType defines
This Cl synchronizes the DocType's defined in XFA with the DOCTYPE flag used in public/. The internal XFA version is converted to an enum class. Change-Id: I1f7be71a200c1ec0f09f9b08099791da1f4fa2e4 Reviewed-on: https://pdfium-review.googlesource.com/3152 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxfa/app/xfa_ffdoc.cpp')
-rw-r--r--xfa/fxfa/app/xfa_ffdoc.cpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/xfa/fxfa/app/xfa_ffdoc.cpp b/xfa/fxfa/app/xfa_ffdoc.cpp
index 22450a74fe..ba1f5d8124 100644
--- a/xfa/fxfa/app/xfa_ffdoc.cpp
+++ b/xfa/fxfa/app/xfa_ffdoc.cpp
@@ -156,16 +156,12 @@ CXFA_FFDoc::CXFA_FFDoc(CXFA_FFApp* pApp, IXFA_DocEnvironment* pDocEnvironment)
m_pApp(pApp),
m_pNotify(nullptr),
m_pPDFDoc(nullptr),
- m_dwDocType(XFA_DOCTYPE_Static) {}
+ m_dwDocType(XFA_DocType::Static) {}
CXFA_FFDoc::~CXFA_FFDoc() {
CloseDoc();
}
-uint32_t CXFA_FFDoc::GetDocType() {
- return m_dwDocType;
-}
-
int32_t CXFA_FFDoc::StartLoad() {
m_pNotify = pdfium::MakeUnique<CXFA_FFNotify>(this);
m_pDocumentParser = pdfium::MakeUnique<CXFA_DocumentParser>(m_pNotify.get());
@@ -245,29 +241,28 @@ int32_t CXFA_FFDoc::DoLoad(IFX_Pause* pPause) {
void CXFA_FFDoc::StopLoad() {
m_pApp->GetXFAFontMgr()->LoadDocFonts(this);
- m_dwDocType = XFA_DOCTYPE_Static;
+ m_dwDocType = XFA_DocType::Static;
CXFA_Node* pConfig = ToNode(
m_pDocumentParser->GetDocument()->GetXFAObject(XFA_HASHCODE_Config));
- if (!pConfig) {
+ if (!pConfig)
return;
- }
+
CXFA_Node* pAcrobat = pConfig->GetFirstChildByClass(XFA_Element::Acrobat);
- if (!pAcrobat) {
+ if (!pAcrobat)
return;
- }
+
CXFA_Node* pAcrobat7 = pAcrobat->GetFirstChildByClass(XFA_Element::Acrobat7);
- if (!pAcrobat7) {
+ if (!pAcrobat7)
return;
- }
+
CXFA_Node* pDynamicRender =
pAcrobat7->GetFirstChildByClass(XFA_Element::DynamicRender);
- if (!pDynamicRender) {
+ if (!pDynamicRender)
return;
- }
+
CFX_WideString wsType;
- if (pDynamicRender->TryContent(wsType) && wsType == L"required") {
- m_dwDocType = XFA_DOCTYPE_Dynamic;
- }
+ if (pDynamicRender->TryContent(wsType) && wsType == L"required")
+ m_dwDocType = XFA_DocType::Dynamic;
}
CXFA_FFDocView* CXFA_FFDoc::CreateDocView() {
@@ -345,9 +340,7 @@ bool CXFA_FFDoc::CloseDoc() {
m_pApp->ClearEventTargets();
return true;
}
-void CXFA_FFDoc::SetDocType(uint32_t dwType) {
- m_dwDocType = dwType;
-}
+
CPDF_Document* CXFA_FFDoc::GetPDFDoc() {
return m_pPDFDoc;
}