Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: xfa/src/fwl/src/core/fwl_gridimp.cpp

Issue 1458173002: Fix CFWL_WidgetImpDelegate hierarchy. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: xfa/src/fwl/src/core/fwl_gridimp.cpp
diff --git a/xfa/src/fwl/src/core/fwl_gridimp.cpp b/xfa/src/fwl/src/core/fwl_gridimp.cpp
index 492828854243fe2c02e837624f3e71892407d79e..251464e80f98a847ba45a2e6377f04065f03c6cf 100644
--- a/xfa/src/fwl/src/core/fwl_gridimp.cpp
+++ b/xfa/src/fwl/src/core/fwl_gridimp.cpp
@@ -170,10 +170,8 @@ CFWL_GridImp::~CFWL_GridImp() {
delete pInfo;
}
m_mapWidgetInfo.RemoveAll();
- if (m_pDelegate) {
- delete (CFWL_GridImpDelegate*)m_pDelegate;
- m_pDelegate = NULL;
- }
+ delete m_pDelegate;
+ m_pDelegate = nullptr;
}
FWL_ERR CFWL_GridImp::GetClassName(CFX_WideString& wsClass) const {
wsClass = FWL_CLASS_Grid;
@@ -185,16 +183,14 @@ FX_DWORD CFWL_GridImp::GetClassID() const {
FWL_ERR CFWL_GridImp::Initialize() {
_FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(CFWL_ContentImp::Initialize(),
FWL_ERR_Indefinite);
- m_pDelegate = (IFWL_WidgetDelegate*)new CFWL_GridImpDelegate(this);
+ m_pDelegate = new CFWL_GridImpDelegate(this);
return FWL_ERR_Succeeded;
}
FWL_ERR CFWL_GridImp::Finalize() {
_FWL_ERR_CHECK_RETURN_VALUE_IF_FAIL(CFWL_ContentImp::Finalize(),
FWL_ERR_Indefinite);
- if (m_pDelegate) {
- delete (CFWL_GridImpDelegate*)m_pDelegate;
- m_pDelegate = NULL;
- }
+ delete m_pDelegate;
+ m_pDelegate = nullptr;
return FWL_ERR_Succeeded;
}
FWL_ERR CFWL_GridImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {

Powered by Google App Engine
This is Rietveld 408576698