summaryrefslogtreecommitdiff
path: root/xfa/src/fde/css/fde_cssdeclaration.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-03-09 13:24:25 -0800
committerTom Sepez <tsepez@chromium.org>2016-03-09 13:24:25 -0800
commit4f6fdbe6adf0d90886b9deb5666996603cf1207c (patch)
tree4fee37f0d6711efbfdebbb72e0ba1746c95ad05e /xfa/src/fde/css/fde_cssdeclaration.cpp
parent2e95951e06bd4d11459fb257c7c2b8fc881854e8 (diff)
downloadpdfium-4f6fdbe6adf0d90886b9deb5666996603cf1207c.tar.xz
Structs shouldn't inherit from CFX_Target.
There are some assumptions in the code that CAPS_NAMED structs are POD, and can be memcpy'd, malloc'd, etc. CFX_Target adds a virtual dtor, which is not what is desired for many of these, so resolve by making each a CAPS_Named class or by removing the inheritence. In the process XFA_TextPiece was found to be malloc'd despite having a ctor. Move this to |new|, noting that the object is never freed (and goes out of existence when the allocator's pool is destroyed). BUG=pdfium:432 R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1780753002 .
Diffstat (limited to 'xfa/src/fde/css/fde_cssdeclaration.cpp')
-rw-r--r--xfa/src/fde/css/fde_cssdeclaration.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/xfa/src/fde/css/fde_cssdeclaration.cpp b/xfa/src/fde/css/fde_cssdeclaration.cpp
index 1a43b8beb2..073c14d414 100644
--- a/xfa/src/fde/css/fde_cssdeclaration.cpp
+++ b/xfa/src/fde/css/fde_cssdeclaration.cpp
@@ -11,7 +11,7 @@
IFDE_CSSValue* CFDE_CSSDeclaration::GetProperty(FDE_CSSPROPERTY eProperty,
FX_BOOL& bImportant) const {
- for (const FDE_CSSPROPERTYHOLDER* pHolder = m_pFirstProperty; pHolder;
+ for (const FDE_CSSPropertyHolder* pHolder = m_pFirstProperty; pHolder;
pHolder = pHolder->pNext) {
if (pHolder->eProperty == eProperty) {
bImportant = pHolder->bImportant;
@@ -27,7 +27,7 @@ void CFDE_CSSDeclaration::GetNextProperty(FX_POSITION& pos,
FDE_CSSPROPERTY& eProperty,
IFDE_CSSValue*& pValue,
FX_BOOL& bImportant) const {
- const FDE_CSSPROPERTYHOLDER* pHolder = (const FDE_CSSPROPERTYHOLDER*)pos;
+ const FDE_CSSPropertyHolder* pHolder = (const FDE_CSSPropertyHolder*)pos;
FXSYS_assert(pHolder != NULL);
bImportant = pHolder->bImportant;
eProperty = (FDE_CSSPROPERTY)pHolder->eProperty;
@@ -40,7 +40,7 @@ FX_POSITION CFDE_CSSDeclaration::GetStartCustom() const {
void CFDE_CSSDeclaration::GetNextCustom(FX_POSITION& pos,
CFX_WideString& wsName,
CFX_WideString& wsValue) const {
- const FDE_CSSCUSTOMPROPERTY* pProperty = (const FDE_CSSCUSTOMPROPERTY*)pos;
+ const FDE_CSSCustomProperty* pProperty = (const FDE_CSSCustomProperty*)pos;
if (pProperty == NULL) {
return;
}
@@ -94,8 +94,8 @@ void CFDE_CSSDeclaration::AddPropertyHolder(IFX_MEMAllocator* pStaticStore,
FDE_CSSPROPERTY eProperty,
IFDE_CSSValue* pValue,
FX_BOOL bImportant) {
- FDE_CSSPROPERTYHOLDER* pHolder =
- FXTARGET_NewWith(pStaticStore) FDE_CSSPROPERTYHOLDER;
+ FDE_CSSPropertyHolder* pHolder =
+ FXTARGET_NewWith(pStaticStore) FDE_CSSPropertyHolder;
pHolder->bImportant = bImportant;
pHolder->eProperty = eProperty;
pHolder->pValue = pValue;
@@ -270,8 +270,8 @@ FX_BOOL CFDE_CSSDeclaration::AddProperty(const FDE_CSSPROPERTYARGS* pArgs,
int32_t iNameLen,
const FX_WCHAR* pszValue,
int32_t iValueLen) {
- FDE_CSSCUSTOMPROPERTY* pProperty =
- FXTARGET_NewWith(pArgs->pStaticStore) FDE_CSSCUSTOMPROPERTY;
+ FDE_CSSCustomProperty* pProperty =
+ FXTARGET_NewWith(pArgs->pStaticStore) FDE_CSSCustomProperty;
pProperty->pwsName = CopyToLocal(pArgs, pszName, iNameLen);
pProperty->pwsValue = CopyToLocal(pArgs, pszValue, iValueLen);
pProperty->pNext = NULL;