summaryrefslogtreecommitdiff
path: root/xfa/fde/css/fde_cssdatatable.h
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.h
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.h')
-rw-r--r--xfa/fde/css/fde_cssdatatable.h76
1 files changed, 25 insertions, 51 deletions
diff --git a/xfa/fde/css/fde_cssdatatable.h b/xfa/fde/css/fde_cssdatatable.h
index d61ff09ae7..252efdce50 100644
--- a/xfa/fde/css/fde_cssdatatable.h
+++ b/xfa/fde/css/fde_cssdatatable.h
@@ -27,56 +27,26 @@ class CFDE_CSSFunction : public CFX_Target {
IFDE_CSSValueList* m_pArgList;
const FX_WCHAR* m_pszFuncName;
};
+
class CFDE_CSSPrimitiveValue : public IFDE_CSSPrimitiveValue,
public CFX_Target {
public:
- CFDE_CSSPrimitiveValue(const CFDE_CSSPrimitiveValue& src) { *this = src; }
- CFDE_CSSPrimitiveValue(FX_ARGB color)
- : m_eType(FDE_CSSPRIMITIVETYPE_RGB), m_dwColor(color) {}
- CFDE_CSSPrimitiveValue(FDE_CSSPROPERTYVALUE eValue)
- : m_eType(FDE_CSSPRIMITIVETYPE_Enum), m_eEnum(eValue) {}
- CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE eType, FX_FLOAT fValue)
- : m_eType(eType), m_fNumber(fValue) {}
- CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE eType, const FX_WCHAR* pValue)
- : m_eType(eType), m_pString(pValue) {
- ASSERT(m_pString);
- }
- CFDE_CSSPrimitiveValue(CFDE_CSSFunction* pFunction)
- : m_eType(FDE_CSSPRIMITIVETYPE_Function), m_pFunction(pFunction) {}
-
- virtual FDE_CSSPRIMITIVETYPE GetPrimitiveType() const { return m_eType; }
-
- virtual FX_ARGB GetRGBColor() const {
- ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_RGB);
- return m_dwColor;
- }
- virtual FX_FLOAT GetFloat() const {
- ASSERT(m_eType >= FDE_CSSPRIMITIVETYPE_Number &&
- m_eType <= FDE_CSSPRIMITIVETYPE_PC);
- return m_fNumber;
- }
- virtual const FX_WCHAR* GetString(int32_t& iLength) const {
- ASSERT(m_eType >= FDE_CSSPRIMITIVETYPE_String &&
- m_eType <= FDE_CSSPRIMITIVETYPE_URI);
- iLength = FXSYS_wcslen(m_pString);
- return m_pString;
- }
- virtual FDE_CSSPROPERTYVALUE GetEnum() const {
- ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Enum);
- return m_eEnum;
- }
- virtual const FX_WCHAR* GetFuncName() const {
- ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function);
- return m_pFunction->GetFuncName();
- }
- virtual int32_t CountArgs() const {
- ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function);
- return m_pFunction->CountArgs();
- }
- virtual IFDE_CSSValue* GetArgs(int32_t index) const {
- ASSERT(m_eType == FDE_CSSPRIMITIVETYPE_Function);
- return m_pFunction->GetArgs(index);
- }
+ explicit CFDE_CSSPrimitiveValue(FX_ARGB color);
+ explicit CFDE_CSSPrimitiveValue(FDE_CSSPROPERTYVALUE eValue);
+ explicit CFDE_CSSPrimitiveValue(CFDE_CSSFunction* pFunction);
+ CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE eType, FX_FLOAT fValue);
+ CFDE_CSSPrimitiveValue(FDE_CSSPRIMITIVETYPE eType, const FX_WCHAR* pValue);
+ CFDE_CSSPrimitiveValue(const CFDE_CSSPrimitiveValue& src);
+
+ // IFDE_CSSPrimitiveValue
+ FDE_CSSPRIMITIVETYPE GetPrimitiveType() const override;
+ FX_ARGB GetRGBColor() const override;
+ FX_FLOAT GetFloat() const override;
+ const FX_WCHAR* GetString(int32_t& iLength) const override;
+ FDE_CSSPROPERTYVALUE GetEnum() const override;
+ const FX_WCHAR* GetFuncName() const override;
+ int32_t CountArgs() const override;
+ IFDE_CSSValue* GetArgs(int32_t index) const override;
FDE_CSSPRIMITIVETYPE m_eType;
union {
@@ -87,21 +57,24 @@ class CFDE_CSSPrimitiveValue : public IFDE_CSSPrimitiveValue,
CFDE_CSSFunction* m_pFunction;
};
};
+
typedef CFX_ArrayTemplate<IFDE_CSSPrimitiveValue*> CFDE_CSSPrimitiveArray;
typedef CFX_ArrayTemplate<IFDE_CSSValue*> CFDE_CSSValueArray;
+
class CFDE_CSSValueList : public IFDE_CSSValueList, public CFX_Target {
public:
CFDE_CSSValueList(IFX_MemoryAllocator* pStaticStore,
const CFDE_CSSValueArray& list);
- virtual int32_t CountValues() const { return m_iCount; }
- virtual IFDE_CSSValue* GetValue(int32_t index) const {
- return m_ppList[index];
- }
+
+ // IFDE_CSSValueList
+ int32_t CountValues() const override;
+ IFDE_CSSValue* GetValue(int32_t index) const override;
protected:
IFDE_CSSValue** m_ppList;
int32_t m_iCount;
};
+
class CFDE_CSSValueListParser : public CFX_Target {
public:
CFDE_CSSValueListParser(const FX_WCHAR* psz, int32_t iLen, FX_WCHAR separator)
@@ -117,6 +90,7 @@ class CFDE_CSSValueListParser : public CFX_Target {
int32_t SkipTo(FX_WCHAR wch,
FX_BOOL bWSSeparator = FALSE,
FX_BOOL bBrContinue = FALSE);
+
const FX_WCHAR* m_pCur;
const FX_WCHAR* m_pEnd;
};