From c8619c8d1cebb6b64db248ec89db98ab4513ad3c Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Tue, 14 Nov 2017 18:48:23 +0000 Subject: Rename a few more data classes. The CXFA_Data nd CXFA_ExData files are part of the data hierarchy. They need to be renamed to not clash with XFA node names. Change-Id: I1ad11dd92edf26912f845aec21c57a9d23e51fcf Reviewed-on: https://pdfium-review.googlesource.com/18270 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- xfa/fxfa/parser/cxfa_data.cpp | 82 ------------------------------------------- 1 file changed, 82 deletions(-) delete mode 100644 xfa/fxfa/parser/cxfa_data.cpp (limited to 'xfa/fxfa/parser/cxfa_data.cpp') diff --git a/xfa/fxfa/parser/cxfa_data.cpp b/xfa/fxfa/parser/cxfa_data.cpp deleted file mode 100644 index d6b6700854..0000000000 --- a/xfa/fxfa/parser/cxfa_data.cpp +++ /dev/null @@ -1,82 +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_data.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_Data::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; -} - -XFA_Element CXFA_Data::GetElementType() const { - return m_pNode ? m_pNode->GetElementType() : XFA_Element::Unknown; -} - -bool CXFA_Data::TryMeasure(XFA_Attribute eAttr, - float& fValue, - bool bUseDefault) const { - CXFA_Measurement ms; - if (m_pNode->JSNode()->TryMeasure(eAttr, ms, bUseDefault)) { - fValue = ms.ToUnit(XFA_Unit::Pt); - return true; - } - return false; -} - -bool CXFA_Data::SetMeasure(XFA_Attribute eAttr, float fValue) { - CXFA_Measurement ms(fValue, XFA_Unit::Pt); - return m_pNode->JSNode()->SetMeasure(eAttr, ms, false); -} -- cgit v1.2.3