summaryrefslogtreecommitdiff
path: root/fpdfsdk/pdfwindow/PWL_Wnd.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-23 14:38:48 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-23 21:40:42 +0000
commit90b7326a13555795d7292268e83ae4933fd038f5 (patch)
treedadb243bee495acc76fa86a6b2626346d68bc3f3 /fpdfsdk/pdfwindow/PWL_Wnd.cpp
parent77f6d0f8e64596992df4d2a046cc86f051574e02 (diff)
downloadpdfium-90b7326a13555795d7292268e83ae4933fd038f5.tar.xz
Cleanup PWL_Wnd
De-virtualize methods that are never overridden; put all virtual methods together; Remove some methods that are never called. Change-Id: I6ac9d8d6ecf78c59c1229f3cff3b1f205399649f Reviewed-on: https://pdfium-review.googlesource.com/2824 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_Wnd.cpp')
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp64
1 files changed, 6 insertions, 58 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index b10a0854a7..14024dd5d4 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -420,7 +420,6 @@ void CPWL_Wnd::InvalidateRect(CFX_FloatRect* pRect) {
}
PWL_IMPLEMENT_KEY_METHOD(OnKeyDown)
-PWL_IMPLEMENT_KEY_METHOD(OnKeyUp)
PWL_IMPLEMENT_KEY_METHOD(OnChar)
#undef PWL_IMPLEMENT_KEY_METHOD
@@ -451,9 +450,6 @@ PWL_IMPLEMENT_KEY_METHOD(OnChar)
PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonDblClk)
PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonDown)
PWL_IMPLEMENT_MOUSE_METHOD(OnLButtonUp)
-PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDblClk)
-PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonDown)
-PWL_IMPLEMENT_MOUSE_METHOD(OnMButtonUp)
PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonDown)
PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
@@ -844,21 +840,6 @@ FX_RECT CPWL_Wnd::PWLtoWnd(const CFX_FloatRect& rect) const {
(int32_t)(rcTemp.right + 0.5), (int32_t)(rcTemp.top + 0.5));
}
-CFX_PointF CPWL_Wnd::ChildToParent(const CFX_PointF& point) const {
- CFX_Matrix mt = GetChildMatrix();
- return mt.IsIdentity() ? point : mt.Transform(point);
-}
-
-CFX_FloatRect CPWL_Wnd::ChildToParent(const CFX_FloatRect& rect) const {
- CFX_Matrix mt = GetChildMatrix();
- if (mt.IsIdentity())
- return rect;
-
- CFX_FloatRect rc = rect;
- mt.TransformRect(rc);
- return rc;
-}
-
CFX_PointF CPWL_Wnd::ParentToChild(const CFX_PointF& point) const {
CFX_Matrix mt = GetChildMatrix();
if (mt.IsIdentity())
@@ -879,18 +860,6 @@ CFX_FloatRect CPWL_Wnd::ParentToChild(const CFX_FloatRect& rect) const {
return rc;
}
-FX_FLOAT CPWL_Wnd::GetItemHeight(FX_FLOAT fLimitWidth) {
- return 0;
-}
-
-FX_FLOAT CPWL_Wnd::GetItemLeftMargin() {
- return 0;
-}
-
-FX_FLOAT CPWL_Wnd::GetItemRightMargin() {
- return 0;
-}
-
CFX_Matrix CPWL_Wnd::GetChildToRoot() const {
CFX_Matrix mt(1, 0, 0, 1, 0, 0);
if (HasFlag(PWS_CHILD)) {
@@ -928,40 +897,19 @@ void CPWL_Wnd::EnableWindow(bool bEnable) {
pChild->EnableWindow(bEnable);
}
m_bEnabled = bEnable;
- if (bEnable)
- OnEnabled();
- else
- OnDisabled();
}
-bool CPWL_Wnd::IsEnabled() {
- return m_bEnabled;
-}
-
-void CPWL_Wnd::OnEnabled() {}
-
-void CPWL_Wnd::OnDisabled() {}
-
bool CPWL_Wnd::IsCTRLpressed(uint32_t nFlag) const {
- if (CFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
- return pSystemHandler->IsCTRLKeyDown(nFlag);
- }
-
- return false;
+ CFX_SystemHandler* pSystemHandler = GetSystemHandler();
+ return pSystemHandler && pSystemHandler->IsCTRLKeyDown(nFlag);
}
bool CPWL_Wnd::IsSHIFTpressed(uint32_t nFlag) const {
- if (CFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
- return pSystemHandler->IsSHIFTKeyDown(nFlag);
- }
-
- return false;
+ CFX_SystemHandler* pSystemHandler = GetSystemHandler();
+ return pSystemHandler && pSystemHandler->IsSHIFTKeyDown(nFlag);
}
bool CPWL_Wnd::IsALTpressed(uint32_t nFlag) const {
- if (CFX_SystemHandler* pSystemHandler = GetSystemHandler()) {
- return pSystemHandler->IsALTKeyDown(nFlag);
- }
-
- return false;
+ CFX_SystemHandler* pSystemHandler = GetSystemHandler();
+ return pSystemHandler && pSystemHandler->IsALTKeyDown(nFlag);
}