summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/pdfwindow/PWL_ListBox.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_ListBox.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_ListBox.cpp')
-rw-r--r--fpdfsdk/src/pdfwindow/PWL_ListBox.cpp43
1 files changed, 21 insertions, 22 deletions
diff --git a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
index c8e738a7ca..e3e83f9c7a 100644
--- a/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_ListBox.cpp
@@ -60,7 +60,7 @@ void CPWL_List_Notify::IOnSetScrollPosY(FX_FLOAT fy) {
m_pList->OnNotify(m_pList, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&fy);
}
-void CPWL_List_Notify::IOnInvalidateRect(CFX_FloatRect* pRect) {
+void CPWL_List_Notify::IOnInvalidateRect(CPDF_Rect* pRect) {
m_pList->InvalidateRect(pRect);
}
@@ -109,14 +109,14 @@ void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
CFX_ByteTextBuf sListItems;
if (m_pList) {
- CFX_FloatRect rcPlate = m_pList->GetPlateRect();
+ CPDF_Rect rcPlate = m_pList->GetPlateRect();
for (int32_t i = 0, sz = m_pList->GetCount(); i < sz; i++) {
- CFX_FloatRect rcItem = m_pList->GetItemRect(i);
+ CPDF_Rect rcItem = m_pList->GetItemRect(i);
if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom)
continue;
- CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
+ CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
if (m_pList->IsItemSelected(i)) {
sListItems << CPWL_Utils::GetRectFillAppStream(
rcItem, PWL_DEFAULT_SELBACKCOLOR);
@@ -140,7 +140,7 @@ void CPWL_ListBox::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
if (sListItems.GetLength() > 0) {
CFX_ByteTextBuf sClip;
- CFX_FloatRect rcClient = GetClientRect();
+ CPDF_Rect rcClient = GetClientRect();
sClip << "q\n";
sClip << rcClient.left << " " << rcClient.bottom << " "
@@ -158,18 +158,18 @@ void CPWL_ListBox::DrawThisAppearance(CFX_RenderDevice* pDevice,
CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device);
if (m_pList) {
- CFX_FloatRect rcPlate = m_pList->GetPlateRect();
- CFX_FloatRect rcList = GetListRect();
- CFX_FloatRect rcClient = GetClientRect();
+ CPDF_Rect rcPlate = m_pList->GetPlateRect();
+ CPDF_Rect rcList = GetListRect();
+ CPDF_Rect rcClient = GetClientRect();
for (int32_t i = 0, sz = m_pList->GetCount(); i < sz; i++) {
- CFX_FloatRect rcItem = m_pList->GetItemRect(i);
+ CPDF_Rect rcItem = m_pList->GetItemRect(i);
if (rcItem.bottom > rcPlate.top || rcItem.top < rcPlate.bottom)
continue;
- CFX_FloatPoint ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
+ CPDF_Point ptOffset(rcItem.left, (rcItem.top + rcItem.bottom) * 0.5f);
if (IFX_Edit* pEdit = m_pList->GetItemEdit(i)) {
- CFX_FloatRect rcContent = pEdit->GetContentRect();
+ CPDF_Rect rcContent = pEdit->GetContentRect();
if (rcContent.Width() > rcClient.Width())
rcItem.Intersect(rcList);
else
@@ -265,8 +265,7 @@ FX_BOOL CPWL_ListBox::OnChar(FX_WORD nChar, FX_DWORD nFlag) {
return TRUE;
}
-FX_BOOL CPWL_ListBox::OnLButtonDown(const CFX_FloatPoint& point,
- FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag) {
CPWL_Wnd::OnLButtonDown(point, nFlag);
if (ClientHitTest(point)) {
@@ -281,7 +280,7 @@ FX_BOOL CPWL_ListBox::OnLButtonDown(const CFX_FloatPoint& point,
return TRUE;
}
-FX_BOOL CPWL_ListBox::OnLButtonUp(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag) {
CPWL_Wnd::OnLButtonUp(point, nFlag);
if (m_bMouseDown) {
@@ -299,7 +298,7 @@ void CPWL_ListBox::SetHoverSel(FX_BOOL bHoverSel) {
m_bHoverSel = bHoverSel;
}
-FX_BOOL CPWL_ListBox::OnMouseMove(const CFX_FloatPoint& point, FX_DWORD nFlag) {
+FX_BOOL CPWL_ListBox::OnMouseMove(const CPDF_Point& point, FX_DWORD nFlag) {
CPWL_Wnd::OnMouseMove(point, nFlag);
if (m_bHoverSel && !IsCaptureMouse() && ClientHitTest(point)) {
@@ -347,7 +346,7 @@ void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd,
switch (wParam) {
case SBT_VSCROLL:
if (m_pList)
- m_pList->SetScrollPos(CFX_FloatPoint(0, fPos));
+ m_pList->SetScrollPos(CPDF_Point(0, fPos));
break;
}
break;
@@ -381,9 +380,9 @@ void CPWL_ListBox::OnNotifySelChanged(FX_BOOL bKeyDown,
nFlag);
}
-CFX_FloatRect CPWL_ListBox::GetFocusRect() const {
+CPDF_Rect CPWL_ListBox::GetFocusRect() const {
if (m_pList && m_pList->IsMultipleSel()) {
- CFX_FloatRect rcCaret = m_pList->GetItemRect(m_pList->GetCaret());
+ CPDF_Rect rcCaret = m_pList->GetItemRect(m_pList->GetCaret());
rcCaret.Intersect(GetClientRect());
return rcCaret;
}
@@ -496,11 +495,11 @@ int32_t CPWL_ListBox::FindNext(int32_t nIndex, FX_WCHAR nChar) const {
return nIndex;
}
-CFX_FloatRect CPWL_ListBox::GetContentRect() const {
+CPDF_Rect CPWL_ListBox::GetContentRect() const {
if (m_pList)
return m_pList->GetContentRect();
- return CFX_FloatRect();
+ return CPDF_Rect();
}
FX_FLOAT CPWL_ListBox::GetFirstHeight() const {
@@ -510,13 +509,13 @@ FX_FLOAT CPWL_ListBox::GetFirstHeight() const {
return 0.0f;
}
-CFX_FloatRect CPWL_ListBox::GetListRect() const {
+CPDF_Rect CPWL_ListBox::GetListRect() const {
return CPWL_Utils::DeflateRect(
GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
}
FX_BOOL CPWL_ListBox::OnMouseWheel(short zDelta,
- const CFX_FloatPoint& point,
+ const CPDF_Point& point,
FX_DWORD nFlag) {
if (!m_pList)
return FALSE;