From 316dd2fcd64d0cda1e1b2cdc39ca541a57766b35 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 16 Jan 2018 15:49:16 +0000 Subject: Rename CXFA_Value methods for clarity This CL marks the methods in CXFA_Value to make it clear which can return nullptr and updates callsites as needed. Change-Id: If1f794bcbbddaa57a1efdd67195df58a77b4373a Reviewed-on: https://pdfium-review.googlesource.com/22773 Commit-Queue: dsinclair Reviewed-by: Ryan Harrison --- xfa/fxfa/cxfa_ffimage.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xfa/fxfa/cxfa_ffimage.cpp') diff --git a/xfa/fxfa/cxfa_ffimage.cpp b/xfa/fxfa/cxfa_ffimage.cpp index 3a5a63a1e4..b4a0d32981 100644 --- a/xfa/fxfa/cxfa_ffimage.cpp +++ b/xfa/fxfa/cxfa_ffimage.cpp @@ -70,8 +70,11 @@ void CXFA_FFImage::RenderWidget(CXFA_Graphics* pGS, int32_t iImageXDpi = 0; int32_t iImageYDpi = 0; m_pNode->GetWidgetAcc()->GetImageDpi(iImageXDpi, iImageYDpi); + auto* value = m_pNode->GetFormValueIfExists(); - CXFA_Image* image = value ? value->GetImage() : nullptr; - XFA_DrawImage(pGS, rtImage, mtRotate, pDIBitmap, image->GetAspect(), - iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); + CXFA_Image* image = value ? value->GetImageIfExists() : nullptr; + if (image) { + XFA_DrawImage(pGS, rtImage, mtRotate, pDIBitmap, image->GetAspect(), + iImageXDpi, iImageYDpi, iHorzAlign, iVertAlign); + } } -- cgit v1.2.3