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

Unified Diff: xfa/fwl/core/fwl_noteimp.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_noteimp.h ('k') | xfa/fwl/core/fwl_widgetimp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fwl/core/fwl_noteimp.cpp
diff --git a/xfa/fwl/core/fwl_noteimp.cpp b/xfa/fwl/core/fwl_noteimp.cpp
index f115e2fd1b94dd0ca550e9343c1ad75c8959089f..8ecec2df6508c3e430f77eca1fed75667646f985 100644
--- a/xfa/fwl/core/fwl_noteimp.cpp
+++ b/xfa/fwl/core/fwl_noteimp.cpp
@@ -70,10 +70,9 @@ CFWL_NoteDriver::CFWL_NoteDriver()
m_pFocus(nullptr),
m_pGrab(nullptr),
m_pNoteLoop(new CFWL_NoteLoop) {
- PushNoteLoop(m_pNoteLoop);
+ PushNoteLoop(m_pNoteLoop.get());
}
CFWL_NoteDriver::~CFWL_NoteDriver() {
- delete m_pNoteLoop;
ClearInvalidEventTargets(TRUE);
}
@@ -655,6 +654,8 @@ void CFWL_NoteDriver::ClearInvalidEventTargets(FX_BOOL bRemoveAll) {
class CFWL_CoreToolTipDP : public IFWL_ToolTipDP {
public:
+ CFWL_CoreToolTipDP(int32_t iInitDelayTime, int32_t iAutoDelayTime);
+
// IFWL_ToolTipDP
FWL_Error GetCaption(IFWL_Widget* pWidget,
CFX_WideString& wsCaption) override;
@@ -664,7 +665,6 @@ class CFWL_CoreToolTipDP : public IFWL_ToolTipDP {
CFX_SizeF GetToolTipIconSize(IFWL_Widget* pWidget) override;
CFX_RectF GetAnchor();
- CFWL_CoreToolTipDP();
CFX_WideString m_wsCaption;
int32_t m_nInitDelayTime;
@@ -672,9 +672,9 @@ class CFWL_CoreToolTipDP : public IFWL_ToolTipDP {
CFX_RectF m_fAnchor;
};
-CFWL_CoreToolTipDP::CFWL_CoreToolTipDP() {
- m_nInitDelayTime = 500;
- m_nAutoPopDelayTime = 50000;
+CFWL_CoreToolTipDP::CFWL_CoreToolTipDP(int32_t iInitDelayTime,
+ int32_t iAutoDelayTime)
+ : m_nInitDelayTime(iInitDelayTime), m_nAutoPopDelayTime(iAutoDelayTime) {
m_fAnchor.Set(0.0, 0.0, 0.0, 0.0);
}
@@ -773,11 +773,9 @@ FX_BOOL CFWL_EventTarget::IsFilterEvent(CFWL_Event* pEvent, uint32_t dwFilter) {
CFWL_ToolTipContainer* CFWL_ToolTipContainer::s_pInstance = nullptr;
-CFWL_ToolTipContainer::CFWL_ToolTipContainer() : m_pToolTipImp(nullptr) {
- m_ToolTipDp = new CFWL_CoreToolTipDP;
- m_ToolTipDp->m_nInitDelayTime = 0;
- m_ToolTipDp->m_nAutoPopDelayTime = 2000;
-}
+CFWL_ToolTipContainer::CFWL_ToolTipContainer()
+ : m_pToolTipImp(nullptr), m_pToolTipDp(new CFWL_CoreToolTipDP(0, 2000)) {}
+
CFWL_ToolTipContainer::~CFWL_ToolTipContainer() {
if (m_pToolTipImp) {
IFWL_ToolTip* pToolTip =
@@ -785,7 +783,6 @@ CFWL_ToolTipContainer::~CFWL_ToolTipContainer() {
pToolTip->Finalize();
delete pToolTip;
}
- delete m_ToolTipDp;
}
// static
« no previous file with comments | « xfa/fwl/core/fwl_noteimp.h ('k') | xfa/fwl/core/fwl_widgetimp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698