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_widgetacc.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/cxfa_widgetacc.cpp') diff --git a/xfa/fxfa/cxfa_widgetacc.cpp b/xfa/fxfa/cxfa_widgetacc.cpp index d61d8989fb..407517f564 100644 --- a/xfa/fxfa/cxfa_widgetacc.cpp +++ b/xfa/fxfa/cxfa_widgetacc.cpp @@ -99,7 +99,7 @@ class CXFA_ImageLayoutData : public CXFA_WidgetLayoutData { if (!value) return false; - CXFA_Image* image = value->GetImage(); + CXFA_Image* image = value->GetImageIfExists(); if (!image) return false; @@ -156,7 +156,10 @@ class CXFA_ImageEditData : public CXFA_FieldLayoutData { if (!value) return false; - CXFA_Image* image = value->GetImage(); + CXFA_Image* image = value->GetImageIfExists(); + if (!image) + return false; + pAcc->SetImageEditImage(XFA_LoadImageData(doc, image, m_bNamedImage, m_iImageXDpi, m_iImageYDpi)); return !!m_pDIBitmap; @@ -376,7 +379,7 @@ void CXFA_WidgetAcc::ResetData() { switch (eUIType) { case XFA_Element::ImageEdit: { CXFA_Value* imageValue = m_pNode->GetDefaultValueIfExists(); - CXFA_Image* image = imageValue ? imageValue->GetImage() : nullptr; + CXFA_Image* image = imageValue ? imageValue->GetImageIfExists() : nullptr; WideString wsContentType, wsHref; if (image) { wsValue = image->GetContent(); @@ -440,7 +443,7 @@ void CXFA_WidgetAcc::SetImageEdit(const WideString& wsContentType, const WideString& wsHref, const WideString& wsData) { CXFA_Value* formValue = m_pNode->GetFormValueIfExists(); - CXFA_Image* image = formValue ? formValue->GetImage() : nullptr; + CXFA_Image* image = formValue ? formValue->GetImageIfExists() : nullptr; if (image) { image->SetContentType(WideString(wsContentType)); image->SetHref(wsHref); -- cgit v1.2.3