diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-12-14 21:04:13 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-12-14 21:04:13 +0000 |
commit | 8eb2722e764fff0a39d0d1dc0c59473aa938b31f (patch) | |
tree | 0141be0ac4398c1c57b5ab2ed1ca0a77b1f11dc2 /xfa/fxfa/parser/cxfa_filldata.cpp | |
parent | df4f30eaaa469c3703118f89579d506209a49237 (diff) | |
download | pdfium-8eb2722e764fff0a39d0d1dc0c59473aa938b31f.tar.xz |
Add type information to CJX_Object::GetProperty
This CL adds a type template to the CJX_Object::GetProperty method so we
can have the correct types returned.
Change-Id: Ieda8ec4bd31d26a1e71af30f08b48eb826f5993d
Reviewed-on: https://pdfium-review.googlesource.com/21250
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_filldata.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_filldata.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/xfa/fxfa/parser/cxfa_filldata.cpp b/xfa/fxfa/parser/cxfa_filldata.cpp index 98df0aa3a4..067d75246c 100644 --- a/xfa/fxfa/parser/cxfa_filldata.cpp +++ b/xfa/fxfa/parser/cxfa_filldata.cpp @@ -7,7 +7,11 @@ #include "xfa/fxfa/parser/cxfa_filldata.h" #include "xfa/fxfa/parser/cxfa_color.h" +#include "xfa/fxfa/parser/cxfa_linear.h" #include "xfa/fxfa/parser/cxfa_node.h" +#include "xfa/fxfa/parser/cxfa_pattern.h" +#include "xfa/fxfa/parser/cxfa_radial.h" +#include "xfa/fxfa/parser/cxfa_stipple.h" CXFA_FillData::CXFA_FillData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} @@ -21,8 +25,8 @@ bool CXFA_FillData::IsVisible() const { } void CXFA_FillData::SetColor(FX_ARGB color) { - CXFA_Node* pNode = - m_pNode->JSObject()->GetProperty(0, XFA_Element::Color, true); + CXFA_Color* pNode = + m_pNode->JSObject()->GetProperty<CXFA_Color>(0, XFA_Element::Color, true); int a; int r; int g; @@ -127,18 +131,22 @@ FX_ARGB CXFA_FillData::GetRadialColor() const { return 0xFF000000; } -CXFA_Node* CXFA_FillData::GetStipple() const { - return m_pNode->JSObject()->GetProperty(0, XFA_Element::Stipple, true); +CXFA_Stipple* CXFA_FillData::GetStipple() const { + return m_pNode->JSObject()->GetProperty<CXFA_Stipple>(0, XFA_Element::Stipple, + true); } -CXFA_Node* CXFA_FillData::GetRadial() const { - return m_pNode->JSObject()->GetProperty(0, XFA_Element::Radial, true); +CXFA_Radial* CXFA_FillData::GetRadial() const { + return m_pNode->JSObject()->GetProperty<CXFA_Radial>(0, XFA_Element::Radial, + true); } -CXFA_Node* CXFA_FillData::GetLinear() const { - return m_pNode->JSObject()->GetProperty(0, XFA_Element::Linear, true); +CXFA_Linear* CXFA_FillData::GetLinear() const { + return m_pNode->JSObject()->GetProperty<CXFA_Linear>(0, XFA_Element::Linear, + true); } -CXFA_Node* CXFA_FillData::GetPattern() const { - return m_pNode->JSObject()->GetProperty(0, XFA_Element::Pattern, true); +CXFA_Pattern* CXFA_FillData::GetPattern() const { + return m_pNode->JSObject()->GetProperty<CXFA_Pattern>(0, XFA_Element::Pattern, + true); } |