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

Unified Diff: xfa/fxfa/parser/xfa_document_layout_imp.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 8 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/fxfa/parser/xfa_document_imp.cpp ('k') | xfa/fxfa/parser/xfa_locale.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/parser/xfa_document_layout_imp.cpp
diff --git a/xfa/fxfa/parser/xfa_document_layout_imp.cpp b/xfa/fxfa/parser/xfa_document_layout_imp.cpp
index 9b9a879d4d430ea66d0fdbe4132ed405e90b3c09..44d053b8c249721e1d316a02a90d694771548140 100644
--- a/xfa/fxfa/parser/xfa_document_layout_imp.cpp
+++ b/xfa/fxfa/parser/xfa_document_layout_imp.cpp
@@ -42,14 +42,13 @@ CXFA_LayoutProcessor::~CXFA_LayoutProcessor() {
CXFA_Document* CXFA_LayoutProcessor::GetDocument() const {
return m_pDocument;
}
+
int32_t CXFA_LayoutProcessor::StartLayout(FX_BOOL bForceRestart) {
- if (!bForceRestart && !IsNeedLayout()) {
+ if (!bForceRestart && !IsNeedLayout())
return 100;
- }
- if (m_pRootItemLayoutProcessor) {
- delete m_pRootItemLayoutProcessor;
- m_pRootItemLayoutProcessor = NULL;
- }
+
+ delete m_pRootItemLayoutProcessor;
+ m_pRootItemLayoutProcessor = nullptr;
m_nProgressCounter = 0;
CXFA_Node* pFormPacketNode =
ToNode(m_pDocument->GetXFAObject(XFA_HASHCODE_Form));
@@ -147,17 +146,15 @@ void CXFA_LayoutProcessor::AddChangedContainer(CXFA_Node* pContainer) {
CXFA_ContainerLayoutItem* CXFA_LayoutProcessor::GetRootLayoutItem() const {
return m_pLayoutPageMgr ? m_pLayoutPageMgr->GetRootLayoutItem() : NULL;
}
+
void CXFA_LayoutProcessor::ClearLayoutData() {
- if (m_pLayoutPageMgr) {
- delete m_pLayoutPageMgr;
- m_pLayoutPageMgr = NULL;
- }
- if (m_pRootItemLayoutProcessor) {
- delete m_pRootItemLayoutProcessor;
- m_pRootItemLayoutProcessor = NULL;
- }
+ delete m_pLayoutPageMgr;
+ m_pLayoutPageMgr = nullptr;
+ delete m_pRootItemLayoutProcessor;
+ m_pRootItemLayoutProcessor = nullptr;
m_nProgressCounter = 0;
}
+
FX_BOOL CXFA_LayoutProcessor::IsNeedLayout() {
return m_bNeeLayout || m_rgChangedContainers.GetSize() > 0;
}
« no previous file with comments | « xfa/fxfa/parser/xfa_document_imp.cpp ('k') | xfa/fxfa/parser/xfa_locale.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698