summaryrefslogtreecommitdiff
path: root/xfa/fxfa/parser/cxfa_datadata.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-01-04 10:05:36 -0500
committerChromium commit bot <commit-bot@chromium.org>2018-01-04 16:14:31 +0000
commit72fe435e80807c91dbf8edc41d5bf3ec3c9bd9e4 (patch)
treef171ca51a643ea905908e98daf9bbe99590fdb73 /xfa/fxfa/parser/cxfa_datadata.cpp
parenta0af75cc4d1e50bb2832dc58636043afe565b02b (diff)
downloadpdfium-72fe435e80807c91dbf8edc41d5bf3ec3c9bd9e4.tar.xz
Remove CXFA_DataData
This CL removes the CXFA_DataData base class and the functionality is moved to where it's needed. Change-Id: Ieba31aa924b9b513466144b31f0e1613923c50aa Reviewed-on: https://pdfium-review.googlesource.com/22250 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_datadata.cpp')
-rw-r--r--xfa/fxfa/parser/cxfa_datadata.cpp75
1 files changed, 0 insertions, 75 deletions
diff --git a/xfa/fxfa/parser/cxfa_datadata.cpp b/xfa/fxfa/parser/cxfa_datadata.cpp
deleted file mode 100644
index 76a4651d0d..0000000000
--- a/xfa/fxfa/parser/cxfa_datadata.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2016 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/fxfa/parser/cxfa_datadata.h"
-
-#include "core/fxcrt/fx_extension.h"
-#include "xfa/fxfa/parser/cxfa_measurement.h"
-#include "xfa/fxfa/parser/cxfa_node.h"
-
-// Static.
-FX_ARGB CXFA_DataData::ToColor(const WideStringView& wsValue) {
- uint8_t r = 0, g = 0, b = 0;
- if (wsValue.GetLength() == 0)
- return 0xff000000;
-
- int cc = 0;
- const wchar_t* str = wsValue.unterminated_c_str();
- int len = wsValue.GetLength();
- while (FXSYS_iswspace(str[cc]) && cc < len)
- cc++;
-
- if (cc >= len)
- return 0xff000000;
-
- while (cc < len) {
- if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc]))
- break;
-
- r = r * 10 + str[cc] - '0';
- cc++;
- }
- if (cc < len && str[cc] == ',') {
- cc++;
- while (FXSYS_iswspace(str[cc]) && cc < len)
- cc++;
-
- while (cc < len) {
- if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc]))
- break;
-
- g = g * 10 + str[cc] - '0';
- cc++;
- }
- if (cc < len && str[cc] == ',') {
- cc++;
- while (FXSYS_iswspace(str[cc]) && cc < len)
- cc++;
-
- while (cc < len) {
- if (str[cc] == ',' || !FXSYS_isDecimalDigit(str[cc]))
- break;
-
- b = b * 10 + str[cc] - '0';
- cc++;
- }
- }
- }
- return (0xff << 24) | (r << 16) | (g << 8) | b;
-}
-
-CXFA_DataData::CXFA_DataData(CXFA_Node* pNode) : m_pNode(pNode) {}
-
-CXFA_DataData::~CXFA_DataData() {}
-
-XFA_Element CXFA_DataData::GetElementType() const {
- return m_pNode ? m_pNode->GetElementType() : XFA_Element::Unknown;
-}
-
-pdfium::Optional<float> CXFA_DataData::TryMeasureAsFloat(
- XFA_Attribute attr) const {
- return m_pNode->JSObject()->TryMeasureAsFloat(attr);
-}