summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-03 16:23:03 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-03 21:50:51 +0000
commit8afa22d5701a6c47b3f34267a2c52948efc3d301 (patch)
treeeaa6e06fe2abb5c7cf09c3bd01e1ab89b5909b1f /xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
parent4f88617ad2a4d352af87b95c2f7293d12e7bd2c8 (diff)
downloadpdfium-8afa22d5701a6c47b3f34267a2c52948efc3d301.tar.xz
Fold CXFA_ImageData into CXFA_Image
This CL folds the CXFA_ImageData wrapper into CXFA_Image. Change-Id: I36596abc4dff7d17dc6ee13a857a084f41164c7a Reviewed-on: https://pdfium-review.googlesource.com/22190 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/xfa_document_datamerger_imp.cpp')
-rw-r--r--xfa/fxfa/parser/xfa_document_datamerger_imp.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
index 5a36083e88..c98597f78e 100644
--- a/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_datamerger_imp.cpp
@@ -19,6 +19,7 @@
#include "xfa/fxfa/parser/cxfa_datagroup.h"
#include "xfa/fxfa/parser/cxfa_document.h"
#include "xfa/fxfa/parser/cxfa_form.h"
+#include "xfa/fxfa/parser/cxfa_image.h"
#include "xfa/fxfa/parser/cxfa_items.h"
#include "xfa/fxfa/parser/cxfa_layoutprocessor.h"
#include "xfa/fxfa/parser/cxfa_localemgr.h"
@@ -137,14 +138,13 @@ void CreateDataBinding(CXFA_Node* pFormNode,
WideString wsValue;
switch (eUIType) {
case XFA_Element::ImageEdit: {
- CXFA_ImageData imageData =
- defValue ? defValue->GetImageData() : CXFA_ImageData(nullptr);
+ CXFA_Image* image = defValue ? defValue->GetImage() : nullptr;
WideString wsContentType;
WideString wsHref;
- if (imageData.HasValidNode()) {
- wsValue = imageData.GetContent();
- wsContentType = imageData.GetContentType();
- wsHref = imageData.GetHref();
+ if (image) {
+ wsValue = image->GetContent();
+ wsContentType = image->GetContentType();
+ wsHref = image->GetHref();
}
CFX_XMLElement* pXMLDataElement =
static_cast<CFX_XMLElement*>(pDataNode->GetXMLMappingNode());
@@ -290,9 +290,8 @@ void CreateDataBinding(CXFA_Node* pFormNode,
case XFA_Element::ImageEdit: {
FormValueNode_SetChildContent(defValue, wsNormalizeValue,
XFA_Element::Image);
- CXFA_ImageData imageData =
- defValue ? defValue->GetImageData() : CXFA_ImageData(nullptr);
- if (imageData.HasValidNode()) {
+ CXFA_Image* image = defValue ? defValue->GetImage() : nullptr;
+ if (image) {
CFX_XMLElement* pXMLDataElement =
static_cast<CFX_XMLElement*>(pDataNode->GetXMLMappingNode());
ASSERT(pXMLDataElement);
@@ -302,12 +301,12 @@ void CreateDataBinding(CXFA_Node* pFormNode,
if (!wsContentType.IsEmpty()) {
pDataNode->JSObject()->SetCData(XFA_Attribute::ContentType,
wsContentType, false, false);
- imageData.SetContentType(wsContentType);
+ image->SetContentType(wsContentType);
}
WideString wsHref = pXMLDataElement->GetString(L"href");
if (!wsHref.IsEmpty())
- imageData.SetHref(wsHref);
+ image->SetHref(wsHref);
}
break;
}