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