diff options
author | dsinclair <dsinclair@chromium.org> | 2017-02-14 14:58:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-14 14:59:09 +0000 |
commit | 92a32db931c1303388158f8a9e045e922d0b8dfa (patch) | |
tree | 5c6c05ffb40c1bb2653b415842537f7043bd6407 /fpdfsdk/pdfwindow/PWL_EditCtrl.cpp | |
parent | 4797c4240cb9e2d8cd36c583d46cd52ff94af95d (diff) | |
download | pdfium-92a32db931c1303388158f8a9e045e922d0b8dfa.tar.xz |
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 <dsinclair@chromium.org>
> Reviewed-by: Tom Sepez <tsepez@chromium.org>
>
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 <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/pdfwindow/PWL_EditCtrl.cpp')
-rw-r--r-- | fpdfsdk/pdfwindow/PWL_EditCtrl.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp index 64272e34c5..90b7a3c7c0 100644 --- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp @@ -40,8 +40,8 @@ void CPWL_EditCtrl::OnCreated() { bool CPWL_EditCtrl::IsWndHorV() { CFX_Matrix mt = GetWindowMatrix(); - CFX_PointF point1(0, 1); - CFX_PointF point2(1, 1); + CFX_FloatPoint point1(0, 1); + CFX_FloatPoint point2(1, 1); mt.TransformPoint(point1.x, point1.y); mt.TransformPoint(point2.x, point2.y); @@ -93,7 +93,8 @@ void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd, FX_FLOAT fPos = *(FX_FLOAT*)lParam; switch (wParam) { case SBT_VSCROLL: - m_pEdit->SetScrollPos(CFX_PointF(m_pEdit->GetScrollPos().x, fPos)); + m_pEdit->SetScrollPos( + CFX_FloatPoint(m_pEdit->GetScrollPos().x, fPos)); break; } } break; @@ -280,7 +281,7 @@ bool CPWL_EditCtrl::OnChar(uint16_t nChar, uint32_t nFlag) { return true; } -bool CPWL_EditCtrl::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) { +bool CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point, uint32_t nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (ClientHitTest(point)) { @@ -296,7 +297,7 @@ bool CPWL_EditCtrl::OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) { return true; } -bool CPWL_EditCtrl::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) { +bool CPWL_EditCtrl::OnLButtonUp(const CFX_FloatPoint& point, uint32_t nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (m_bMouseDown) { @@ -311,7 +312,7 @@ bool CPWL_EditCtrl::OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) { return true; } -bool CPWL_EditCtrl::OnMouseMove(const CFX_PointF& point, uint32_t nFlag) { +bool CPWL_EditCtrl::OnMouseMove(const CFX_FloatPoint& point, uint32_t nFlag) { CPWL_Wnd::OnMouseMove(point, nFlag); if (m_bMouseDown) @@ -325,8 +326,8 @@ CFX_FloatRect CPWL_EditCtrl::GetContentRect() const { } void CPWL_EditCtrl::SetEditCaret(bool bVisible) { - CFX_PointF ptHead; - CFX_PointF ptFoot; + CFX_FloatPoint ptHead; + CFX_FloatPoint ptFoot; if (bVisible) GetCaretInfo(ptHead, ptFoot); @@ -334,7 +335,8 @@ void CPWL_EditCtrl::SetEditCaret(bool bVisible) { IOnSetCaret(bVisible, ptHead, ptFoot, wpTemp); } -void CPWL_EditCtrl::GetCaretInfo(CFX_PointF& ptHead, CFX_PointF& ptFoot) const { +void CPWL_EditCtrl::GetCaretInfo(CFX_FloatPoint& ptHead, + CFX_FloatPoint& ptFoot) const { CFX_Edit_Iterator* pIterator = m_pEdit->GetIterator(); pIterator->SetAt(m_pEdit->GetCaret()); CPVT_Word word; @@ -353,15 +355,15 @@ void CPWL_EditCtrl::GetCaretInfo(CFX_PointF& ptHead, CFX_PointF& ptFoot) const { } void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const { - CFX_PointF ptHead; - CFX_PointF ptFoot; + CFX_FloatPoint ptHead; + CFX_FloatPoint ptFoot; GetCaretInfo(ptHead, ptFoot); PWLtoWnd(ptHead, x, y); } void CPWL_EditCtrl::SetCaret(bool bVisible, - const CFX_PointF& ptHead, - const CFX_PointF& ptFoot) { + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& ptFoot) { if (m_pEditCaret) { if (!IsFocused() || m_pEdit->IsSelected()) bVisible = false; @@ -411,11 +413,11 @@ int32_t CPWL_EditCtrl::GetTotalWords() const { return m_pEdit->GetTotalWords(); } -void CPWL_EditCtrl::SetScrollPos(const CFX_PointF& point) { +void CPWL_EditCtrl::SetScrollPos(const CFX_FloatPoint& point) { m_pEdit->SetScrollPos(point); } -CFX_PointF CPWL_EditCtrl::GetScrollPos() const { +CFX_FloatPoint CPWL_EditCtrl::GetScrollPos() const { return m_pEdit->GetScrollPos(); } @@ -542,8 +544,8 @@ void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy) { } void CPWL_EditCtrl::IOnSetCaret(bool bVisible, - const CFX_PointF& ptHead, - const CFX_PointF& ptFoot, + const CFX_FloatPoint& ptHead, + const CFX_FloatPoint& ptFoot, const CPVT_WordPlace& place) { PWL_CARET_INFO cInfo; cInfo.bVisible = bVisible; @@ -570,9 +572,9 @@ void CPWL_EditCtrl::GetTextRange(const CFX_FloatRect& rect, int32_t& nStartChar, int32_t& nEndChar) const { nStartChar = m_pEdit->WordPlaceToWordIndex( - m_pEdit->SearchWordPlace(CFX_PointF(rect.left, rect.top))); + m_pEdit->SearchWordPlace(CFX_FloatPoint(rect.left, rect.top))); nEndChar = m_pEdit->WordPlaceToWordIndex( - m_pEdit->SearchWordPlace(CFX_PointF(rect.right, rect.bottom))); + m_pEdit->SearchWordPlace(CFX_FloatPoint(rect.right, rect.bottom))); } CFX_WideString CPWL_EditCtrl::GetText(int32_t& nStartChar, |