Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: fpdfsdk/src/pdfwindow/PWL_IconList.cpp

Issue 1737593006: Re-land "Replace CPDF_Rect and CPDF_Point with CFX types." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Ooops. Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/src/pdfwindow/PWL_Icon.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Label.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/pdfwindow/PWL_IconList.cpp
diff --git a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
index c6849d06831c28610457c94a82071fd83708515a..7dc8ba9f446f536048b5e04cb31b3d81f00c81d8 100644
--- a/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
+++ b/fpdfsdk/src/pdfwindow/PWL_IconList.cpp
@@ -33,7 +33,7 @@ FX_FLOAT CPWL_IconList_Item::GetItemHeight(FX_FLOAT fLimitWidth) {
void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device) {
- CPDF_Rect rcClient = GetClientRect();
+ CFX_FloatRect rcClient = GetClientRect();
if (m_bSelected) {
if (IsEnabled()) {
@@ -49,7 +49,7 @@ void CPWL_IconList_Item::DrawThisAppearance(CFX_RenderDevice* pDevice,
}
}
- CPDF_Rect rcIcon = rcClient;
+ CFX_FloatRect rcIcon = rcClient;
rcIcon.left += PWL_IconList_ITEM_ICON_LEFTMARGIN;
rcIcon.right = rcIcon.left + PWL_IconList_ITEM_WIDTH;
@@ -99,7 +99,7 @@ CFX_WideString CPWL_IconList_Item::GetText() const {
}
void CPWL_IconList_Item::RePosChildWnd() {
- CPDF_Rect rcClient = GetClientRect();
+ CFX_FloatRect rcClient = GetClientRect();
rcClient.left +=
(PWL_IconList_ITEM_ICON_LEFTMARGIN + PWL_IconList_ITEM_WIDTH +
@@ -150,7 +150,7 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM& cp) {
ResetContent(0);
if (CPWL_Wnd* pParent = GetParentWindow()) {
- CPDF_Rect rcScroll = GetScrollArea();
+ CFX_FloatRect rcScroll = GetScrollArea();
GetScrollPos();
PWL_SCROLL_INFO sInfo;
@@ -164,7 +164,7 @@ void CPWL_IconList_Content::CreateChildWnd(const PWL_CREATEPARAM& cp) {
}
}
-FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point& point,
+FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CFX_FloatPoint& point,
FX_DWORD nFlag) {
SetFocus();
@@ -178,7 +178,7 @@ FX_BOOL CPWL_IconList_Content::OnLButtonDown(const CPDF_Point& point,
return TRUE;
}
-FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point& point,
+FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CFX_FloatPoint& point,
FX_DWORD nFlag) {
m_bMouseDown = FALSE;
ReleaseCapture();
@@ -186,7 +186,7 @@ FX_BOOL CPWL_IconList_Content::OnLButtonUp(const CPDF_Point& point,
return TRUE;
}
-FX_BOOL CPWL_IconList_Content::OnMouseMove(const CPDF_Point& point,
+FX_BOOL CPWL_IconList_Content::OnMouseMove(const CFX_FloatPoint& point,
FX_DWORD nFlag) {
if (m_bMouseDown) {
int32_t nItemIndex = FindItemIndex(point);
@@ -218,11 +218,11 @@ FX_BOOL CPWL_IconList_Content::OnKeyDown(FX_WORD nChar, FX_DWORD nFlag) {
return FALSE;
}
-int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) {
+int32_t CPWL_IconList_Content::FindItemIndex(const CFX_FloatPoint& point) {
int32_t nIndex = 0;
for (int32_t i = 0, sz = m_aChildren.GetSize(); i < sz; i++) {
if (CPWL_Wnd* pChild = m_aChildren.GetAt(i)) {
- CPDF_Rect rcWnd = pChild->ChildToParent(pChild->GetWindowRect());
+ CFX_FloatRect rcWnd = pChild->ChildToParent(pChild->GetWindowRect());
if (point.y < rcWnd.top) {
nIndex = i;
@@ -234,14 +234,14 @@ int32_t CPWL_IconList_Content::FindItemIndex(const CPDF_Point& point) {
}
void CPWL_IconList_Content::ScrollToItem(int32_t nItemIndex) {
- CPDF_Rect rcClient = GetClientRect();
+ CFX_FloatRect rcClient = GetClientRect();
if (CPWL_IconList_Item* pItem = GetListItem(nItemIndex)) {
- CPDF_Rect rcOrigin = pItem->GetWindowRect();
- CPDF_Rect rcWnd = pItem->ChildToParent(rcOrigin);
+ CFX_FloatRect rcOrigin = pItem->GetWindowRect();
+ CFX_FloatRect rcWnd = pItem->ChildToParent(rcOrigin);
if (!(rcWnd.bottom > rcClient.bottom && rcWnd.top < rcClient.top)) {
- CPDF_Point ptScroll = GetScrollPos();
+ CFX_FloatPoint ptScroll = GetScrollPos();
if (rcWnd.top > rcClient.top) {
ptScroll.y = rcOrigin.top;
@@ -398,7 +398,7 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd,
}
if (m_pListContent)
- m_pListContent->SetScrollPos(CPDF_Point(0.0f, 0.0f));
+ m_pListContent->SetScrollPos(CFX_FloatPoint(0.0f, 0.0f));
}
pScrollBar->OnNotify(pWnd, PNM_SETSCROLLINFO, wParam, lParam);
@@ -407,7 +407,8 @@ void CPWL_IconList::OnNotify(CPWL_Wnd* pWnd,
return;
case PNM_SCROLLWINDOW:
if (m_pListContent) {
- m_pListContent->SetScrollPos(CPDF_Point(0.0f, *(FX_FLOAT*)lParam));
+ m_pListContent->SetScrollPos(
+ CFX_FloatPoint(0.0f, *(FX_FLOAT*)lParam));
m_pListContent->ResetFace();
m_pListContent->InvalidateRect(NULL);
}
@@ -462,14 +463,14 @@ void CPWL_IconList::SetIconFillColor(const CPWL_Color& color) {
}
FX_BOOL CPWL_IconList::OnMouseWheel(short zDelta,
- const CPDF_Point& point,
+ const CFX_FloatPoint& point,
FX_DWORD nFlag) {
- CPDF_Point ptScroll = m_pListContent->GetScrollPos();
- CPDF_Rect rcScroll = m_pListContent->GetScrollArea();
- CPDF_Rect rcContents = m_pListContent->GetClientRect();
+ CFX_FloatPoint ptScroll = m_pListContent->GetScrollPos();
+ CFX_FloatRect rcScroll = m_pListContent->GetScrollArea();
+ CFX_FloatRect rcContents = m_pListContent->GetClientRect();
if (rcScroll.top - rcScroll.bottom > rcContents.Height()) {
- CPDF_Point ptNew = ptScroll;
+ CFX_FloatPoint ptNew = ptScroll;
if (zDelta > 0)
ptNew.y += 30;
« no previous file with comments | « fpdfsdk/src/pdfwindow/PWL_Icon.cpp ('k') | fpdfsdk/src/pdfwindow/PWL_Label.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698