From d3ae179dab3f63625e5dd3ddf0aa33176f8ee65c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 16 Jan 2018 15:15:05 +0000 Subject: Cleanup CXFA_Fill This CL cleans up the CXFA_Fill internal getters to handle nullptr returns correctly and moves some of the logic to the specific XFA classes. Change-Id: Icac487105a026a25cc9981d00fbc152e459ad0b8 Reviewed-on: https://pdfium-review.googlesource.com/22770 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/parser/cxfa_pattern.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xfa/fxfa/parser/cxfa_pattern.cpp') diff --git a/xfa/fxfa/parser/cxfa_pattern.cpp b/xfa/fxfa/parser/cxfa_pattern.cpp index 7328fd254c..3102f77beb 100644 --- a/xfa/fxfa/parser/cxfa_pattern.cpp +++ b/xfa/fxfa/parser/cxfa_pattern.cpp @@ -8,6 +8,7 @@ #include "fxjs/xfa/cjx_pattern.h" #include "third_party/base/ptr_util.h" +#include "xfa/fxfa/parser/cxfa_color.h" namespace { @@ -38,3 +39,11 @@ CXFA_Pattern::CXFA_Pattern(CXFA_Document* doc, XFA_PacketType packet) pdfium::MakeUnique(this)) {} CXFA_Pattern::~CXFA_Pattern() {} + +CXFA_Color* CXFA_Pattern::GetColorIfExists() { + return GetChild(0, XFA_Element::Color, false); +} + +XFA_AttributeEnum CXFA_Pattern::GetType() { + return JSObject()->GetEnum(XFA_Attribute::Type); +} -- cgit v1.2.3