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

Unified Diff: xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp

Issue 1503583003: Remove C-Style casts in severl other fwl_...imp.cpp files (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/basewidget/fwl_pushbuttonimp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp
index 3f730d9ee769f1eef52b0466eb6161edd040b1d7..6df34d9d61fd153b5fa8c8e6f8af67bfbb7122dd 100644
--- a/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_pushbuttonimp.cpp
@@ -67,7 +67,7 @@ FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
}
CFX_WideString wsCaption;
IFWL_PushButtonDP* pData =
- (IFWL_PushButtonDP*)m_pProperties->m_pDataProvider;
+ static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider);
if (pData) {
pData->GetCaption(m_pInterface, wsCaption);
}
@@ -77,7 +77,7 @@ FWL_ERR CFWL_PushButtonImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
rect.Set(0, 0, sz.x, sz.y);
}
FX_FLOAT* fcaption =
- (FX_FLOAT*)GetThemeCapacity(FWL_WGTCAPACITY_PSB_Margin);
+ static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_PSB_Margin));
rect.Inflate(*fcaption, *fcaption);
CFWL_WidgetImp::GetWidgetRect(rect, TRUE);
} else {
@@ -102,7 +102,8 @@ FWL_ERR CFWL_PushButtonImp::Update() {
UpdateTextOutStyles();
GetClientRect(m_rtClient);
m_rtCaption = m_rtClient;
- FX_FLOAT* fcaption = (FX_FLOAT*)GetThemeCapacity(FWL_WGTCAPACITY_PSB_Margin);
+ FX_FLOAT* fcaption =
+ static_cast<FX_FLOAT*>(GetThemeCapacity(FWL_WGTCAPACITY_PSB_Margin));
m_rtCaption.Inflate(-*fcaption, -*fcaption);
return FWL_ERR_Succeeded;
}
@@ -112,7 +113,8 @@ FWL_ERR CFWL_PushButtonImp::DrawWidget(CFX_Graphics* pGraphics,
return FWL_ERR_Indefinite;
if (!m_pProperties->m_pThemeProvider)
return FWL_ERR_Indefinite;
- IFWL_PushButtonDP* pData = (IFWL_PushButtonDP*)m_pProperties->m_pDataProvider;
+ IFWL_PushButtonDP* pData =
+ static_cast<IFWL_PushButtonDP*>(m_pProperties->m_pDataProvider);
CFX_DIBitmap* pPicture = NULL;
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
if (HasBorder()) {
@@ -415,7 +417,7 @@ int32_t CFWL_PushButtonImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
break;
}
case FWL_MSGHASH_Mouse: {
- CFWL_MsgMouse* pMsg = (CFWL_MsgMouse*)pMessage;
+ CFWL_MsgMouse* pMsg = static_cast<CFWL_MsgMouse*>(pMessage);
FX_DWORD dwCmd = pMsg->m_dwCmd;
switch (dwCmd) {
case FWL_MSGMOUSECMD_LButtonDown: {
@@ -439,9 +441,9 @@ int32_t CFWL_PushButtonImpDelegate::OnProcessMessage(CFWL_Message* pMessage) {
break;
}
case FWL_MSGHASH_Key: {
- CFWL_MsgKey* pKey = (CFWL_MsgKey*)pMessage;
+ CFWL_MsgKey* pKey = static_cast<CFWL_MsgKey*>(pMessage);
if (pKey->m_dwCmd == FWL_MSGKEYCMD_KeyDown) {
- OnKeyDown((CFWL_MsgKey*)pKey);
+ OnKeyDown(pKey);
}
break;
}
@@ -489,7 +491,7 @@ void CFWL_PushButtonImpDelegate::OnLButtonUp(CFWL_MsgMouse* pMsg) {
}
if (m_pOwner->m_rtClient.Contains(pMsg->m_fx, pMsg->m_fy)) {
CFWL_EvtClick wmClick;
- wmClick.m_pSrcTarget = (IFWL_PushButton*)m_pOwner->m_pInterface;
+ wmClick.m_pSrcTarget = m_pOwner->m_pInterface;
m_pOwner->DispatchEvent(&wmClick);
}
m_pOwner->Repaint(&m_pOwner->m_rtClient);
@@ -542,7 +544,7 @@ void CFWL_PushButtonImpDelegate::OnKeyDown(CFWL_MsgKey* pMsg) {
wmMouse.m_dwCmd = FWL_MSGMOUSECMD_LButtonUp;
m_pOwner->DispatchEvent(&wmMouse);
CFWL_EvtClick wmClick;
- wmClick.m_pSrcTarget = (IFWL_PushButton*)m_pOwner->m_pInterface;
+ wmClick.m_pSrcTarget = m_pOwner->m_pInterface;
m_pOwner->DispatchEvent(&wmClick);
return;
}

Powered by Google App Engine
This is Rietveld 408576698