diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-01-16 15:15:05 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-16 15:15:05 +0000 |
commit | d3ae179dab3f63625e5dd3ddf0aa33176f8ee65c (patch) | |
tree | 151c01afa3404c846b1ab323607b244427b57ae9 /xfa/fxfa/parser/cxfa_radial.cpp | |
parent | b36c7e1f84ea7402b7576d2a03a219d469735434 (diff) | |
download | pdfium-d3ae179dab3f63625e5dd3ddf0aa33176f8ee65c.tar.xz |
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 <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_radial.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_radial.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xfa/fxfa/parser/cxfa_radial.cpp b/xfa/fxfa/parser/cxfa_radial.cpp index 5630943c58..80753b3803 100644 --- a/xfa/fxfa/parser/cxfa_radial.cpp +++ b/xfa/fxfa/parser/cxfa_radial.cpp @@ -8,6 +8,7 @@ #include "fxjs/xfa/cjx_radial.h" #include "third_party/base/ptr_util.h" +#include "xfa/fxfa/parser/cxfa_color.h" namespace { @@ -38,3 +39,13 @@ CXFA_Radial::CXFA_Radial(CXFA_Document* doc, XFA_PacketType packet) pdfium::MakeUnique<CJX_Radial>(this)) {} CXFA_Radial::~CXFA_Radial() {} + +bool CXFA_Radial::IsToEdge() { + return JSObject() + ->TryEnum(XFA_Attribute::Type, true) + .value_or(XFA_AttributeEnum::ToEdge) == XFA_AttributeEnum::ToEdge; +} + +CXFA_Color* CXFA_Radial::GetColorIfExists() { + return GetChild<CXFA_Color>(0, XFA_Element::Color, false); +} |