diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-02-26 13:17:56 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-02-26 13:17:56 -0800 |
commit | 566b974287ce0e81a963138152b8898f22480f52 (patch) | |
tree | b85991aee92475549d84e8cb68702960b85d1252 /fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp | |
parent | 3b8fdd34bdf57ec45291b77008a43249f838efcb (diff) | |
download | pdfium-566b974287ce0e81a963138152b8898f22480f52.tar.xz |
Revert "Replace CPDF_Rect and CPDF_Point with CFX types."
This reverts commit 3b8fdd34bdf57ec45291b77008a43249f838efcb.
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1743753002 .
Diffstat (limited to 'fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp')
-rw-r--r-- | fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp index 10b5d6c04f..c505c7e780 100644 --- a/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp +++ b/fpdfsdk/src/pdfwindow/PWL_EditCtrl.cpp @@ -47,8 +47,8 @@ void CPWL_EditCtrl::OnCreated() { FX_BOOL CPWL_EditCtrl::IsWndHorV() { CFX_Matrix mt = GetWindowMatrix(); - CFX_FloatPoint point1(0, 1); - CFX_FloatPoint point2(1, 1); + CPDF_Point point1(0, 1); + CPDF_Point point2(1, 1); mt.Transform(point1.x, point1.y); mt.Transform(point2.x, point2.y); @@ -100,8 +100,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(CPDF_Point(m_pEdit->GetScrollPos().x, fPos)); break; } } break; @@ -128,7 +127,7 @@ void CPWL_EditCtrl::CreateEditCaret(const PWL_CREATEPARAM& cp) { ecp.dwFlags = PWS_CHILD | PWS_NOREFRESHCLIP; ecp.dwBorderWidth = 0; ecp.nBorderStyle = PBS_SOLID; - ecp.rcRectWnd = CFX_FloatRect(0, 0, 0, 0); + ecp.rcRectWnd = CPDF_Rect(0, 0, 0, 0); m_pEditCaret->Create(ecp); } @@ -291,8 +290,7 @@ FX_BOOL CPWL_EditCtrl::OnChar(FX_WORD nChar, FX_DWORD nFlag) { return TRUE; } -FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonDown(point, nFlag); if (ClientHitTest(point)) { @@ -308,8 +306,7 @@ FX_BOOL CPWL_EditCtrl::OnLButtonDown(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnLButtonUp(point, nFlag); if (m_bMouseDown) { @@ -324,8 +321,7 @@ FX_BOOL CPWL_EditCtrl::OnLButtonUp(const CFX_FloatPoint& point, return TRUE; } -FX_BOOL CPWL_EditCtrl::OnMouseMove(const CFX_FloatPoint& point, - FX_DWORD nFlag) { +FX_BOOL CPWL_EditCtrl::OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) { CPWL_Wnd::OnMouseMove(point, nFlag); if (m_bMouseDown) @@ -334,12 +330,12 @@ FX_BOOL CPWL_EditCtrl::OnMouseMove(const CFX_FloatPoint& point, return TRUE; } -CFX_FloatRect CPWL_EditCtrl::GetContentRect() const { +CPDF_Rect CPWL_EditCtrl::GetContentRect() const { return m_pEdit->GetContentRect(); } void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible) { - CFX_FloatPoint ptHead(0, 0), ptFoot(0, 0); + CPDF_Point ptHead(0, 0), ptFoot(0, 0); if (bVisible) { GetCaretInfo(ptHead, ptFoot); @@ -349,8 +345,7 @@ void CPWL_EditCtrl::SetEditCaret(FX_BOOL bVisible) { IOnSetCaret(bVisible, ptHead, ptFoot, wpTemp); } -void CPWL_EditCtrl::GetCaretInfo(CFX_FloatPoint& ptHead, - CFX_FloatPoint& ptFoot) const { +void CPWL_EditCtrl::GetCaretInfo(CPDF_Point& ptHead, CPDF_Point& ptFoot) const { if (IFX_Edit_Iterator* pIterator = m_pEdit->GetIterator()) { pIterator->SetAt(m_pEdit->GetCaret()); CPVT_Word word; @@ -370,7 +365,7 @@ void CPWL_EditCtrl::GetCaretInfo(CFX_FloatPoint& ptHead, } void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const { - CFX_FloatPoint ptHead(0, 0), ptFoot(0, 0); + CPDF_Point ptHead(0, 0), ptFoot(0, 0); GetCaretInfo(ptHead, ptFoot); @@ -378,8 +373,8 @@ void CPWL_EditCtrl::GetCaretPos(int32_t& x, int32_t& y) const { } void CPWL_EditCtrl::SetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot) { + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot) { if (m_pEditCaret) { if (!IsFocused() || m_pEdit->IsSelected()) bVisible = FALSE; @@ -438,16 +433,16 @@ int32_t CPWL_EditCtrl::GetTotalWords() const { return 0; } -void CPWL_EditCtrl::SetScrollPos(const CFX_FloatPoint& point) { +void CPWL_EditCtrl::SetScrollPos(const CPDF_Point& point) { if (m_pEdit) m_pEdit->SetScrollPos(point); } -CFX_FloatPoint CPWL_EditCtrl::GetScrollPos() const { +CPDF_Point CPWL_EditCtrl::GetScrollPos() const { if (m_pEdit) return m_pEdit->GetScrollPos(); - return CFX_FloatPoint(0.0f, 0.0f); + return CPDF_Point(0.0f, 0.0f); } CPDF_Font* CPWL_EditCtrl::GetCaretFont() const { @@ -575,8 +570,8 @@ void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy) { } void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, - const CFX_FloatPoint& ptHead, - const CFX_FloatPoint& ptFoot, + const CPDF_Point& ptHead, + const CPDF_Point& ptFoot, const CPVT_WordPlace& place) { PWL_CARET_INFO cInfo; cInfo.bVisible = bVisible; @@ -589,7 +584,7 @@ void CPWL_EditCtrl::IOnSetCaret(FX_BOOL bVisible, void CPWL_EditCtrl::IOnCaretChange(const CPVT_SecProps& secProps, const CPVT_WordProps& wordProps) {} -void CPWL_EditCtrl::IOnContentChange(const CFX_FloatRect& rcContent) { +void CPWL_EditCtrl::IOnContentChange(const CPDF_Rect& rcContent) { if (IsValid()) { if (m_pEditNotify) { m_pEditNotify->OnContentChange(rcContent); @@ -597,7 +592,7 @@ void CPWL_EditCtrl::IOnContentChange(const CFX_FloatRect& rcContent) { } } -void CPWL_EditCtrl::IOnInvalidateRect(CFX_FloatRect* pRect) { +void CPWL_EditCtrl::IOnInvalidateRect(CPDF_Rect* pRect) { InvalidateRect(pRect); } @@ -605,13 +600,13 @@ int32_t CPWL_EditCtrl::GetCharSet() const { return m_nCharSet < 0 ? DEFAULT_CHARSET : m_nCharSet; } -void CPWL_EditCtrl::GetTextRange(const CFX_FloatRect& rect, +void CPWL_EditCtrl::GetTextRange(const CPDF_Rect& rect, int32_t& nStartChar, int32_t& nEndChar) const { nStartChar = m_pEdit->WordPlaceToWordIndex( - m_pEdit->SearchWordPlace(CFX_FloatPoint(rect.left, rect.top))); + m_pEdit->SearchWordPlace(CPDF_Point(rect.left, rect.top))); nEndChar = m_pEdit->WordPlaceToWordIndex( - m_pEdit->SearchWordPlace(CFX_FloatPoint(rect.right, rect.bottom))); + m_pEdit->SearchWordPlace(CPDF_Point(rect.right, rect.bottom))); } CFX_WideString CPWL_EditCtrl::GetText(int32_t& nStartChar, |