From b7c4a0243e82f6c4ff91cd90b5bae336100c3c70 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 26 Oct 2018 23:56:27 +0000 Subject: Pass CreateParams to CPWL_Wnd constructor. The previous reshuffling means we always have the create params earlier, so pass them in at create time. Clean up two forward declarations that were not needed as noticed in the process. Change-Id: I5d3861f3c1e3508e0d25950e919859244fac5f8b Reviewed-on: https://pdfium-review.googlesource.com/c/44710 Reviewed-by: Tom Sepez Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fpdfsdk/pwl/cpwl_wnd.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'fpdfsdk/pwl/cpwl_wnd.cpp') diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp index 8ed57de646..90aa15cfee 100644 --- a/fpdfsdk/pwl/cpwl_wnd.cpp +++ b/fpdfsdk/pwl/cpwl_wnd.cpp @@ -111,17 +111,17 @@ class CPWL_MsgControl final : public Observable { UnownedPtr m_pMainKeyboardWnd; }; -CPWL_Wnd::CPWL_Wnd(std::unique_ptr pAttachedData) - : m_pAttachedData(std::move(pAttachedData)) {} +CPWL_Wnd::CPWL_Wnd(const CreateParams& cp, + std::unique_ptr pAttachedData) + : m_CreationParams(cp), m_pAttachedData(std::move(pAttachedData)) {} CPWL_Wnd::~CPWL_Wnd() { ASSERT(!m_bCreated); } -void CPWL_Wnd::Realize(const CreateParams& cp) { +void CPWL_Wnd::Realize() { ASSERT(!m_bCreated); - m_CreationParams = cp; OnCreate(&m_CreationParams); m_CreationParams.rcRectWnd.Normalize(); m_rcWindow = m_CreationParams.rcRectWnd; @@ -484,20 +484,17 @@ void CPWL_Wnd::CreateVScrollBar(const CreateParams& cp) { return; CreateParams scp = cp; - - // flags scp.dwFlags = PWS_CHILD | PWS_BACKGROUND | PWS_AUTOTRANSPARENT | PWS_NOREFRESHCLIP; - scp.sBackgroundColor = PWL_DEFAULT_WHITECOLOR; scp.eCursorType = FXCT_ARROW; scp.nTransparency = PWL_SCROLLBAR_TRANSPARENCY; auto pBar = - pdfium::MakeUnique(CloneAttachedData(), SBT_VSCROLL); + pdfium::MakeUnique(scp, CloneAttachedData(), SBT_VSCROLL); m_pVScrollBar = pBar.get(); AddChild(std::move(pBar)); - m_pVScrollBar->Realize(scp); + m_pVScrollBar->Realize(); } void CPWL_Wnd::SetCapture() { -- cgit v1.2.3