summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-23 16:49:34 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-23 16:49:34 +0000
commit66b9fa0e45b9b31882f0b78bb9213f634e211bbf (patch)
tree9e673de89120e628c145b384660df694be801ea8 /xfa
parentee896918c970128787549051bb2942b61be2d70c (diff)
downloadpdfium-66b9fa0e45b9b31882f0b78bb9213f634e211bbf.tar.xz
Cleanup CXFA_FFDocView header
This CL removes unused methods, makes internal methods private and removes unused default params. Change-Id: Ic83a97e3f751a49d3f9fc7c157e8d34a62818cd5 Reviewed-on: https://pdfium-review.googlesource.com/23570 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffdocview.cpp46
-rw-r--r--xfa/fxfa/cxfa_ffdocview.h33
2 files changed, 16 insertions, 63 deletions
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index 375a319c20..50fa5033fe 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -57,18 +57,9 @@ const XFA_AttributeEnum gs_EventActivity[] = {
XFA_AttributeEnum::Unknown,
};
-CXFA_FFDocView::CXFA_FFDocView(CXFA_FFDoc* pDoc)
- : m_bLayoutEvent(false),
- m_pListFocusWidget(nullptr),
- m_bInLayoutStatus(false),
- m_pDoc(pDoc),
- m_pXFADocLayout(nullptr),
- m_iStatus(XFA_DOCVIEW_LAYOUTSTATUS_None),
- m_iLock(0) {}
+CXFA_FFDocView::CXFA_FFDocView(CXFA_FFDoc* pDoc) : m_pDoc(pDoc) {}
-CXFA_FFDocView::~CXFA_FFDocView() {
- DestroyDocView();
-}
+CXFA_FFDocView::~CXFA_FFDocView() {}
void CXFA_FFDocView::InitLayout(CXFA_Node* pNode) {
RunBindItems();
@@ -76,7 +67,7 @@ void CXFA_FFDocView::InitLayout(CXFA_Node* pNode) {
ExecEventActivityByDeepFirst(pNode, XFA_EVENT_IndexChange, false, true);
}
-int32_t CXFA_FFDocView::StartLayout(int32_t iStartPage) {
+int32_t CXFA_FFDocView::StartLayout() {
m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_Start;
m_pDoc->GetXFADoc()->DoProtoMerge();
m_pDoc->GetXFADoc()->DoDataMerge();
@@ -273,16 +264,6 @@ CXFA_FFDocView::CreateReadyNodeIterator() {
: nullptr;
}
-void CXFA_FFDocView::KillFocus() {
- if (m_pFocusWidget &&
- (m_pFocusWidget->GetStatus() & XFA_WidgetStatus_Focused)) {
- m_pFocusWidget->OnKillFocus(nullptr);
- }
- m_pFocusAcc = nullptr;
- m_pFocusWidget = nullptr;
- m_pOldFocusWidget = nullptr;
-}
-
bool CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) {
CXFA_FFWidget* pNewFocus = hWidget;
if (m_pOldFocusWidget == pNewFocus)
@@ -308,13 +289,6 @@ bool CXFA_FFDocView::SetFocus(CXFA_FFWidget* hWidget) {
return false;
pNewFocus = m_pOldFocusWidget.Get();
- if (m_pListFocusWidget && pNewFocus == m_pListFocusWidget) {
- m_pFocusAcc = nullptr;
- m_pFocusWidget = nullptr;
- m_pListFocusWidget = nullptr;
- m_pOldFocusWidget = nullptr;
- return false;
- }
if (pNewFocus && (pNewFocus->GetStatus() & XFA_WidgetStatus_Visible)) {
if (!pNewFocus->IsLoaded())
pNewFocus->LoadWidget();
@@ -471,11 +445,6 @@ void CXFA_FFDocView::OnPageEvent(CXFA_ContainerLayoutItem* pSender,
}
-void CXFA_FFDocView::AddInvalidateRect(CXFA_FFWidget* pWidget,
- const CFX_RectF& rtInvalidate) {
- AddInvalidateRect(pWidget->GetPageView(), rtInvalidate);
-}
-
void CXFA_FFDocView::AddInvalidateRect(CXFA_FFPageView* pPageView,
const CFX_RectF& rtInvalidate) {
if (m_mapPageInvalidate[pPageView]) {
@@ -545,15 +514,6 @@ void CXFA_FFDocView::RunDocClose() {
ExecEventActivityByDeepFirst(pRootItem, XFA_EVENT_DocClose, false, true);
}
-void CXFA_FFDocView::DestroyDocView() {
- ClearInvalidateList();
- m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_None;
- m_iLock = 0;
- m_ValidateAccs.clear();
- m_BindItems.clear();
- m_CalculateAccs.clear();
-}
-
void CXFA_FFDocView::AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc) {
CXFA_WidgetAcc* pCurrentAcc =
!m_CalculateAccs.empty() ? m_CalculateAccs.back() : nullptr;
diff --git a/xfa/fxfa/cxfa_ffdocview.h b/xfa/fxfa/cxfa_ffdocview.h
index 72563dd2f4..d21d64c7ba 100644
--- a/xfa/fxfa/cxfa_ffdocview.h
+++ b/xfa/fxfa/cxfa_ffdocview.h
@@ -47,7 +47,7 @@ class CXFA_FFDocView {
~CXFA_FFDocView();
CXFA_FFDoc* GetDoc() { return m_pDoc.Get(); }
- int32_t StartLayout(int32_t iStartPage = 0);
+ int32_t StartLayout();
int32_t DoLayout();
void StopLayout();
int32_t GetLayoutStatus() const { return m_iStatus; }
@@ -59,7 +59,6 @@ class CXFA_FFDocView {
CXFA_FFWidgetHandler* GetWidgetHandler();
std::unique_ptr<CXFA_ReadyNodeIterator> CreateReadyNodeIterator();
CXFA_FFWidget* GetFocusWidget() const { return m_pFocusWidget.Get(); }
- void KillFocus();
bool SetFocus(CXFA_FFWidget* hWidget);
CXFA_FFWidget* GetWidgetForNode(CXFA_Node* node);
CXFA_FFWidget* GetWidgetByName(const WideString& wsName,
@@ -68,31 +67,20 @@ class CXFA_FFDocView {
void OnPageEvent(CXFA_ContainerLayoutItem* pSender, uint32_t dwEvent);
void LockUpdate() { m_iLock++; }
void UnlockUpdate() { m_iLock--; }
- bool IsUpdateLocked() { return m_iLock > 0; }
- void ClearInvalidateList() { m_mapPageInvalidate.clear(); }
- void AddInvalidateRect(CXFA_FFWidget* pWidget, const CFX_RectF& rtInvalidate);
void AddInvalidateRect(CXFA_FFPageView* pPageView,
const CFX_RectF& rtInvalidate);
void RunInvalidate();
void RunDocClose();
- void DestroyDocView();
void ProcessValueChanged(CXFA_WidgetAcc* widgetAcc);
- bool InitValidate(CXFA_Node* pNode);
- bool RunValidate();
-
void SetChangeMark();
void AddValidateWidget(CXFA_WidgetAcc* pWidget);
void AddCalculateNodeNotify(CXFA_Node* pNodeChange);
void AddCalculateWidgetAcc(CXFA_WidgetAcc* pWidgetAcc);
- int32_t RunCalculateWidgets();
- bool IsStaticNotify() {
- return m_pDoc->GetFormType() == FormType::kXFAForeground;
- }
+
bool RunLayout();
- void RunSubformIndexChange();
void AddNewFormNode(CXFA_Node* pNode);
void AddIndexChangedSubform(CXFA_Node* pNode);
CXFA_WidgetAcc* GetFocusWidgetAcc() const { return m_pFocusAcc.Get(); }
@@ -105,10 +93,9 @@ class CXFA_FFDocView {
void AddBindItem(CXFA_BindItems* item) { m_BindItems.push_back(item); }
- bool m_bLayoutEvent;
+ bool m_bLayoutEvent = false;
+ bool m_bInLayoutStatus = false;
std::vector<WideString> m_arrNullTestMsg;
- CXFA_FFWidget* m_pListFocusWidget;
- bool m_bInLayoutStatus;
private:
bool RunEventLayoutReady();
@@ -120,9 +107,15 @@ class CXFA_FFDocView {
bool ResetSingleNodeData(CXFA_Node* pNode);
CXFA_Subform* GetRootSubform();
+ bool IsUpdateLocked() { return m_iLock > 0; }
+ bool InitValidate(CXFA_Node* pNode);
+ bool RunValidate();
+ int32_t RunCalculateWidgets();
+ void RunSubformIndexChange();
+
UnownedPtr<CXFA_FFDoc> const m_pDoc;
std::unique_ptr<CXFA_FFWidgetHandler> m_pWidgetHandler;
- CXFA_LayoutProcessor* m_pXFADocLayout; // Not owned.
+ CXFA_LayoutProcessor* m_pXFADocLayout = nullptr; // Not owned.
UnownedPtr<CXFA_WidgetAcc> m_pFocusAcc;
UnownedPtr<CXFA_FFWidget> m_pFocusWidget;
UnownedPtr<CXFA_FFWidget> m_pOldFocusWidget;
@@ -132,8 +125,8 @@ class CXFA_FFDocView {
std::vector<CXFA_BindItems*> m_BindItems;
std::vector<CXFA_Node*> m_NewAddedNodes;
std::vector<CXFA_Node*> m_IndexChangedSubforms;
- XFA_DOCVIEW_LAYOUTSTATUS m_iStatus;
- int32_t m_iLock;
+ XFA_DOCVIEW_LAYOUTSTATUS m_iStatus = XFA_DOCVIEW_LAYOUTSTATUS_None;
+ int32_t m_iLock = 0;
};
#endif // XFA_FXFA_CXFA_FFDOCVIEW_H_