Remove CFFL_FormFiller::WndtoPWL() and FFLtoWnd()
There are really only two relevant coordinate systems in this code,
FFL as used by code in formfiller/, and PWL as used by code in pwl/.
The "Wnd system", as contained in the names above, is really just the
FFL system. Hence "WndtoPWL" is really just "FFLtoPWL", and "FFLToWnd"
is really just "FFLtoFFL" and a no-op passthrough.
Change-Id: I559e7d4e8008fa1504f1cbb21ef1b6382b59f0a5
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/65872
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index a214920..2e14dad 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -97,7 +97,7 @@
InvalidateRect(rect);
if (!rect.Contains(static_cast<int>(point.x), static_cast<int>(point.y)))
return false;
- return pWnd->OnLButtonDown(WndtoPWL(point), nFlags);
+ return pWnd->OnLButtonDown(FFLtoPWL(point), nFlags);
}
bool CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView,
@@ -109,7 +109,7 @@
return false;
InvalidateRect(GetViewBBox(pPageView));
- pWnd->OnLButtonUp(WndtoPWL(point), nFlags);
+ pWnd->OnLButtonUp(FFLtoPWL(point), nFlags);
return true;
}
@@ -120,7 +120,7 @@
if (!pWnd)
return false;
- pWnd->OnLButtonDblClk(WndtoPWL(point), nFlags);
+ pWnd->OnLButtonDblClk(FFLtoPWL(point), nFlags);
return true;
}
@@ -131,7 +131,7 @@
if (!pWnd)
return false;
- pWnd->OnMouseMove(WndtoPWL(point), nFlags);
+ pWnd->OnMouseMove(FFLtoPWL(point), nFlags);
return true;
}
@@ -143,21 +143,21 @@
return false;
CPWL_Wnd* pWnd = GetPWLWindow(pPageView, true);
- return pWnd && pWnd->OnMouseWheel(zDelta, WndtoPWL(point), nFlags);
+ return pWnd && pWnd->OnMouseWheel(zDelta, FFLtoPWL(point), nFlags);
}
bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView,
uint32_t nFlags,
const CFX_PointF& point) {
CPWL_Wnd* pWnd = GetPWLWindow(pPageView, true);
- return pWnd && pWnd->OnRButtonDown(WndtoPWL(point), nFlags);
+ return pWnd && pWnd->OnRButtonDown(FFLtoPWL(point), nFlags);
}
bool CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView,
uint32_t nFlags,
const CFX_PointF& point) {
CPWL_Wnd* pWnd = GetPWLWindow(pPageView, false);
- return pWnd && pWnd->OnRButtonUp(WndtoPWL(point), nFlags);
+ return pWnd && pWnd->OnRButtonUp(FFLtoPWL(point), nFlags);
}
bool CFFL_FormFiller::OnKeyDown(uint32_t nKeyCode, uint32_t nFlags) {
@@ -426,7 +426,7 @@
if (!pWnd)
return CFX_FloatRect();
- CFX_FloatRect rcFocus = FFLtoWnd(PWLtoFFL(pWnd->GetFocusRect()));
+ CFX_FloatRect rcFocus = PWLtoFFL(pWnd->GetFocusRect());
return pPageView->GetPDFPage()->GetBBox().Contains(rcFocus) ? rcFocus
: CFX_FloatRect();
}
@@ -447,14 +447,6 @@
return GetCurMatrix().Transform(point);
}
-CFX_PointF CFFL_FormFiller::WndtoPWL(const CFX_PointF& pt) {
- return FFLtoPWL(pt);
-}
-
-CFX_FloatRect CFFL_FormFiller::FFLtoWnd(const CFX_FloatRect& rect) {
- return rect;
-}
-
bool CFFL_FormFiller::CommitData(CPDFSDK_PageView* pPageView, uint32_t nFlag) {
if (!IsDataChanged(pPageView))
return true;
diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h
index 05bacaf..d079f8e 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.h
+++ b/fpdfsdk/formfiller/cffl_formfiller.h
@@ -113,8 +113,6 @@
CFX_FloatRect PWLtoFFL(const CFX_FloatRect& rect);
CFX_PointF FFLtoPWL(const CFX_PointF& point);
CFX_PointF PWLtoFFL(const CFX_PointF& point);
- CFX_PointF WndtoPWL(const CFX_PointF& pt);
- CFX_FloatRect FFLtoWnd(const CFX_FloatRect& rect);
bool CommitData(CPDFSDK_PageView* pPageView, uint32_t nFlag);
virtual bool IsDataChanged(CPDFSDK_PageView* pPageView);