summaryrefslogtreecommitdiff
path: root/xfa/fwl/cfwl_widget.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-05-11 18:37:26 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-11 18:37:26 +0000
commitce7a8158376dd81e2321a77a331dca5f451b471c (patch)
tree9de6a5e8356c8392bfe6890cc4822cadd5b56dae /xfa/fwl/cfwl_widget.cpp
parentddfa5177021f76b4d84c6fbdce964ab3ca17e046 (diff)
downloadpdfium-ce7a8158376dd81e2321a77a331dca5f451b471c.tar.xz
Remove CFWL_WidgetMgr::IsFormDisabled().
This method always returns true, so make that assumption and clean up dead code. More cleanups will follow this one to remove the code that can now be inferred to be dead. Change-Id: I73f077561ab511a1c2c09ac6990ab5cdc5bfb055 Reviewed-on: https://pdfium-review.googlesource.com/32391 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_widget.cpp')
-rw-r--r--xfa/fwl/cfwl_widget.cpp65
1 files changed, 9 insertions, 56 deletions
diff --git a/xfa/fwl/cfwl_widget.cpp b/xfa/fwl/cfwl_widget.cpp
index e891cd1cbb..f7ba040866 100644
--- a/xfa/fwl/cfwl_widget.cpp
+++ b/xfa/fwl/cfwl_widget.cpp
@@ -161,44 +161,15 @@ FWL_WidgetHit CFWL_Widget::HitTest(const CFX_PointF& point) {
CFX_PointF CFWL_Widget::TransformTo(CFWL_Widget* pWidget,
const CFX_PointF& point) {
- if (m_pWidgetMgr->IsFormDisabled()) {
- CFX_SizeF szOffset;
- if (IsParent(pWidget)) {
- szOffset = GetOffsetFromParent(pWidget);
- } else {
- szOffset = pWidget->GetOffsetFromParent(this);
- szOffset.width = -szOffset.width;
- szOffset.height = -szOffset.height;
- }
- return point + CFX_PointF(szOffset.width, szOffset.height);
+ CFX_SizeF szOffset;
+ if (IsParent(pWidget)) {
+ szOffset = GetOffsetFromParent(pWidget);
+ } else {
+ szOffset = pWidget->GetOffsetFromParent(this);
+ szOffset.width = -szOffset.width;
+ szOffset.height = -szOffset.height;
}
-
- CFX_PointF ret = point;
- CFWL_Widget* parent = GetParent();
- if (parent)
- ret = GetMatrix().Transform(ret + GetWidgetRect().TopLeft());
-
- CFWL_Widget* form1 = m_pWidgetMgr->GetSystemFormWidget(this);
- if (!form1)
- return ret;
-
- if (!pWidget)
- return ret + form1->GetWidgetRect().TopLeft();
-
- CFWL_Widget* form2 = m_pWidgetMgr->GetSystemFormWidget(pWidget);
- if (!form2)
- return ret;
- if (form1 != form2) {
- ret += form1->GetWidgetRect().TopLeft();
- ret -= form2->GetWidgetRect().TopLeft();
- }
-
- parent = pWidget->GetParent();
- if (!parent)
- return ret;
-
- return pWidget->GetMatrix().GetInverse().Transform(ret) -
- pWidget->GetWidgetRect().TopLeft();
+ return point + CFX_PointF(szOffset.width, szOffset.height);
}
CFX_Matrix CFWL_Widget::GetMatrix() {
@@ -349,25 +320,7 @@ void CFWL_Widget::CalcTextRect(const WideString& wsText,
pTheme->CalcTextRect(&calPart, pRect);
}
-void CFWL_Widget::SetFocus(bool bFocus) {
- if (m_pWidgetMgr->IsFormDisabled())
- return;
-
- const CFWL_App* pApp = GetOwnerApp();
- if (!pApp)
- return;
-
- CFWL_NoteDriver* pDriver =
- static_cast<CFWL_NoteDriver*>(pApp->GetNoteDriver());
- if (!pDriver)
- return;
-
- CFWL_Widget* curFocus = pDriver->GetFocus();
- if (bFocus && curFocus != this)
- pDriver->SetFocus(this);
- else if (!bFocus && curFocus == this)
- pDriver->SetFocus(nullptr);
-}
+void CFWL_Widget::SetFocus(bool bFocus) {}
void CFWL_Widget::SetGrab(bool bSet) {
const CFWL_App* pApp = GetOwnerApp();