Index: xfa/fwl/core/fwl_widgetmgrimp.cpp |
diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp |
index 93f39a98e52e6fe79d161895b909090fb5de3c32..b50e777840a0e9e2c17c39f4b1993929601b2cfb 100644 |
--- a/xfa/fwl/core/fwl_widgetmgrimp.cpp |
+++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp |
@@ -36,11 +36,10 @@ FX_BOOL FWL_UseOffscreen(IFWL_Widget* pWidget) { |
#endif |
} |
-IFWL_WidgetMgr* FWL_GetWidgetMgr() { |
+// static |
+IFWL_WidgetMgr* IFWL_WidgetMgr::GetInstance() { |
IFWL_App* pApp = FWL_GetApp(); |
- if (!pApp) |
- return NULL; |
- return pApp->GetWidgetMgr(); |
+ return pApp ? pApp->GetWidgetMgr() : nullptr; |
} |
CFWL_WidgetMgr::CFWL_WidgetMgr(CXFA_FFApp* pAdapterNative) |
@@ -416,8 +415,8 @@ void CFWL_WidgetMgr::NotifySizeChanged(IFWL_Widget* pForm, |
IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent, |
IFWL_Widget* focus, |
FX_BOOL& bFind) { |
- IFWL_Widget* child = |
- FWL_GetWidgetMgr()->GetWidget(parent, FWL_WGTRELATION_FirstChild); |
+ IFWL_Widget* child = IFWL_WidgetMgr::GetInstance()->GetWidget( |
+ parent, FWL_WGTRELATION_FirstChild); |
while (child) { |
if (focus == child) { |
bFind = TRUE; |
@@ -430,7 +429,8 @@ IFWL_Widget* CFWL_WidgetMgr::nextTab(IFWL_Widget* parent, |
if (bRet) { |
return bRet; |
} |
- child = FWL_GetWidgetMgr()->GetWidget(child, FWL_WGTRELATION_NextSibling); |
+ child = IFWL_WidgetMgr::GetInstance()->GetWidget( |
+ child, FWL_WGTRELATION_NextSibling); |
} |
return NULL; |
} |
@@ -490,8 +490,8 @@ IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) { |
(pParent->GetStates() & (1 << (FWL_WGTSTATE_MAX + 2)))) { |
return pParent; |
} |
- IFWL_Widget* child = |
- FWL_GetWidgetMgr()->GetWidget(pParent, FWL_WGTRELATION_FirstChild); |
+ IFWL_Widget* child = IFWL_WidgetMgr::GetInstance()->GetWidget( |
+ pParent, FWL_WGTRELATION_FirstChild); |
while (child) { |
if ((child->GetClassID() == FWL_Type::PushButton) && |
(child->GetStates() & (1 << (FWL_WGTSTATE_MAX + 2)))) { |
@@ -501,7 +501,8 @@ IFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(IFWL_Widget* pParent) { |
if (find) { |
return find; |
} |
- child = FWL_GetWidgetMgr()->GetWidget(child, FWL_WGTRELATION_NextSibling); |
+ child = IFWL_WidgetMgr::GetInstance()->GetWidget( |
+ child, FWL_WGTRELATION_NextSibling); |
} |
return NULL; |
} |
@@ -775,8 +776,8 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget, |
if (!rtWidget.IntersectWith(rtDirty)) |
return FALSE; |
- IFWL_Widget* pChild = |
- FWL_GetWidgetMgr()->GetWidget(pWidget, FWL_WGTRELATION_FirstChild); |
+ IFWL_Widget* pChild = IFWL_WidgetMgr::GetInstance()->GetWidget( |
+ pWidget, FWL_WGTRELATION_FirstChild); |
if (!pChild) |
return TRUE; |
@@ -835,7 +836,7 @@ FX_BOOL CFWL_WidgetMgrDelegate::IsNeedRepaint(IFWL_Widget* pWidget, |
if (r.Contains(hitPoint[i].hitPoint)) |
hitPoint[i].bNotNeedRepaint = true; |
} |
- } while ((pChild = FWL_GetWidgetMgr()->GetWidget( |
+ } while ((pChild = IFWL_WidgetMgr::GetInstance()->GetWidget( |
pChild, FWL_WGTRELATION_NextSibling)) != NULL); |
if (!bChildIntersectWithDirty) |