diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-11-01 16:04:36 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-11-01 16:04:36 +0000 |
commit | e5434b5531f2c081c1d69f67125b6665070ea969 (patch) | |
tree | 1fa141f20597c62e9f2e2738d438bfaaecc772a3 /xfa/fxfa/parser/cxfa_fill.cpp | |
parent | 3fff90a670d860a7b0319aa0edf8628917d0a122 (diff) | |
download | pdfium-e5434b5531f2c081c1d69f67125b6665070ea969.tar.xz |
Split JS code out of CXFA_Node.
This CL moves JS code out of CXFA_Node and places it into fxjs/cjx_node.
The CXFA_Node then has a CJX_Node as a member and, currently, proxies JS
calls to the CJX_Node member.
Change-Id: Ic5b95184c8fd2347f0bdcfbccfa89bb6b52835b6
Reviewed-on: https://pdfium-review.googlesource.com/17290
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_fill.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_fill.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/xfa/fxfa/parser/cxfa_fill.cpp b/xfa/fxfa/parser/cxfa_fill.cpp index 6b39134126..f3d045ad30 100644 --- a/xfa/fxfa/parser/cxfa_fill.cpp +++ b/xfa/fxfa/parser/cxfa_fill.cpp @@ -13,11 +13,11 @@ CXFA_Fill::CXFA_Fill(CXFA_Node* pNode) : CXFA_Data(pNode) {} CXFA_Fill::~CXFA_Fill() {} int32_t CXFA_Fill::GetPresence() { - return m_pNode->GetEnum(XFA_ATTRIBUTE_Presence); + return m_pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Presence); } void CXFA_Fill::SetColor(FX_ARGB color) { - CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Color); + CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Color); WideString wsColor; int a; int r; @@ -25,13 +25,13 @@ void CXFA_Fill::SetColor(FX_ARGB color) { int b; std::tie(a, r, g, b) = ArgbDecode(color); wsColor.Format(L"%d,%d,%d", r, g, b); - pNode->SetCData(XFA_ATTRIBUTE_Value, wsColor); + pNode->JSNode()->SetCData(XFA_ATTRIBUTE_Value, wsColor); } FX_ARGB CXFA_Fill::GetColor(bool bText) { if (CXFA_Node* pNode = m_pNode->GetChild(0, XFA_Element::Color)) { WideStringView wsColor; - if (pNode->TryCData(XFA_ATTRIBUTE_Value, wsColor, false)) + if (pNode->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false)) return CXFA_Data::ToColor(wsColor); } if (bText) @@ -52,24 +52,24 @@ XFA_Element CXFA_Fill::GetFillType() { } int32_t CXFA_Fill::GetPattern(FX_ARGB& foreColor) { - CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Pattern); + CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Pattern); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { WideStringView wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); foreColor = CXFA_Data::ToColor(wsColor); } else { foreColor = 0xFF000000; } - return pNode->GetEnum(XFA_ATTRIBUTE_Type); + return pNode->JSNode()->GetEnum(XFA_ATTRIBUTE_Type); } int32_t CXFA_Fill::GetStipple(FX_ARGB& stippleColor) { - CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Stipple); + CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Stipple); int32_t eAttr = 50; - pNode->TryInteger(XFA_ATTRIBUTE_Rate, eAttr); + pNode->JSNode()->TryInteger(XFA_ATTRIBUTE_Rate, eAttr); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { WideStringView wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); stippleColor = CXFA_Data::ToColor(wsColor); } else { stippleColor = 0xFF000000; @@ -78,12 +78,12 @@ int32_t CXFA_Fill::GetStipple(FX_ARGB& stippleColor) { } int32_t CXFA_Fill::GetLinear(FX_ARGB& endColor) { - CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Linear); + CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Linear); XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToRight; - pNode->TryEnum(XFA_ATTRIBUTE_Type, eAttr); + pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { WideStringView wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); endColor = CXFA_Data::ToColor(wsColor); } else { endColor = 0xFF000000; @@ -92,12 +92,12 @@ int32_t CXFA_Fill::GetLinear(FX_ARGB& endColor) { } int32_t CXFA_Fill::GetRadial(FX_ARGB& endColor) { - CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Radial); + CXFA_Node* pNode = m_pNode->JSNode()->GetProperty(0, XFA_Element::Radial); XFA_ATTRIBUTEENUM eAttr = XFA_ATTRIBUTEENUM_ToEdge; - pNode->TryEnum(XFA_ATTRIBUTE_Type, eAttr); + pNode->JSNode()->TryEnum(XFA_ATTRIBUTE_Type, eAttr); if (CXFA_Node* pColor = pNode->GetChild(0, XFA_Element::Color)) { WideStringView wsColor; - pColor->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); + pColor->JSNode()->TryCData(XFA_ATTRIBUTE_Value, wsColor, false); endColor = CXFA_Data::ToColor(wsColor); } else { endColor = 0xFF000000; |