summaryrefslogtreecommitdiff
path: root/xfa/fxfa/cxfa_widgetacc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-16 15:49:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-16 15:49:16 +0000
commit316dd2fcd64d0cda1e1b2cdc39ca541a57766b35 (patch)
treeaf3745a818839a7cebc92927f9e115c429bbbe0b /xfa/fxfa/cxfa_widgetacc.cpp
parentd021ad2f6306ae9d7b2ab5acf225c3bd8e957f8f (diff)
downloadpdfium-316dd2fcd64d0cda1e1b2cdc39ca541a57766b35.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fxfa/cxfa_widgetacc.cpp')
-rw-r--r--xfa/fxfa/cxfa_widgetacc.cpp11
1 files changed, 7 insertions, 4 deletions
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);