diff options
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/src/fwl/src/core/fwl_appimp.cpp | 8 | ||||
-rw-r--r-- | xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp | 3 | ||||
-rw-r--r-- | xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h | 46 |
3 files changed, 30 insertions, 27 deletions
diff --git a/xfa/src/fwl/src/core/fwl_appimp.cpp b/xfa/src/fwl/src/core/fwl_appimp.cpp index d9d37e2f9e..948001c21d 100644 --- a/xfa/src/fwl/src/core/fwl_appimp.cpp +++ b/xfa/src/fwl/src/core/fwl_appimp.cpp @@ -41,10 +41,8 @@ FWL_ERR CFWL_AppImp::Initialize() { return FWL_ERR_Succeeded;
}
FWL_ERR CFWL_AppImp::Finalize() {
- if (m_pWidgetMgr) {
- delete m_pWidgetMgr;
- m_pWidgetMgr = NULL;
- }
+ delete m_pWidgetMgr;
+ m_pWidgetMgr = NULL;
return FWL_ERR_Succeeded;
}
IFWL_AdapterNative* CFWL_AppImp::GetAdapterNative() {
@@ -54,7 +52,7 @@ IFWL_AdapterWidgetMgr* FWL_GetAdapterWidgetMgr() { return ((CFWL_WidgetMgr*)FWL_GetWidgetMgr())->GetAdapterWidgetMgr();
}
IFWL_WidgetMgr* CFWL_AppImp::GetWidgetMgr() {
- return (IFWL_WidgetMgr*)m_pWidgetMgr;
+ return m_pWidgetMgr;
}
FWL_ERR CFWL_AppImp::SetThemeProvider(IFWL_ThemeProvider* pThemeProvider) {
m_pThemeProvider = pThemeProvider;
diff --git a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp index 5671ff699a..00bebaed90 100644 --- a/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp +++ b/xfa/src/fwl/src/core/fwl_widgetmgrimp.cpp @@ -26,8 +26,7 @@ IFWL_WidgetMgr* FWL_GetWidgetMgr() { CFWL_WidgetMgr::CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative)
: m_dwCapability(0) {
m_pDelegate = new CFWL_WidgetMgrDelegate(this);
- m_pAdapter =
- pAdapterNative->GetWidgetMgr((IFWL_WidgetMgrDelegate*)m_pDelegate);
+ m_pAdapter = pAdapterNative->GetWidgetMgr(m_pDelegate);
FXSYS_assert(m_pAdapter);
CFWL_WidgetMgrItem* pRoot = new CFWL_WidgetMgrItem;
m_mapWidgetItem.SetAt(NULL, pRoot);
diff --git a/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h b/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h index 5cd8510105..b5d59b9dd2 100644 --- a/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h +++ b/xfa/src/fwl/src/core/include/fwl_widgetmgrimp.h @@ -49,20 +49,23 @@ class CFWL_WidgetMgrItem { #endif
};
-class CFWL_WidgetMgr {
+class CFWL_WidgetMgr : public IFWL_WidgetMgr {
public:
CFWL_WidgetMgr(IFWL_AdapterNative* pAdapterNative);
- virtual ~CFWL_WidgetMgr();
- virtual int32_t CountWidgets(IFWL_Widget* pParent = NULL);
- virtual IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL);
- virtual IFWL_Widget* GetWidget(IFWL_Widget* pWidget,
- FWL_WGTRELATION eRelation);
- virtual int32_t GetWidgetIndex(IFWL_Widget* pWidget);
- virtual FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex);
- virtual FX_BOOL IsWidget(void* pObj);
- virtual FWL_ERR RepaintWidget(IFWL_Widget* pWidget,
- const CFX_RectF* pRect = NULL);
- virtual FX_DWORD GetCapability() { return m_dwCapability; }
+ ~CFWL_WidgetMgr() override;
+
+ // IFWL_WidgetMgr:
+ int32_t CountWidgets(IFWL_Widget* pParent = NULL) override;
+ IFWL_Widget* GetWidget(int32_t nIndex, IFWL_Widget* pParent = NULL) override;
+ IFWL_Widget* GetWidget(IFWL_Widget* pWidget,
+ FWL_WGTRELATION eRelation) override;
+ int32_t GetWidgetIndex(IFWL_Widget* pWidget) override;
+ FX_BOOL SetWidgetIndex(IFWL_Widget* pWidget, int32_t nIndex) override;
+ FX_BOOL IsWidget(void* pObj) override;
+ FWL_ERR RepaintWidget(IFWL_Widget* pWidget,
+ const CFX_RectF* pRect = NULL) override;
+ FX_DWORD GetCapability() override { return m_dwCapability; }
+
void AddWidget(IFWL_Widget* pWidget);
void InsertWidget(IFWL_Widget* pParent,
IFWL_Widget* pChild,
@@ -130,16 +133,19 @@ class CFWL_WidgetMgr { CFX_RectF m_rtScreen;
#endif
};
-class CFWL_WidgetMgrDelegate {
+
+class CFWL_WidgetMgrDelegate : public IFWL_WidgetMgrDelegate {
public:
CFWL_WidgetMgrDelegate(CFWL_WidgetMgr* pWidgetMgr);
- virtual ~CFWL_WidgetMgrDelegate() {}
- virtual FWL_ERR OnSetCapability(
- FX_DWORD dwCapability = FWL_WGTMGR_DisableThread);
- virtual int32_t OnProcessMessageToForm(CFWL_Message* pMessage);
- virtual FWL_ERR OnDrawWidget(IFWL_Widget* pWidget,
- CFX_Graphics* pGraphics,
- const CFX_Matrix* pMatrix);
+ ~CFWL_WidgetMgrDelegate() override {}
+
+ // IFWL_WidgetMgrDelegate:
+ FWL_ERR OnSetCapability(
+ FX_DWORD dwCapability = FWL_WGTMGR_DisableThread) override;
+ int32_t OnProcessMessageToForm(CFWL_Message* pMessage) override;
+ FWL_ERR OnDrawWidget(IFWL_Widget* pWidget,
+ CFX_Graphics* pGraphics,
+ const CFX_Matrix* pMatrix) override;
protected:
void DrawChild(IFWL_Widget* pParent,
|