diff options
Diffstat (limited to 'xfa/fde')
-rw-r--r-- | xfa/fde/css/fde_cssstyleselector.cpp | 18 | ||||
-rw-r--r-- | xfa/fde/css/fde_cssstyleselector.h | 4 | ||||
-rw-r--r-- | xfa/fde/fde_render.cpp | 6 |
3 files changed, 11 insertions, 17 deletions
diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp index 8ea85b9257..55a1477b4c 100644 --- a/xfa/fde/css/fde_cssstyleselector.cpp +++ b/xfa/fde/css/fde_cssstyleselector.cpp @@ -220,18 +220,16 @@ CFDE_CSSStyleSelector::CFDE_CSSStyleSelector() m_ePriorities[FDE_CSSSTYLESHEETPRIORITY_Low] = FDE_CSSSTYLESHEETGROUP_UserAgent; } + CFDE_CSSStyleSelector::~CFDE_CSSStyleSelector() { Reset(); - if (m_pInlineStyleStore != NULL) { + if (m_pInlineStyleStore) m_pInlineStyleStore->Release(); - } - if (m_pFixedStyleStore != NULL) { + if (m_pFixedStyleStore) m_pFixedStyleStore->Release(); - } - if (m_pAccelerator != NULL) { - delete m_pAccelerator; - } + delete m_pAccelerator; } + void CFDE_CSSStyleSelector::SetFontMgr(IFX_FontMgr* pFontMgr) { m_pFontMgr = pFontMgr; } @@ -239,14 +237,14 @@ void CFDE_CSSStyleSelector::SetDefFontSize(FX_FLOAT fFontSize) { ASSERT(fFontSize > 0); m_fDefFontSize = fFontSize; } + CFDE_CSSAccelerator* CFDE_CSSStyleSelector::InitAccelerator() { - if (m_pAccelerator == NULL) { + if (!m_pAccelerator) m_pAccelerator = new CFDE_CSSAccelerator; - ASSERT(m_pAccelerator != NULL); - } m_pAccelerator->Clear(); return m_pAccelerator; } + IFDE_CSSComputedStyle* CFDE_CSSStyleSelector::CreateComputedStyle( IFDE_CSSComputedStyle* pParentStyle) { if (m_pFixedStyleStore == NULL) { diff --git a/xfa/fde/css/fde_cssstyleselector.h b/xfa/fde/css/fde_cssstyleselector.h index faadb4e4e4..6c23a9eb1d 100644 --- a/xfa/fde/css/fde_cssstyleselector.h +++ b/xfa/fde/css/fde_cssstyleselector.h @@ -398,9 +398,7 @@ class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, uint32_t Release() override { uint32_t dwRefCount = --m_dwRefCount; if (dwRefCount == 0) { - if (m_NonInheritedData.m_pCounterStyle) - delete m_NonInheritedData.m_pCounterStyle; - + delete m_NonInheritedData.m_pCounterStyle; FXTARGET_DeleteWith(CFDE_CSSComputedStyle, m_pAllocator, this); } return dwRefCount; diff --git a/xfa/fde/fde_render.cpp b/xfa/fde/fde_render.cpp index 81e5b1b259..7c989a0c6b 100644 --- a/xfa/fde/fde_render.cpp +++ b/xfa/fde/fde_render.cpp @@ -105,10 +105,8 @@ void CFDE_RenderContext::StopRender() { m_pIterator->Release(); m_pIterator = nullptr; } - if (m_pBrush) { - delete m_pBrush; - m_pBrush = nullptr; - } + delete m_pBrush; + m_pBrush = nullptr; FX_Free(m_pCharPos); m_pCharPos = nullptr; m_iCharPosCount = 0; |