From 7df950ac2ef484880fe3cbfb9961bed34fee191d Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 26 Oct 2018 19:42:40 +0000 Subject: Stop transfering ownership of |this| as CPWL_Wnd::Create() side-effect Instead, make it an explicit method called on the parent outside of create. Rename Create() to Realize() to be sure to catch all usages, and add the new required call. Attachment to the parent now takes place a little earlier on in the life-cycle as a result but should be ok. Precursor to converting to smart pointers. Change-Id: I45c459fcd28b5d03c428ce5809d0432506cf4ec6 Reviewed-on: https://pdfium-review.googlesource.com/c/44690 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fpdfsdk/pwl/cpwl_edit_ctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fpdfsdk/pwl/cpwl_edit_ctrl.cpp') diff --git a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp index d27c6cd604..ea48c45376 100644 --- a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp +++ b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp @@ -90,6 +90,7 @@ void CPWL_EditCtrl::CreateEditCaret(const CreateParams& cp) { m_pEditCaret = new CPWL_Caret(CloneAttachedData()); m_pEditCaret->SetInvalidRect(GetClientRect()); + AddChild(m_pEditCaret); CreateParams ecp = cp; ecp.pParentWnd = this; @@ -97,7 +98,7 @@ void CPWL_EditCtrl::CreateEditCaret(const CreateParams& cp) { ecp.dwBorderWidth = 0; ecp.nBorderStyle = BorderStyle::SOLID; ecp.rcRectWnd = CFX_FloatRect(); - m_pEditCaret->Create(ecp); + m_pEditCaret->Realize(ecp); } void CPWL_EditCtrl::SetFontSize(float fFontSize) { -- cgit v1.2.3