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

Unified Diff: xfa/fwl/core/fwl_formimp.cpp

Issue 2207093005: Use smart pointers for class owned pointers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: one more change Created 4 years, 4 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/fwl/core/fwl_formimp.h ('k') | xfa/fwl/core/fwl_noteimp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_formimp.cpp
diff --git a/xfa/fwl/core/fwl_formimp.cpp b/xfa/fwl/core/fwl_formimp.cpp
index a3fc6be8166aec9518531d9100203994c64ebc30..1b82ff59f87494f8b22e522b1f7951943c1b57d1 100644
--- a/xfa/fwl/core/fwl_formimp.cpp
+++ b/xfa/fwl/core/fwl_formimp.cpp
@@ -75,7 +75,6 @@ CFWL_FormImp::CFWL_FormImp(const CFWL_WidgetImpProperties& properties,
m_pMinBox(nullptr),
m_pMaxBox(nullptr),
m_pCaptionBox(nullptr),
- m_pNoteLoop(nullptr),
m_pSubFocus(nullptr),
m_fCXBorder(0),
m_fCYBorder(0),
@@ -100,7 +99,6 @@ CFWL_FormImp::CFWL_FormImp(const CFWL_WidgetImpProperties& properties,
CFWL_FormImp::~CFWL_FormImp() {
RemoveSysButtons();
- delete m_pNoteLoop;
}
FWL_Error CFWL_FormImp::GetClassName(CFX_WideString& wsClass) const {
@@ -371,13 +369,16 @@ FWL_Error CFWL_FormImp::DrawWidget(CFX_Graphics* pGraphics,
#endif
return FWL_Error::Succeeded;
}
+
FWL_FORMSIZE CFWL_FormImp::GetFormSize() {
return m_eFormSize;
}
+
FWL_Error CFWL_FormImp::SetFormSize(FWL_FORMSIZE eFormSize) {
m_eFormSize = eFormSize;
return FWL_Error::Succeeded;
}
+
IFWL_Widget* CFWL_FormImp::DoModal() {
IFWL_App* pApp = GetOwnerApp();
if (!pApp)
@@ -387,8 +388,8 @@ IFWL_Widget* CFWL_FormImp::DoModal() {
if (!pDriver)
return nullptr;
- m_pNoteLoop = new CFWL_NoteLoop(this);
- pDriver->PushNoteLoop(m_pNoteLoop);
+ m_pNoteLoop.reset(new CFWL_NoteLoop(this));
+ pDriver->PushNoteLoop(m_pNoteLoop.get());
m_bDoModalFlag = TRUE;
SetStates(FWL_WGTSTATE_Invisible, FALSE);
pDriver->Run();
@@ -396,13 +397,14 @@ IFWL_Widget* CFWL_FormImp::DoModal() {
#else
pDriver->PopNoteLoop();
#endif
- delete m_pNoteLoop;
- m_pNoteLoop = nullptr;
+ m_pNoteLoop.reset();
return nullptr;
}
+
IFWL_Widget* CFWL_FormImp::DoModal(uint32_t& dwCommandID) {
return DoModal();
}
+
FWL_Error CFWL_FormImp::EndDoModal() {
if (!m_pNoteLoop)
return FWL_Error::Indefinite;
@@ -426,6 +428,7 @@ FWL_Error CFWL_FormImp::EndDoModal() {
return m_pNoteLoop->EndModalLoop();
#endif
}
+
FWL_Error CFWL_FormImp::SetBorderRegion(CFX_Path* pPath) {
return FWL_Error::Succeeded;
}
« no previous file with comments | « xfa/fwl/core/fwl_formimp.h ('k') | xfa/fwl/core/fwl_noteimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698