Remove CPWL_Wnd::GetClassName() and overrides. It's only used in two tests, and there it is not essential, so save some strings and vtable space. Change-Id: If8c68e5e2580dbe588bccb942f9008efb66fe490 Reviewed-on: https://pdfium-review.googlesource.com/c/43472 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/pwl/cpwl_button.cpp b/fpdfsdk/pwl/cpwl_button.cpp index 364bcc6..bdf56a2 100644 --- a/fpdfsdk/pwl/cpwl_button.cpp +++ b/fpdfsdk/pwl/cpwl_button.cpp
@@ -12,10 +12,6 @@ CPWL_Button::~CPWL_Button() {} -ByteString CPWL_Button::GetClassName() const { - return "CPWL_Button"; -} - void CPWL_Button::OnCreate(CreateParams* pParamsToAdjust) { pParamsToAdjust->eCursorType = FXCT_HAND; }
diff --git a/fpdfsdk/pwl/cpwl_button.h b/fpdfsdk/pwl/cpwl_button.h index 70f5ef1..b327371 100644 --- a/fpdfsdk/pwl/cpwl_button.h +++ b/fpdfsdk/pwl/cpwl_button.h
@@ -15,7 +15,6 @@ ~CPWL_Button() override; // CPWL_Wnd - ByteString GetClassName() const override; void OnCreate(CreateParams* pParamsToAdjust) override; bool OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) override; bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override;
diff --git a/fpdfsdk/pwl/cpwl_caret.cpp b/fpdfsdk/pwl/cpwl_caret.cpp index 77a768a..24ecb17 100644 --- a/fpdfsdk/pwl/cpwl_caret.cpp +++ b/fpdfsdk/pwl/cpwl_caret.cpp
@@ -19,10 +19,6 @@ CPWL_Caret::~CPWL_Caret() {} -ByteString CPWL_Caret::GetClassName() const { - return "CPWL_Caret"; -} - void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice, const CFX_Matrix& mtUser2Device) { if (!IsVisible() || !m_bFlash)
diff --git a/fpdfsdk/pwl/cpwl_caret.h b/fpdfsdk/pwl/cpwl_caret.h index 1f7c2b8..27418ec 100644 --- a/fpdfsdk/pwl/cpwl_caret.h +++ b/fpdfsdk/pwl/cpwl_caret.h
@@ -15,7 +15,6 @@ ~CPWL_Caret() override; // CPWL_Wnd - ByteString GetClassName() const override; void DrawThisAppearance(CFX_RenderDevice* pDevice, const CFX_Matrix& mtUser2Device) override; bool InvalidateRect(CFX_FloatRect* pRect) override;
diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp index a69dd74..341bd93 100644 --- a/fpdfsdk/pwl/cpwl_combo_box.cpp +++ b/fpdfsdk/pwl/cpwl_combo_box.cpp
@@ -151,10 +151,6 @@ CPWL_ComboBox::~CPWL_ComboBox() {} -ByteString CPWL_ComboBox::GetClassName() const { - return "CPWL_ComboBox"; -} - void CPWL_ComboBox::OnCreate(CreateParams* pParamsToAdjust) { pParamsToAdjust->dwFlags &= ~PWS_HSCROLL; pParamsToAdjust->dwFlags &= ~PWS_VSCROLL;
diff --git a/fpdfsdk/pwl/cpwl_combo_box.h b/fpdfsdk/pwl/cpwl_combo_box.h index 0f54ae4..2e66b51 100644 --- a/fpdfsdk/pwl/cpwl_combo_box.h +++ b/fpdfsdk/pwl/cpwl_combo_box.h
@@ -46,7 +46,6 @@ CPWL_Edit* GetEdit() const { return m_pEdit.Get(); } // CPWL_Wnd: - ByteString GetClassName() const override; void OnCreate(CreateParams* pParamsToAdjust) override; void OnDestroy() override; bool OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
diff --git a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp index 62d42f9..e839de0 100644 --- a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp +++ b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
@@ -65,7 +65,6 @@ CPWL_Wnd* pWindow = m_pFormFiller->GetPDFWindow(m_pFormFillEnv->GetPageView(0), false); ASSERT_TRUE(pWindow); - ASSERT_EQ("CPWL_ComboBox", pWindow->GetClassName()); m_pComboBox = static_cast<CPWL_ComboBox*>(pWindow); }
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp index 4cd238b..59fb921 100644 --- a/fpdfsdk/pwl/cpwl_edit.cpp +++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -33,10 +33,6 @@ ASSERT(!m_bFocus); } -ByteString CPWL_Edit::GetClassName() const { - return PWL_CLASSNAME_EDIT; -} - void CPWL_Edit::SetText(const WideString& csText) { m_pEdit->SetText(csText); }
diff --git a/fpdfsdk/pwl/cpwl_edit.h b/fpdfsdk/pwl/cpwl_edit.h index f7429c9..849436a 100644 --- a/fpdfsdk/pwl/cpwl_edit.h +++ b/fpdfsdk/pwl/cpwl_edit.h
@@ -13,8 +13,6 @@ #include "core/fxcrt/unowned_ptr.h" #include "fpdfsdk/pwl/cpwl_edit_ctrl.h" -#define PWL_CLASSNAME_EDIT "CPWL_Edit" - class IPWL_Filler_Notify { public: virtual ~IPWL_Filler_Notify() {} @@ -47,7 +45,6 @@ ~CPWL_Edit() override; // CPWL_EditCtrl - ByteString GetClassName() const override; void OnCreated() override; bool RePosChildWnd() override; CFX_FloatRect GetClientRect() const override;
diff --git a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp index 3edbf75..d751023 100644 --- a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp +++ b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
@@ -2,12 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "fpdfsdk/pwl/cpwl_edit.h" + #include "fpdfsdk/cpdfsdk_annot.h" #include "fpdfsdk/cpdfsdk_annotiterator.h" #include "fpdfsdk/cpdfsdk_formfillenvironment.h" #include "fpdfsdk/formfiller/cffl_formfiller.h" #include "fpdfsdk/formfiller/cffl_interactiveformfiller.h" -#include "fpdfsdk/pwl/cpwl_wnd.h" #include "testing/embedder_test.h" #include "testing/gtest/include/gtest/gtest.h" @@ -64,8 +65,6 @@ CPWL_Wnd* pWindow = m_pFormFiller->GetPDFWindow(m_pFormFillEnv->GetPageView(0), false); ASSERT_TRUE(pWindow); - ASSERT_EQ(PWL_CLASSNAME_EDIT, pWindow->GetClassName()); - m_pEdit = static_cast<CPWL_Edit*>(pWindow); }
diff --git a/fpdfsdk/pwl/cpwl_list_box.cpp b/fpdfsdk/pwl/cpwl_list_box.cpp index fdcd4bb..11d451c 100644 --- a/fpdfsdk/pwl/cpwl_list_box.cpp +++ b/fpdfsdk/pwl/cpwl_list_box.cpp
@@ -72,10 +72,6 @@ CPWL_ListBox::~CPWL_ListBox() {} -ByteString CPWL_ListBox::GetClassName() const { - return "CPWL_ListBox"; -} - void CPWL_ListBox::OnCreated() { m_pList->SetFontMap(GetFontMap()); m_pListNotify = pdfium::MakeUnique<CPWL_List_Notify>(this);
diff --git a/fpdfsdk/pwl/cpwl_list_box.h b/fpdfsdk/pwl/cpwl_list_box.h index 0371ba1..6a58982 100644 --- a/fpdfsdk/pwl/cpwl_list_box.h +++ b/fpdfsdk/pwl/cpwl_list_box.h
@@ -42,7 +42,6 @@ ~CPWL_ListBox() override; // CPWL_Wnd - ByteString GetClassName() const override; void OnCreated() override; void OnDestroy() override; void DrawThisAppearance(CFX_RenderDevice* pDevice,
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.cpp b/fpdfsdk/pwl/cpwl_scroll_bar.cpp index a9cd4f6..472e6af 100644 --- a/fpdfsdk/pwl/cpwl_scroll_bar.cpp +++ b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
@@ -127,10 +127,6 @@ CPWL_SBButton::~CPWL_SBButton() {} -ByteString CPWL_SBButton::GetClassName() const { - return "CPWL_SBButton"; -} - void CPWL_SBButton::OnCreate(CreateParams* pParamsToAdjust) { pParamsToAdjust->eCursorType = FXCT_ARROW; } @@ -326,10 +322,6 @@ CPWL_ScrollBar::~CPWL_ScrollBar() {} -ByteString CPWL_ScrollBar::GetClassName() const { - return "CPWL_ScrollBar"; -} - void CPWL_ScrollBar::OnCreate(CreateParams* pParamsToAdjust) { pParamsToAdjust->eCursorType = FXCT_ARROW; }
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.h b/fpdfsdk/pwl/cpwl_scroll_bar.h index a61c04d..3c3c56e 100644 --- a/fpdfsdk/pwl/cpwl_scroll_bar.h +++ b/fpdfsdk/pwl/cpwl_scroll_bar.h
@@ -49,7 +49,6 @@ ~CPWL_SBButton() override; // CPWL_Wnd - ByteString GetClassName() const override; void OnCreate(CreateParams* pParamsToAdjust) override; void DrawThisAppearance(CFX_RenderDevice* pDevice, const CFX_Matrix& mtUser2Device) override; @@ -120,7 +119,6 @@ ~CPWL_ScrollBar() override; // CPWL_Wnd: - ByteString GetClassName() const override; void OnCreate(CreateParams* pParamsToAdjust) override; void OnDestroy() override; bool RePosChildWnd() override;
diff --git a/fpdfsdk/pwl/cpwl_special_button.cpp b/fpdfsdk/pwl/cpwl_special_button.cpp index f95918f..061d024 100644 --- a/fpdfsdk/pwl/cpwl_special_button.cpp +++ b/fpdfsdk/pwl/cpwl_special_button.cpp
@@ -13,10 +13,6 @@ CPWL_PushButton::~CPWL_PushButton() {} -ByteString CPWL_PushButton::GetClassName() const { - return "CPWL_PushButton"; -} - CFX_FloatRect CPWL_PushButton::GetFocusRect() const { return GetWindowRect().GetDeflated(static_cast<float>(GetBorderWidth()), static_cast<float>(GetBorderWidth())); @@ -26,10 +22,6 @@ CPWL_CheckBox::~CPWL_CheckBox() {} -ByteString CPWL_CheckBox::GetClassName() const { - return "CPWL_CheckBox"; -} - void CPWL_CheckBox::SetCheck(bool bCheck) { m_bChecked = bCheck; } @@ -55,10 +47,6 @@ CPWL_RadioButton::~CPWL_RadioButton() {} -ByteString CPWL_RadioButton::GetClassName() const { - return "CPWL_RadioButton"; -} - bool CPWL_RadioButton::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) { if (IsReadOnly()) return false;
diff --git a/fpdfsdk/pwl/cpwl_special_button.h b/fpdfsdk/pwl/cpwl_special_button.h index b980f84..606be78 100644 --- a/fpdfsdk/pwl/cpwl_special_button.h +++ b/fpdfsdk/pwl/cpwl_special_button.h
@@ -15,7 +15,6 @@ ~CPWL_PushButton() override; // CPWL_Button - ByteString GetClassName() const override; CFX_FloatRect GetFocusRect() const override; }; @@ -25,7 +24,6 @@ ~CPWL_CheckBox() override; // CPWL_Button - ByteString GetClassName() const override; bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override; bool OnChar(uint16_t nChar, uint32_t nFlag) override; @@ -42,7 +40,6 @@ ~CPWL_RadioButton() override; // CPWL_Button - ByteString GetClassName() const override; bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override; bool OnChar(uint16_t nChar, uint32_t nFlag) override;
diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp index 1cd9461..095fae9 100644 --- a/fpdfsdk/pwl/cpwl_wnd.cpp +++ b/fpdfsdk/pwl/cpwl_wnd.cpp
@@ -123,10 +123,6 @@ ASSERT(!m_bCreated); } -ByteString CPWL_Wnd::GetClassName() const { - return "CPWL_Wnd"; -} - void CPWL_Wnd::Create(const CreateParams& cp) { if (IsValid()) return;
diff --git a/fpdfsdk/pwl/cpwl_wnd.h b/fpdfsdk/pwl/cpwl_wnd.h index 8d962a7..1ed239e 100644 --- a/fpdfsdk/pwl/cpwl_wnd.h +++ b/fpdfsdk/pwl/cpwl_wnd.h
@@ -149,8 +149,6 @@ CPWL_Wnd(); ~CPWL_Wnd() override; - virtual ByteString GetClassName() const; - // Returns |true| iff this instance is still allocated. virtual bool InvalidateRect(CFX_FloatRect* pRect);