summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/app/xfa_ffdoc.cpp33
-rw-r--r--xfa/fxfa/app/xfa_ffdocview.cpp4
-rw-r--r--xfa/fxfa/fxfa.h6
-rw-r--r--xfa/fxfa/xfa_ffdoc.h5
4 files changed, 21 insertions, 27 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;
}
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp
index b2ed1e907c..f4ea3afdd8 100644
--- a/xfa/fxfa/app/xfa_ffdocview.cpp
+++ b/xfa/fxfa/app/xfa_ffdocview.cpp
@@ -598,6 +598,7 @@ void CXFA_FFDocView::RunDocClose() {
ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocClose, false, true,
nullptr);
}
+
void CXFA_FFDocView::DestroyDocView() {
ClearInvalidateList();
m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_None;
@@ -606,8 +607,9 @@ void CXFA_FFDocView::DestroyDocView() {
m_BindItems.clear();
m_CalculateAccs.clear();
}
+
bool CXFA_FFDocView::IsStaticNotify() {
- return m_pDoc->GetDocType() == XFA_DOCTYPE_Static;
+ return m_pDoc->GetDocType() == XFA_DocType::Static;
}
void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) {
diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h
index 0820a79d22..cc75524624 100644
--- a/xfa/fxfa/fxfa.h
+++ b/xfa/fxfa/fxfa.h
@@ -39,9 +39,9 @@ class IXFA_WidgetIterator;
#define XFA_IDNo 3
#define XFA_IDYes 4
-#define XFA_DOCTYPE_Dynamic 0
-#define XFA_DOCTYPE_Static 1
-#define XFA_DOCTYPE_XDP 2
+// Note, values match fpdf_formfill.h DOCTYPE_* flags.
+enum class XFA_DocType { PDF = 0, Dynamic = 1, Static = 2 };
+
#define XFA_PARSESTATUS_StatusErr -3
#define XFA_PARSESTATUS_StreamErr -2
#define XFA_PARSESTATUS_SyntaxErr -1
diff --git a/xfa/fxfa/xfa_ffdoc.h b/xfa/fxfa/xfa_ffdoc.h
index af2bf2c796..ee7695b15a 100644
--- a/xfa/fxfa/xfa_ffdoc.h
+++ b/xfa/fxfa/xfa_ffdoc.h
@@ -31,8 +31,7 @@ class CXFA_FFDoc {
~CXFA_FFDoc();
IXFA_DocEnvironment* GetDocEnvironment() const { return m_pDocEnvironment; }
- uint32_t GetDocType();
- void SetDocType(uint32_t dwType);
+ XFA_DocType GetDocType() const { return m_dwDocType; }
int32_t StartLoad();
int32_t DoLoad(IFX_Pause* pPause = nullptr);
@@ -68,7 +67,7 @@ class CXFA_FFDoc {
CPDF_Document* m_pPDFDoc;
std::map<uint32_t, FX_IMAGEDIB_AND_DPI> m_HashToDibDpiMap;
std::unique_ptr<CXFA_FFDocView> m_DocView;
- uint32_t m_dwDocType;
+ XFA_DocType m_dwDocType;
};
#endif // XFA_FXFA_XFA_FFDOC_H_