diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-10-26 22:08:43 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-26 22:08:43 +0000 |
commit | 9590dee526c514d87dc1f47569d1136ffcf539ad (patch) | |
tree | eaea0d3d96ee9248b1cb0dc34fc2950192b7f9ef /fpdfsdk/pwl/cpwl_edit_ctrl.cpp | |
parent | e027c9765c1aa5ea2a4293fc6ea29a96e3fc2c73 (diff) | |
download | pdfium-9590dee526c514d87dc1f47569d1136ffcf539ad.tar.xz |
Pass unique_ptr to CPWL_Wnd::AddChild().
But stop short of updating the underlying data structures.
Change-Id: I7d8edc74f71725005b81359484d30caddbe958d7
Reviewed-on: https://pdfium-review.googlesource.com/c/44693
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl/cpwl_edit_ctrl.cpp')
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit_ctrl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp index 8bf13a73d0..44918be30e 100644 --- a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp +++ b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp @@ -88,15 +88,16 @@ void CPWL_EditCtrl::CreateEditCaret(const CreateParams& cp) { if (m_pEditCaret) return; - m_pEditCaret = new CPWL_Caret(CloneAttachedData()); - m_pEditCaret->SetInvalidRect(GetClientRect()); - AddChild(m_pEditCaret); - CreateParams ecp = cp; ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP; ecp.dwBorderWidth = 0; ecp.nBorderStyle = BorderStyle::SOLID; ecp.rcRectWnd = CFX_FloatRect(); + + auto pCaret = pdfium::MakeUnique<CPWL_Caret>(CloneAttachedData()); + m_pEditCaret = pCaret.get(); + m_pEditCaret->SetInvalidRect(GetClientRect()); + AddChild(std::move(pCaret)); m_pEditCaret->Realize(ecp); } |