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

Unified Diff: xfa/src/fwl/src/lightwidget/widget.cpp

Issue 1512423003: Convert last batch of casts in fwl. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years 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/lightwidget/widget.cpp
diff --git a/xfa/src/fwl/src/lightwidget/widget.cpp b/xfa/src/fwl/src/lightwidget/widget.cpp
index b3e5953a2cf9c37158dfd88d079c08acbb0d0a96..6cb6fa77d9fbbcc7281ccbae200c9900a31e42e6 100644
--- a/xfa/src/fwl/src/lightwidget/widget.cpp
+++ b/xfa/src/fwl/src/lightwidget/widget.cpp
@@ -75,7 +75,7 @@ CFWL_Widget* CFWL_Widget::GetParent() {
return NULL;
IFWL_Widget* parent = m_pIface->GetParent();
if (parent) {
- return (CFWL_Widget*)parent->GetPrivateData(gs_pFWLWidget);
+ return static_cast<CFWL_Widget*>(parent->GetPrivateData(gs_pFWLWidget));
}
return NULL;
}
@@ -193,7 +193,7 @@ IFWL_WidgetDelegate* CFWL_Widget::SetDelegate(IFWL_WidgetDelegate* pDelegate) {
CFWL_Widget::CFWL_Widget()
: m_pIface(NULL), m_pDelegate(NULL), m_pProperties(NULL) {
m_pProperties = new CFWL_WidgetProperties;
- m_pWidgetMgr = (CFWL_WidgetMgr*)FWL_GetWidgetMgr();
+ m_pWidgetMgr = static_cast<CFWL_WidgetMgr*>(FWL_GetWidgetMgr());
FXSYS_assert(m_pWidgetMgr != NULL);
}
CFWL_Widget::~CFWL_Widget() {
@@ -219,15 +219,15 @@ FWL_ERR CFWL_Widget::SetFocus(FX_BOOL bFocus) {
if (!m_pIface)
return FWL_ERR_Indefinite;
IFWL_NoteThread* pThread = m_pIface->GetOwnerThread();
- if (!m_pIface)
Tom Sepez 2015/12/10 22:40:35 Ooops.
+ if (!pThread)
return FWL_ERR_Indefinite;
IFWL_NoteDriver* pDriver = pThread->GetNoteDriver();
- if (!m_pIface)
+ if (!pDriver)
return FWL_ERR_Indefinite;
if (bFocus) {
pDriver->SetFocus(m_pIface);
} else {
- if (((CFWL_NoteDriver*)pDriver)->GetFocus() == m_pIface) {
+ if (pDriver->GetFocus() == m_pIface) {
pDriver->SetFocus(NULL);
}
}
@@ -237,10 +237,10 @@ FWL_ERR CFWL_Widget::SetGrab(FX_BOOL bSet) {
if (!m_pIface)
return FWL_ERR_Indefinite;
IFWL_NoteThread* pThread = m_pIface->GetOwnerThread();
- if (!m_pIface)
+ if (!pThread)
return FWL_ERR_Indefinite;
- CFWL_NoteDriver* pDriver = (CFWL_NoteDriver*)pThread->GetNoteDriver();
- if (!m_pIface)
+ IFWL_NoteDriver* pDriver = pThread->GetNoteDriver();
+ if (!pDriver)
return FWL_ERR_Indefinite;
pDriver->SetGrab(m_pIface, bSet);
return FWL_ERR_Succeeded;

Powered by Google App Engine
This is Rietveld 408576698