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

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

Issue 1499853003: Remove C-Style casts in fwl_{barcode,caret,checkbox,combobox}imp.cpp (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Rebase 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_barcodeimp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp
index 18b7b4c39f2d72da0ec32a6e82cd8a1722c16852..e6d8d164b8a16e3763a367dad360d41f931f5848 100644
--- a/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_barcodeimp.cpp
@@ -102,7 +102,8 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() {
return;
m_dwStatus = 0;
CreateBarcodeEngine();
- IFWL_BarcodeDP* pData = (IFWL_BarcodeDP*)m_pProperties->m_pDataProvider;
+ IFWL_BarcodeDP* pData =
+ static_cast<IFWL_BarcodeDP*>(m_pProperties->m_pDataProvider);
if (!pData)
return;
if (!m_pBarcodeEngine)
@@ -113,18 +114,20 @@ void CFWL_BarcodeImp::GenerateBarcodeImageCache() {
CFWL_ThemePart part;
part.m_pWidget = m_pInterface;
IFWL_ThemeProvider* pTheme = GetAvailableTheme();
- IFX_Font* pFont = (IFX_Font*)pTheme->GetCapacity(&part, FWL_WGTCAPACITY_Font);
- CFX_Font* pCXFont = (CFX_Font*)(pFont ? pFont->GetDevFont() : NULL);
+ IFX_Font* pFont =
+ static_cast<IFX_Font*>(pTheme->GetCapacity(&part, FWL_WGTCAPACITY_Font));
+ CFX_Font* pCXFont =
+ pFont ? static_cast<CFX_Font*>(pFont->GetDevFont()) : nullptr;
if (pCXFont) {
m_pBarcodeEngine->SetFont(pCXFont);
}
- FX_FLOAT* pFontSize =
- (FX_FLOAT*)pTheme->GetCapacity(&part, FWL_WGTCAPACITY_FontSize);
+ FX_FLOAT* pFontSize = static_cast<FX_FLOAT*>(
+ pTheme->GetCapacity(&part, FWL_WGTCAPACITY_FontSize));
if (pFontSize) {
m_pBarcodeEngine->SetFontSize(*pFontSize);
}
- FX_ARGB* pFontColor =
- (FX_ARGB*)pTheme->GetCapacity(&part, FWL_WGTCAPACITY_TextColor);
+ FX_ARGB* pFontColor = static_cast<FX_ARGB*>(
+ pTheme->GetCapacity(&part, FWL_WGTCAPACITY_TextColor));
if (pFontColor) {
m_pBarcodeEngine->SetFontColor(*pFontColor);
}
@@ -215,7 +218,7 @@ CFWL_BarcodeImpDelegate::CFWL_BarcodeImpDelegate(CFWL_BarcodeImp* pOwner)
FWL_ERR CFWL_BarcodeImpDelegate::OnProcessEvent(CFWL_Event* pEvent) {
FX_DWORD dwFlag = pEvent->GetClassID();
if (dwFlag == FWL_EVTHASH_EDT_TextChanged) {
- CFWL_BarcodeImp* pOwner = (CFWL_BarcodeImp*)m_pOwner;
+ CFWL_BarcodeImp* pOwner = static_cast<CFWL_BarcodeImp*>(m_pOwner);
pOwner->ReleaseBarcodeEngine();
pOwner->m_dwStatus = XFA_BCS_NeedUpdate;
}
« no previous file with comments | « no previous file | xfa/src/fwl/src/basewidget/fwl_caretimp.cpp » ('j') | xfa/src/fwl/src/basewidget/include/fwl_caretimp.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698