From 92a32db931c1303388158f8a9e045e922d0b8dfa Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 14 Feb 2017 14:58:49 +0000 Subject: Revert "Convert CFX_FloatPoint to CFX_PointF" This reverts commit 4797c4240cb9e2d8cd36c583d46cd52ff94af95d. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert CFX_FloatPoint to CFX_PointF > > The two classes store the same information, remove the CFX_FloatPoint variant. > > Change-Id: Ie598c2ba5af04fb2bb3347dd48c30fd5e4845e62 > Reviewed-on: https://pdfium-review.googlesource.com/2612 > Commit-Queue: dsinclair > Reviewed-by: Tom Sepez > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia42074e706983c62d2e57497c3079b3c338343a3 Reviewed-on: https://pdfium-review.googlesource.com/2694 Commit-Queue: dsinclair Reviewed-by: dsinclair --- fpdfsdk/formfiller/cffl_checkbox.cpp | 2 +- fpdfsdk/formfiller/cffl_checkbox.h | 2 +- fpdfsdk/formfiller/cffl_formfiller.cpp | 39 ++++++++++++----------- fpdfsdk/formfiller/cffl_formfiller.h | 30 +++++++++-------- fpdfsdk/formfiller/cffl_interactiveformfiller.cpp | 16 +++++----- fpdfsdk/formfiller/cffl_interactiveformfiller.h | 16 +++++----- fpdfsdk/formfiller/cffl_radiobutton.cpp | 2 +- fpdfsdk/formfiller/cffl_radiobutton.h | 2 +- 8 files changed, 56 insertions(+), 53 deletions(-) (limited to 'fpdfsdk/formfiller') diff --git a/fpdfsdk/formfiller/cffl_checkbox.cpp b/fpdfsdk/formfiller/cffl_checkbox.cpp index c233c136c1..ffa3a032cf 100644 --- a/fpdfsdk/formfiller/cffl_checkbox.cpp +++ b/fpdfsdk/formfiller/cffl_checkbox.cpp @@ -73,7 +73,7 @@ bool CFFL_CheckBox::OnChar(CPDFSDK_Annot* pAnnot, bool CFFL_CheckBox::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point); if (IsValid()) { diff --git a/fpdfsdk/formfiller/cffl_checkbox.h b/fpdfsdk/formfiller/cffl_checkbox.h index 79ddc847cc..65dba29f2e 100644 --- a/fpdfsdk/formfiller/cffl_checkbox.h +++ b/fpdfsdk/formfiller/cffl_checkbox.h @@ -24,7 +24,7 @@ class CFFL_CheckBox : public CFFL_Button { bool OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) override; + const CFX_FloatPoint& point) override; bool IsDataChanged(CPDFSDK_PageView* pPageView) override; void SaveData(CPDFSDK_PageView* pPageView) override; }; diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp index cad8dafdbc..9ccca2b04a 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.cpp +++ b/fpdfsdk/formfiller/cffl_formfiller.cpp @@ -119,7 +119,7 @@ void CFFL_FormFiller::OnMouseExit(CPDFSDK_PageView* pPageView, bool CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { if (CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true)) { m_bValid = true; FX_RECT rect = GetViewBBox(pPageView, pAnnot); @@ -137,7 +137,7 @@ bool CFFL_FormFiller::OnLButtonDown(CPDFSDK_PageView* pPageView, bool CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false); if (!pWnd) return false; @@ -151,7 +151,7 @@ bool CFFL_FormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, bool CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false); if (!pWnd) return false; @@ -163,7 +163,7 @@ bool CFFL_FormFiller::OnLButtonDblClk(CPDFSDK_PageView* pPageView, bool CFFL_FormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { if (m_ptOldPos != point) m_ptOldPos = point; @@ -179,7 +179,7 @@ bool CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, short zDelta, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { if (!IsValid()) return false; @@ -190,7 +190,7 @@ bool CFFL_FormFiller::OnMouseWheel(CPDFSDK_PageView* pPageView, bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CPWL_Wnd* pWnd = GetPDFWindow(pPageView, true); if (!pWnd) return false; @@ -202,7 +202,7 @@ bool CFFL_FormFiller::OnRButtonDown(CPDFSDK_PageView* pPageView, bool CFFL_FormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CPWL_Wnd* pWnd = GetPDFWindow(pPageView, false); if (!pWnd) return false; @@ -483,25 +483,25 @@ CFX_FloatRect CFFL_FormFiller::PWLtoFFL(const CFX_FloatRect& rect) { return temp; } -CFX_PointF CFFL_FormFiller::FFLtoPWL(const CFX_PointF& point) { +CFX_FloatPoint CFFL_FormFiller::FFLtoPWL(const CFX_FloatPoint& point) { CFX_Matrix mt; mt.SetReverse(GetCurMatrix()); - CFX_PointF pt = point; - mt.Transform(pt); + CFX_FloatPoint pt = point; + mt.TransformPoint(pt.x, pt.y); return pt; } -CFX_PointF CFFL_FormFiller::PWLtoFFL(const CFX_PointF& point) { +CFX_FloatPoint CFFL_FormFiller::PWLtoFFL(const CFX_FloatPoint& point) { CFX_Matrix mt = GetCurMatrix(); - CFX_PointF pt = point; - mt.Transform(pt); + CFX_FloatPoint pt = point; + mt.TransformPoint(pt.x, pt.y); return pt; } -CFX_PointF CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, - const CFX_PointF& pt) { +CFX_FloatPoint CFFL_FormFiller::WndtoPWL(CPDFSDK_PageView* pPageView, + const CFX_FloatPoint& pt) { return FFLtoPWL(pt); } @@ -633,9 +633,9 @@ void CFFL_Button::OnMouseExit(CPDFSDK_PageView* pPageView, bool CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CFX_FloatRect rcAnnot = pAnnot->GetRect(); - if (!rcAnnot.Contains(point)) + if (!rcAnnot.Contains(point.x, point.y)) return false; m_bMouseDown = true; @@ -648,7 +648,7 @@ bool CFFL_Button::OnLButtonDown(CPDFSDK_PageView* pPageView, bool CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CFX_FloatRect rcAnnot = pAnnot->GetRect(); if (!rcAnnot.Contains(point.x, point.y)) return false; @@ -664,8 +664,9 @@ bool CFFL_Button::OnLButtonUp(CPDFSDK_PageView* pPageView, bool CFFL_Button::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT(m_pFormFillEnv); + return true; } diff --git a/fpdfsdk/formfiller/cffl_formfiller.h b/fpdfsdk/formfiller/cffl_formfiller.h index 7462b40e97..cf1aaf7205 100644 --- a/fpdfsdk/formfiller/cffl_formfiller.h +++ b/fpdfsdk/formfiller/cffl_formfiller.h @@ -41,32 +41,32 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { virtual bool OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); virtual bool OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); virtual bool OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); virtual bool OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); virtual bool OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, short zDelta, - const CFX_PointF& point); + const CFX_FloatPoint& point); virtual bool OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); virtual bool OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); virtual bool OnKeyDown(CPDFSDK_Annot* pAnnot, uint32_t nKeyCode, @@ -104,10 +104,11 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { CFX_FloatRect FFLtoPWL(const CFX_FloatRect& rect); CFX_FloatRect PWLtoFFL(const CFX_FloatRect& rect); - CFX_PointF FFLtoPWL(const CFX_PointF& point); - CFX_PointF PWLtoFFL(const CFX_PointF& point); + CFX_FloatPoint FFLtoPWL(const CFX_FloatPoint& point); + CFX_FloatPoint PWLtoFFL(const CFX_FloatPoint& point); - CFX_PointF WndtoPWL(CPDFSDK_PageView* pPageView, const CFX_PointF& pt); + CFX_FloatPoint WndtoPWL(CPDFSDK_PageView* pPageView, + const CFX_FloatPoint& pt); CFX_FloatRect FFLtoWnd(CPDFSDK_PageView* pPageView, const CFX_FloatRect& rect); @@ -158,9 +159,10 @@ class CFFL_FormFiller : public IPWL_Provider, public CPWL_TimerHandler { CPDFSDK_FormFillEnvironment* m_pFormFillEnv; CPDFSDK_Widget* m_pWidget; CPDFSDK_Annot* m_pAnnot; + bool m_bValid; CFFL_PageView2PDFWindow m_Maps; - CFX_PointF m_ptOldPos; + CFX_FloatPoint m_ptOldPos; }; class CFFL_Button : public CFFL_FormFiller { @@ -176,15 +178,15 @@ class CFFL_Button : public CFFL_FormFiller { bool OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) override; + const CFX_FloatPoint& point) override; bool OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) override; + const CFX_FloatPoint& point) override; bool OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) override; + const CFX_FloatPoint& point) override; void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, CFX_RenderDevice* pDevice, diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp index a8368f4352..82b9549a1c 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp @@ -34,7 +34,7 @@ CFFL_InteractiveFormFiller::~CFFL_InteractiveFormFiller() {} bool CFFL_InteractiveFormFiller::Annot_HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_PointF& point) { + CFX_FloatPoint point) { CFX_FloatRect rc = pAnnot->GetRect(); return rc.Contains(point.x, point.y); } @@ -179,7 +179,7 @@ bool CFFL_InteractiveFormFiller::OnLButtonDown( CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); if (!m_bNotifying) { CPDFSDK_Widget* pWidget = static_cast(pAnnot->Get()); @@ -220,7 +220,7 @@ bool CFFL_InteractiveFormFiller::OnLButtonDown( bool CFFL_InteractiveFormFiller::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CPDFSDK_Widget* pWidget = static_cast(pAnnot->Get()); @@ -294,7 +294,7 @@ bool CFFL_InteractiveFormFiller::OnLButtonDblClk( CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false); return pFormFiller && @@ -304,7 +304,7 @@ bool CFFL_InteractiveFormFiller::OnLButtonDblClk( bool CFFL_InteractiveFormFiller::OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), true); return pFormFiller && @@ -316,7 +316,7 @@ bool CFFL_InteractiveFormFiller::OnMouseWheel( CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, short zDelta, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false); return pFormFiller && @@ -328,7 +328,7 @@ bool CFFL_InteractiveFormFiller::OnRButtonDown( CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false); return pFormFiller && @@ -338,7 +338,7 @@ bool CFFL_InteractiveFormFiller::OnRButtonDown( bool CFFL_InteractiveFormFiller::OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { ASSERT((*pAnnot)->GetPDFAnnot()->GetSubtype() == CPDF_Annot::Subtype::WIDGET); CFFL_FormFiller* pFormFiller = GetFormFiller(pAnnot->Get(), false); return pFormFiller && diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h index 90fd98c0e8..e81d3c88d0 100644 --- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h +++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h @@ -27,7 +27,7 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify { bool Annot_HitTest(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, - const CFX_PointF& point); + CFX_FloatPoint point); FX_RECT GetViewBBox(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot); void OnDraw(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, @@ -45,32 +45,32 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify { bool OnLButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); bool OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); bool OnLButtonDblClk(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); bool OnMouseMove(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); bool OnMouseWheel(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, short zDelta, - const CFX_PointF& point); + const CFX_FloatPoint& point); bool OnRButtonDown(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); bool OnRButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot::ObservedPtr* pAnnot, uint32_t nFlags, - const CFX_PointF& point); + const CFX_FloatPoint& point); bool OnKeyDown(CPDFSDK_Annot* pAnnot, uint32_t nKeyCode, uint32_t nFlags); bool OnChar(CPDFSDK_Annot* pAnnot, uint32_t nChar, uint32_t nFlags); diff --git a/fpdfsdk/formfiller/cffl_radiobutton.cpp b/fpdfsdk/formfiller/cffl_radiobutton.cpp index e78160e5dc..70d4c0dee6 100644 --- a/fpdfsdk/formfiller/cffl_radiobutton.cpp +++ b/fpdfsdk/formfiller/cffl_radiobutton.cpp @@ -72,7 +72,7 @@ bool CFFL_RadioButton::OnChar(CPDFSDK_Annot* pAnnot, bool CFFL_RadioButton::OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) { + const CFX_FloatPoint& point) { CFFL_Button::OnLButtonUp(pPageView, pAnnot, nFlags, point); if (IsValid()) { diff --git a/fpdfsdk/formfiller/cffl_radiobutton.h b/fpdfsdk/formfiller/cffl_radiobutton.h index 10ac37dcb8..49a658f84e 100644 --- a/fpdfsdk/formfiller/cffl_radiobutton.h +++ b/fpdfsdk/formfiller/cffl_radiobutton.h @@ -24,7 +24,7 @@ class CFFL_RadioButton : public CFFL_Button { bool OnLButtonUp(CPDFSDK_PageView* pPageView, CPDFSDK_Annot* pAnnot, uint32_t nFlags, - const CFX_PointF& point) override; + const CFX_FloatPoint& point) override; bool IsDataChanged(CPDFSDK_PageView* pPageView) override; void SaveData(CPDFSDK_PageView* pPageView) override; }; -- cgit v1.2.3