summaryrefslogtreecommitdiff
path: root/xfa/fxfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxfa')
-rw-r--r--xfa/fxfa/cxfa_ffapp.cpp2
-rw-r--r--xfa/fxfa/cxfa_ffdocview.cpp8
-rw-r--r--xfa/fxfa/cxfa_ffdocview.h3
-rw-r--r--xfa/fxfa/cxfa_ffpageview.cpp8
-rw-r--r--xfa/fxfa/cxfa_ffpageview.h14
-rw-r--r--xfa/fxfa/cxfa_rendercontext.cpp4
-rw-r--r--xfa/fxfa/fxfa.h4
7 files changed, 21 insertions, 22 deletions
diff --git a/xfa/fxfa/cxfa_ffapp.cpp b/xfa/fxfa/cxfa_ffapp.cpp
index a71112c93e..742cd14c30 100644
--- a/xfa/fxfa/cxfa_ffapp.cpp
+++ b/xfa/fxfa/cxfa_ffapp.cpp
@@ -26,7 +26,7 @@
CXFA_FFApp::CXFA_FFApp(IXFA_AppProvider* pProvider)
: m_pProvider(pProvider),
m_pWidgetMgrDelegate(nullptr),
- m_pFWLApp(new CFWL_App(this)) {}
+ m_pFWLApp(pdfium::MakeUnique<CFWL_App>(this)) {}
CXFA_FFApp::~CXFA_FFApp() {}
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index 00f759a7f5..bcf5ef2772 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -306,10 +306,12 @@ CXFA_FFWidgetHandler* CXFA_FFDocView::GetWidgetHandler() {
return m_pWidgetHandler.get();
}
-CXFA_WidgetAccIterator* CXFA_FFDocView::CreateWidgetAccIterator(
- XFA_WIDGETORDER eOrder) {
+std::unique_ptr<CXFA_WidgetAccIterator>
+CXFA_FFDocView::CreateWidgetAccIterator() {
CXFA_Node* pFormRoot = GetRootSubform();
- return pFormRoot ? new CXFA_WidgetAccIterator(pFormRoot) : nullptr;
+ if (!pFormRoot)
+ return nullptr;
+ return pdfium::MakeUnique<CXFA_WidgetAccIterator>(pFormRoot);
}
CXFA_FFWidget* CXFA_FFDocView::GetFocusWidget() {
diff --git a/xfa/fxfa/cxfa_ffdocview.h b/xfa/fxfa/cxfa_ffdocview.h
index 05ed9d7086..7b443d4019 100644
--- a/xfa/fxfa/cxfa_ffdocview.h
+++ b/xfa/fxfa/cxfa_ffdocview.h
@@ -55,8 +55,7 @@ class CXFA_FFDocView {
int32_t ProcessWidgetEvent(CXFA_EventParam* pParam,
CXFA_WidgetAcc* pWidgetAcc);
CXFA_FFWidgetHandler* GetWidgetHandler();
- CXFA_WidgetAccIterator* CreateWidgetAccIterator(
- XFA_WIDGETORDER eOrder = XFA_WIDGETORDER_PreOrder);
+ std::unique_ptr<CXFA_WidgetAccIterator> CreateWidgetAccIterator();
CXFA_FFWidget* GetFocusWidget();
void KillFocus();
bool SetFocus(CXFA_FFWidget* hWidget);
diff --git a/xfa/fxfa/cxfa_ffpageview.cpp b/xfa/fxfa/cxfa_ffpageview.cpp
index 49033bc0de..d027a83ce1 100644
--- a/xfa/fxfa/cxfa_ffpageview.cpp
+++ b/xfa/fxfa/cxfa_ffpageview.cpp
@@ -127,14 +127,16 @@ CFX_Matrix CXFA_FFPageView::GetDisplayMatrix(const CFX_Rect& rtDisp,
return GetPageMatrix(CFX_RectF(0, 0, GetPageSize()), rtDisp, iRotate, 0);
}
-IXFA_WidgetIterator* CXFA_FFPageView::CreateWidgetIterator(
+std::unique_ptr<IXFA_WidgetIterator> CXFA_FFPageView::CreateWidgetIterator(
uint32_t dwTraverseWay,
uint32_t dwWidgetFilter) {
switch (dwTraverseWay) {
case XFA_TRAVERSEWAY_Tranvalse:
- return new CXFA_FFTabOrderPageWidgetIterator(this, dwWidgetFilter);
+ return pdfium::MakeUnique<CXFA_FFTabOrderPageWidgetIterator>(
+ this, dwWidgetFilter);
case XFA_TRAVERSEWAY_Form:
- return new CXFA_FFPageWidgetIterator(this, dwWidgetFilter);
+ return pdfium::MakeUnique<CXFA_FFPageWidgetIterator>(this,
+ dwWidgetFilter);
}
return nullptr;
}
diff --git a/xfa/fxfa/cxfa_ffpageview.h b/xfa/fxfa/cxfa_ffpageview.h
index df4fc6d2c1..01409f3403 100644
--- a/xfa/fxfa/cxfa_ffpageview.h
+++ b/xfa/fxfa/cxfa_ffpageview.h
@@ -7,6 +7,7 @@
#ifndef XFA_FXFA_CXFA_FFPAGEVIEW_H_
#define XFA_FXFA_CXFA_FFPAGEVIEW_H_
+#include <memory>
#include <vector>
#include "xfa/fxfa/parser/cxfa_containerlayoutitem.h"
@@ -25,18 +26,17 @@ class CXFA_FFPageView : public CXFA_ContainerLayoutItem {
CXFA_FFDocView* GetDocView() const;
CFX_RectF GetPageViewRect() const;
CFX_Matrix GetDisplayMatrix(const CFX_Rect& rtDisp, int32_t iRotate) const;
- IXFA_WidgetIterator* CreateWidgetIterator(
- uint32_t dwTraverseWay = XFA_TRAVERSEWAY_Form,
- uint32_t dwWidgetFilter = XFA_WidgetStatus_Visible |
- XFA_WidgetStatus_Viewable);
+ std::unique_ptr<IXFA_WidgetIterator> CreateWidgetIterator(
+ uint32_t dwTraverseWay,
+ uint32_t dwWidgetFilter);
protected:
CXFA_FFDocView* const m_pDocView;
};
-typedef CXFA_NodeIteratorTemplate<CXFA_LayoutItem,
- CXFA_TraverseStrategy_LayoutItem>
- CXFA_LayoutItemIterator;
+using CXFA_LayoutItemIterator =
+ CXFA_NodeIteratorTemplate<CXFA_LayoutItem,
+ CXFA_TraverseStrategy_LayoutItem>;
class CXFA_FFPageWidgetIterator : public IXFA_WidgetIterator {
public:
diff --git a/xfa/fxfa/cxfa_rendercontext.cpp b/xfa/fxfa/cxfa_rendercontext.cpp
index ecb42918cb..4b48dd4d18 100644
--- a/xfa/fxfa/cxfa_rendercontext.cpp
+++ b/xfa/fxfa/cxfa_rendercontext.cpp
@@ -41,8 +41,8 @@ int32_t CXFA_RenderContext::StartRender(CXFA_FFPageView* pPageView,
uint32_t dwFilterType = XFA_WidgetStatus_Visible |
(m_options.m_bPrint ? XFA_WidgetStatus_Printable
: XFA_WidgetStatus_Viewable);
- m_pWidgetIterator.reset(
- m_pPageView->CreateWidgetIterator(XFA_TRAVERSEWAY_Form, dwFilterType));
+ m_pWidgetIterator =
+ m_pPageView->CreateWidgetIterator(XFA_TRAVERSEWAY_Form, dwFilterType);
m_pWidget = m_pWidgetIterator->MoveToNext();
return XFA_RENDERSTATUS_Ready;
}
diff --git a/xfa/fxfa/fxfa.h b/xfa/fxfa/fxfa.h
index 559035cba1..2b4e2377af 100644
--- a/xfa/fxfa/fxfa.h
+++ b/xfa/fxfa/fxfa.h
@@ -86,10 +86,6 @@ enum XFA_WidgetStatus {
XFA_WidgetStatus_Visible = 1 << 9
};
-enum XFA_WIDGETORDER {
- XFA_WIDGETORDER_PreOrder,
-};
-
enum XFA_WIDGETTYPE {
XFA_WIDGETTYPE_Barcode,
XFA_WIDGETTYPE_PushButton,