summaryrefslogtreecommitdiff
path: root/xfa/fde/css/fde_cssdatatable.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-06-18 06:25:37 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-18 06:25:37 -0700
commiteec3a366adbfada36b98f1de651546ee09df8fc0 (patch)
tree794aa8c69392b60d8737a8a5b424732b98bdd4b4 /xfa/fde/css/fde_cssdatatable.cpp
parent4ce94e118d66064715de5baebeb4b2b580dcac66 (diff)
downloadpdfium-eec3a366adbfada36b98f1de651546ee09df8fc0.tar.xz
Make code compile with clang_use_chrome_plugin (final)
This change mainly contains files in xfa/ and fxjse/ directories which were not covered by previous changes. This is part of the efforts to make PDFium code compilable by Clang chromium style plugins. After this change, PDFium can be compiled with "clang_use_chrome_plugin=true" for GN build. Since clang_use_chrome_plugin is true by default, we no longer need to set this parameter explicitly. The changes are mainly the following: -- move inline constructor/destructor of complex class/struct out-of-line; -- add constructor/destructor of complex class/struct if not explicitly defined; -- add explicit out-of-line copy constructor when needed; -- move inline virtual functions out-of-line; -- Properly mark virtual functions with 'override'; -- some minor cleanups; BUG=pdfium:469 Review-Url: https://codereview.chromium.org/2072803002
Diffstat (limited to 'xfa/fde/css/fde_cssdatatable.cpp')
-rw-r--r--xfa/fde/css/fde_cssdatatable.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/xfa/fde/css/fde_cssdatatable.cpp b/xfa/fde/css/fde_cssdatatable.cpp
index ac8c466932..c2767e7eb2 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);
+}