summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 13:17:56 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 13:17:56 -0800
commit566b974287ce0e81a963138152b8898f22480f52 (patch)
treeb85991aee92475549d84e8cb68702960b85d1252 /fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
parent3b8fdd34bdf57ec45291b77008a43249f838efcb (diff)
downloadpdfium-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_ListCtrl.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp59
1 files changed, 29 insertions, 30 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
index 1c32ceb251..6d9627b08a 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListCtrl.cpp
@@ -16,7 +16,7 @@ CPWL_ListCtrl::CPWL_ListCtrl()
CPWL_ListCtrl::~CPWL_ListCtrl() {}
-void CPWL_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) {
+void CPWL_ListCtrl::SetScrollPos(const CPDF_Point& point) {
m_ptScroll = point;
if (m_ptScroll.x < m_rcContent.left)
@@ -32,11 +32,11 @@ void CPWL_ListCtrl::SetScrollPos(const CFX_FloatPoint& point) {
m_ptScroll.y = m_rcContent.bottom;
}
-CFX_FloatPoint CPWL_ListCtrl::GetScrollPos() const {
+CPDF_Point CPWL_ListCtrl::GetScrollPos() const {
return m_ptScroll;
}
-CFX_FloatRect CPWL_ListCtrl::GetScrollArea() const {
+CPDF_Rect CPWL_ListCtrl::GetScrollArea() const {
return m_rcContent;
}
@@ -77,7 +77,7 @@ FX_FLOAT CPWL_ListCtrl::GetContentsHeight(FX_FLOAT fLimitWidth) {
}
void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart) {
- CFX_FloatRect rcClient = GetClientRect();
+ CPDF_Rect rcClient = GetClientRect();
FX_FLOAT fWidth = rcClient.Width();
@@ -98,9 +98,8 @@ void CPWL_ListCtrl::ResetAll(FX_BOOL bMove, int32_t nStart) {
if (bMove) {
FX_FLOAT fItemHeight = pChild->GetItemHeight(fWidth - fLeft - fRight);
- pChild->Move(
- CFX_FloatRect(fLeft, fy - fItemHeight, fWidth - fRight, fy), TRUE,
- FALSE);
+ pChild->Move(CPDF_Rect(fLeft, fy - fItemHeight, fWidth - fRight, fy),
+ TRUE, FALSE);
fy -= fItemHeight;
fy -= m_fItemSpace;
}
@@ -138,8 +137,8 @@ void CPWL_ListCtrl::RePosChildWnd() {
void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) {
pDevice->SaveState();
- CFX_FloatRect rcClient = GetClientRect();
- CFX_FloatRect rcTemp = rcClient;
+ CPDF_Rect rcClient = GetClientRect();
+ CPDF_Rect rcTemp = rcClient;
pUser2Device->TransformRect(rcTemp);
FX_RECT rcClip((int32_t)rcTemp.left, (int32_t)rcTemp.bottom,
(int32_t)rcTemp.right, (int32_t)rcTemp.top);
@@ -148,7 +147,7 @@ void CPWL_ListCtrl::DrawChildAppearance(CFX_RenderDevice* pDevice,
for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) {
if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) {
- CFX_FloatRect rcChild = pChild->ChildToParent(pChild->GetWindowRect());
+ CPDF_Rect rcChild = pChild->ChildToParent(pChild->GetWindowRect());
if (!(rcChild.top < rcClient.bottom || rcChild.bottom > rcClient.top)) {
CFX_Matrix mt = pChild->GetChildMatrix();
if (mt.IsIdentity()) {
@@ -173,34 +172,34 @@ int32_t CPWL_ListCtrl::GetItemIndex(CPWL_Wnd* pItem) {
return -1;
}
-CFX_FloatPoint CPWL_ListCtrl::InToOut(const CFX_FloatPoint& point) const {
- CFX_FloatRect rcClient = GetClientRect();
+CPDF_Point CPWL_ListCtrl::InToOut(const CPDF_Point& point) const {
+ CPDF_Rect rcClient = GetClientRect();
- return CFX_FloatPoint(point.x + rcClient.left - m_ptScroll.x,
- point.y + rcClient.top - m_ptScroll.y);
+ return CPDF_Point(point.x + rcClient.left - m_ptScroll.x,
+ point.y + rcClient.top - m_ptScroll.y);
}
-CFX_FloatPoint CPWL_ListCtrl::OutToIn(const CFX_FloatPoint& point) const {
- CFX_FloatRect rcClient = GetClientRect();
+CPDF_Point CPWL_ListCtrl::OutToIn(const CPDF_Point& point) const {
+ CPDF_Rect rcClient = GetClientRect();
- return CFX_FloatPoint(point.x - rcClient.left + m_ptScroll.x,
- point.y - rcClient.top + m_ptScroll.y);
+ return CPDF_Point(point.x - rcClient.left + m_ptScroll.x,
+ point.y - rcClient.top + m_ptScroll.y);
}
-CFX_FloatRect CPWL_ListCtrl::InToOut(const CFX_FloatRect& rect) const {
- CFX_FloatRect rcClient = GetClientRect();
+CPDF_Rect CPWL_ListCtrl::InToOut(const CPDF_Rect& rect) const {
+ CPDF_Rect rcClient = GetClientRect();
- return CFX_FloatRect(rect.left + rcClient.left - m_ptScroll.x,
- rect.bottom + rcClient.top - m_ptScroll.y,
- rect.right + rcClient.left - m_ptScroll.x,
- rect.top + rcClient.top - m_ptScroll.y);
+ return CPDF_Rect(rect.left + rcClient.left - m_ptScroll.x,
+ rect.bottom + rcClient.top - m_ptScroll.y,
+ rect.right + rcClient.left - m_ptScroll.x,
+ rect.top + rcClient.top - m_ptScroll.y);
}
-CFX_FloatRect CPWL_ListCtrl::OutToIn(const CFX_FloatRect& rect) const {
- CFX_FloatRect rcClient = GetClientRect();
+CPDF_Rect CPWL_ListCtrl::OutToIn(const CPDF_Rect& rect) const {
+ CPDF_Rect rcClient = GetClientRect();
- return CFX_FloatRect(rect.left - rcClient.left + m_ptScroll.x,
- rect.bottom - rcClient.top + m_ptScroll.y,
- rect.right - rcClient.left + m_ptScroll.x,
- rect.top - rcClient.top + m_ptScroll.y);
+ return CPDF_Rect(rect.left - rcClient.left + m_ptScroll.x,
+ rect.bottom - rcClient.top + m_ptScroll.y,
+ rect.right - rcClient.left + m_ptScroll.x,
+ rect.top - rcClient.top + m_ptScroll.y);
}