summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-12-14 13:42:43 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 13:42:43 -0800
commit6597391975cdf4e91e4cd04f8e73f8276c72ceec (patch)
tree404d3c4762c88982b975a2e4a897d74f24610288 /xfa
parentaefbe4b52d8f309dbb2d8655d936d4a4b443c76e (diff)
downloadpdfium-6597391975cdf4e91e4cd04f8e73f8276c72ceec.tar.xz
Remove unused CFWL_Form flags
Cleanup flags in CFWL_Form which are never set. Review-Url: https://codereview.chromium.org/2575573002
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fwl/cfwl_form.cpp74
-rw-r--r--xfa/fwl/cfwl_form.h8
2 files changed, 3 insertions, 79 deletions
diff --git a/xfa/fwl/cfwl_form.cpp b/xfa/fwl/cfwl_form.cpp
index 58d9e18989..78aba0c6db 100644
--- a/xfa/fwl/cfwl_form.cpp
+++ b/xfa/fwl/cfwl_form.cpp
@@ -32,12 +32,6 @@ const int kSystemButtonSpan = 2;
} // namespace
-namespace {
-
-const uint8_t kCornerEnlarge = 10;
-
-} // namespace
-
CFWL_Form::CFWL_Form(const CFWL_App* app,
std::unique_ptr<CFWL_WidgetProperties> properties,
CFWL_Widget* pOuter)
@@ -109,53 +103,8 @@ FWL_WidgetHit CFWL_Form::HitTest(FX_FLOAT fx, FX_FLOAT fy) {
rtCap.Set(m_fCYBorder, m_fCXBorder,
0 - kSystemButtonSize * m_iSysBox - 2 * m_fCYBorder,
0 - m_fCXBorder);
- if (rtCap.Contains(fx, fy))
- return FWL_WidgetHit::Titlebar;
- if ((m_pProperties->m_dwStyles & FWL_WGTSTYLE_Border) &&
- (m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_Resize)) {
- FX_FLOAT fWidth = m_rtRelative.width - 2 * (m_fCYBorder + kCornerEnlarge);
- FX_FLOAT fHeight = m_rtRelative.height - 2 * (m_fCXBorder + kCornerEnlarge);
-
- CFX_RectF rt;
- rt.Set(0, m_fCXBorder + kCornerEnlarge, m_fCYBorder, fHeight);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::Left;
-
- rt.Set(m_rtRelative.width - m_fCYBorder, m_fCXBorder + kCornerEnlarge,
- m_fCYBorder, fHeight);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::Right;
-
- rt.Set(m_fCYBorder + kCornerEnlarge, 0, fWidth, m_fCXBorder);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::Top;
-
- rt.Set(m_fCYBorder + kCornerEnlarge, m_rtRelative.height - m_fCXBorder,
- fWidth, m_fCXBorder);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::Bottom;
-
- rt.Set(0, 0, m_fCYBorder + kCornerEnlarge, m_fCXBorder + kCornerEnlarge);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::LeftTop;
-
- rt.Set(0, m_rtRelative.height - m_fCXBorder - kCornerEnlarge,
- m_fCYBorder + kCornerEnlarge, m_fCXBorder + kCornerEnlarge);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::LeftBottom;
-
- rt.Set(m_rtRelative.width - m_fCYBorder - kCornerEnlarge, 0,
- m_fCYBorder + kCornerEnlarge, m_fCXBorder + kCornerEnlarge);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::RightTop;
-
- rt.Set(m_rtRelative.width - m_fCYBorder - kCornerEnlarge,
- m_rtRelative.height - m_fCXBorder - kCornerEnlarge,
- m_fCYBorder + kCornerEnlarge, m_fCXBorder + kCornerEnlarge);
- if (rt.Contains(fx, fy))
- return FWL_WidgetHit::RightBottom;
- }
- return FWL_WidgetHit::Client;
+ return rtCap.Contains(fx, fy) ? FWL_WidgetHit::Titlebar
+ : FWL_WidgetHit::Client;
}
void CFWL_Form::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) {
@@ -167,8 +116,7 @@ void CFWL_Form::DrawWidget(CFX_Graphics* pGraphics, const CFX_Matrix* pMatrix) {
IFWL_ThemeProvider* pTheme = m_pProperties->m_pThemeProvider;
bool bInactive = !IsActive();
int32_t iState = bInactive ? CFWL_PartState_Inactive : CFWL_PartState_Normal;
- if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_NoDrawClient) == 0)
- DrawBackground(pGraphics, pTheme);
+ DrawBackground(pGraphics, pTheme);
#ifdef FWL_UseMacSystemBorder
return;
@@ -489,9 +437,6 @@ void CFWL_Form::OnProcessMessage(CFWL_Message* pMessage) {
case FWL_MouseCommand::Leave:
OnMouseLeave(pMsg);
break;
- case FWL_MouseCommand::LeftButtonDblClk:
- OnLButtonDblClk(pMsg);
- break;
default:
break;
}
@@ -609,16 +554,3 @@ void CFWL_Form::OnMouseLeave(CFWL_MessageMouse* pMsg) {
pHover->SetNormal();
RepaintRect(pHover->m_rtBtn);
}
-
-void CFWL_Form::OnLButtonDblClk(CFWL_MessageMouse* pMsg) {
- if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_FRM_Resize) &&
- HitTest(pMsg->m_fx, pMsg->m_fy) == FWL_WidgetHit::Titlebar) {
- if (m_bMaximized)
- SetWidgetRect(m_rtRestore);
- else
- SetWorkAreaRect();
-
- Update();
- m_bMaximized = !m_bMaximized;
- }
-}
diff --git a/xfa/fwl/cfwl_form.h b/xfa/fwl/cfwl_form.h
index 8755874fab..e89350ba3b 100644
--- a/xfa/fwl/cfwl_form.h
+++ b/xfa/fwl/cfwl_form.h
@@ -15,13 +15,6 @@
#define FWL_CLASS_Form L"FWL_FORM"
#define FWL_CLASS_FormProxy L"FWL_FORMPROXY"
-#define FWL_STYLEEXT_FRM_Resize (1L << 0)
-#define FWL_STYLEEXT_FRM_NativeBorder (1L << 1)
-#define FWL_STYLEEXT_FRM_RoundCorner (2L << 1)
-#define FWL_STYLEEXT_FRM_RoundCorner4 (3L << 1)
-#define FWL_STYLEEXT_FRM_NoDrawClient (1L << 3)
-#define FWL_STYLEEXT_FRM_BorderCornerMask (3L << 1)
-#define FWL_STYLEEXT_FRM_Max (3)
#if (_FX_OS_ == _FX_MACOSX_)
#define FWL_UseMacSystemBorder
@@ -74,7 +67,6 @@ class CFWL_Form : public CFWL_Widget {
void OnLButtonUp(CFWL_MessageMouse* pMsg);
void OnMouseMove(CFWL_MessageMouse* pMsg);
void OnMouseLeave(CFWL_MessageMouse* pMsg);
- void OnLButtonDblClk(CFWL_MessageMouse* pMsg);
#if (_FX_OS_ == _FX_MACOSX_)
bool m_bMouseIn;