Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(689)

Unified Diff: xfa/fde/css/fde_cssdatatable.cpp

Issue 2072803002: Make code compile with clang_use_chrome_plugin (final) (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fde/css/fde_cssdatatable.h ('k') | xfa/fde/css/fde_cssstyleselector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fde/css/fde_cssdatatable.cpp
diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp
index ac8c4669323ede9c6e6370390162779f57c2fd74..c2767e7eb2d95b672accada48afa1947c1f26f3b 100644
--- a/xfa/fde/css/fde_cssdatatable.cpp
+++ b/xfa/fde/css/fde_cssdatatable.cpp
@@ -795,6 +795,14 @@ CFDE_CSSValueList::CFDE_CSSValueList(IFX_MemoryAllocator* pStaticStore,
m_ppList = (IFDE_CSSValue**)pStaticStore->Alloc(iByteCount);
FXSYS_memcpy(m_ppList, list.GetData(), iByteCount);
}
+
+int32_t CFDE_CSSValueList::CountValues() const {
+ return m_iCount;
+}
+
+IFDE_CSSValue* CFDE_CSSValueList::GetValue(int32_t index) const {
+ return m_ppList[index];
+}
FX_BOOL CFDE_CSSValueListParser::NextValue(FDE_CSSPRIMITIVETYPE& eType,
const FX_WCHAR*& pStart,
int32_t& iLength) {
@@ -896,3 +904,67 @@ int32_t CFDE_CSSValueListParser::SkipTo(FX_WCHAR wch,
}
return m_pCur - pStart;
}
+
+CFDE_CSSPrimitiveValue::CFDE_CSSPrimitiveValue(
+ const CFDE_CSSPrimitiveValue& src) = default;
+
+CFDE_CSSPrimitiveValue::CFDE_CSSPrimitiveValue(FX_ARGB color)
+ : m_eType(FDE_CSSPRIMITIVETYPE_RGB), m_dwColor(color) {}
+
+CFDE_CSSPrimitiveValue::CFDE_CSSPrimitiveValue(FDE_CSSPROPERTYVALUE eValue)
+ : m_eType(FDE_CSSPRIMITIVETYPE_Enum), m_eEnum(eValue) {}
+
+CFDE_CSSPrimitiveValue::CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE eType,
+ FX_FLOAT fValue)
+ : m_eType(eType), m_fNumber(fValue) {}
+
+CFDE_CSSPrimitiveValue::CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE eType,
+ const FX_WCHAR* pValue)
+ : m_eType(eType), m_pString(pValue) {
+ ASSERT(m_pString != nullptr);
+}
+
+CFDE_CSSPrimitiveValue::CFDE_CSSPrimitiveValue(CFDE_CSSFunction* pFunction)
+ : m_eType(FDE_CSSPRIMITIVETYPE_Function), m_pFunction(pFunction) {}
+
+FDE_CSSPRIMITIVETYPE CFDE_CSSPrimitiveValue::GetPrimitiveType() const {
+ return m_eType;
+}
+
+FX_ARGB CFDE_CSSPrimitiveValue::GetRGBColor() const {
+ ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_RGB);
+ return m_dwColor;
+}
+
+FX_FLOAT CFDE_CSSPrimitiveValue::GetFloat() const {
+ ASSERT(m_eType >= FDE_CSSPRIMITIVETYPE_Number &&
+ m_eType <= FDE_CSSPRIMITIVETYPE_PC);
+ return m_fNumber;
+}
+
+const FX_WCHAR* CFDE_CSSPrimitiveValue::GetString(int32_t& iLength) const {
+ ASSERT(m_eType >= FDE_CSSPRIMITIVETYPE_String &&
+ m_eType <= FDE_CSSPRIMITIVETYPE_URI);
+ iLength = FXSYS_wcslen(m_pString);
+ return m_pString;
+}
+
+FDE_CSSPROPERTYVALUE CFDE_CSSPrimitiveValue::GetEnum() const {
+ ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Enum);
+ return m_eEnum;
+}
+
+const FX_WCHAR* CFDE_CSSPrimitiveValue::GetFuncName() const {
+ ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function);
+ return m_pFunction->GetFuncName();
+}
+
+int32_t CFDE_CSSPrimitiveValue::CountArgs() const {
+ ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function);
+ return m_pFunction->CountArgs();
+}
+
+IFDE_CSSValue* CFDE_CSSPrimitiveValue::GetArgs(int32_t index) const {
+ ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function);
+ return m_pFunction->GetArgs(index);
+}
« no previous file with comments | « xfa/fde/css/fde_cssdatatable.h ('k') | xfa/fde/css/fde_cssstyleselector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698