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

Unified Diff: xfa/src/fwl/src/basewidget/fwl_pictureboximp.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_pictureboximp.cpp
diff --git a/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp b/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp
index 625080003b1fb854aa05350715e324024bd6fee3..c0b2f67e49587e51a492d160476e2d8a406fda87 100644
--- a/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp
+++ b/xfa/src/fwl/src/basewidget/fwl_pictureboximp.cpp
@@ -66,8 +66,9 @@ FWL_ERR CFWL_PictureBoxImp::GetWidgetRect(CFX_RectF& rect, FX_BOOL bAutoSize) {
rect.Set(0, 0, 0, 0);
if (!m_pProperties->m_pDataProvider)
return FWL_ERR_Indefinite;
- CFX_DIBitmap* pBitmap = ((IFWL_PictureBoxDP*)m_pProperties->m_pDataProvider)
- ->GetPicture(m_pInterface);
+ CFX_DIBitmap* pBitmap =
+ static_cast<IFWL_PictureBoxDP*>(m_pProperties->m_pDataProvider)
+ ->GetPicture(m_pInterface);
if (pBitmap) {
rect.Set(0, 0, (FX_FLOAT)pBitmap->GetWidth(),
(FX_FLOAT)pBitmap->GetHeight());
@@ -107,16 +108,17 @@ FWL_ERR CFWL_PictureBoxImp::DrawWidget(CFX_Graphics* pGraphics,
void CFWL_PictureBoxImp::DrawBkground(CFX_Graphics* pGraphics,
IFWL_ThemeProvider* pTheme,
const CFX_Matrix* pMatrix) {
- if (!m_pProperties->m_pDataProvider)
+ IFWL_PictureBoxDP* pPictureDP =
+ static_cast<IFWL_PictureBoxDP*>(m_pProperties->m_pDataProvider);
+ if (!pPictureDP)
return;
- CFX_DIBitmap* pPicture = ((IFWL_PictureBoxDP*)m_pProperties->m_pDataProvider)
- ->GetPicture(m_pInterface);
+
+ CFX_DIBitmap* pPicture = pPictureDP->GetPicture(m_pInterface);
CFX_Matrix matrix;
- ((IFWL_PictureBoxDP*)m_pProperties->m_pDataProvider)
- ->GetMatrix(m_pInterface, matrix);
- if (!pPicture) {
+ pPictureDP->GetMatrix(m_pInterface, matrix);
+ if (!pPicture)
return;
- }
+
matrix.Concat(*pMatrix);
FX_FLOAT fx = (FX_FLOAT)pPicture->GetWidth();
FX_FLOAT fy = (FX_FLOAT)pPicture->GetHeight();

Powered by Google App Engine
This is Rietveld 408576698