summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fxedit/fxet_list.cpp6
-rw-r--r--fpdfsdk/fxedit/fxet_list.h57
2 files changed, 6 insertions, 57 deletions
diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp
index 0b1a2ac532..80f4fcc63e 100644
--- a/fpdfsdk/fxedit/fxet_list.cpp
+++ b/fpdfsdk/fxedit/fxet_list.cpp
@@ -38,11 +38,11 @@ CFX_Edit_Iterator* CFX_ListItem::GetIterator() const {
return m_pEdit->GetIterator();
}
-void CFX_ListItem::SetRect(const CLST_Rect& rect) {
+void CFX_ListItem::SetRect(const CFX_FloatRect& rect) {
m_rcListItem = rect;
}
-CLST_Rect CFX_ListItem::GetRect() const {
+CFX_FloatRect CFX_ListItem::GetRect() const {
return m_rcListItem;
}
@@ -559,7 +559,7 @@ int32_t CFX_ListCtrl::GetItemIndex(const CFX_PointF& point) const {
for (const auto& pListItem : m_ListItems) {
if (!pListItem)
continue;
- CLST_Rect rcListItem = pListItem->GetRect();
+ CFX_FloatRect rcListItem = pListItem->GetRect();
if (IsFloatBigger(pt.y, rcListItem.top))
bFirst = false;
if (IsFloatSmaller(pt.y, rcListItem.bottom))
diff --git a/fpdfsdk/fxedit/fxet_list.h b/fpdfsdk/fxedit/fxet_list.h
index b4b0a56c1e..b34cc54830 100644
--- a/fpdfsdk/fxedit/fxet_list.h
+++ b/fpdfsdk/fxedit/fxet_list.h
@@ -42,62 +42,11 @@ class CLST_Rect : public CFX_FloatRect {
~CLST_Rect() {}
- void Default() { left = top = right = bottom = 0.0f; }
-
- const CLST_Rect operator=(const CFX_FloatRect& rect) {
- left = rect.left;
- top = rect.top;
- right = rect.right;
- bottom = rect.bottom;
-
- return *this;
- }
-
- bool operator==(const CLST_Rect& rect) const {
- return memcmp(this, &rect, sizeof(CLST_Rect)) == 0;
- }
-
- bool operator!=(const CLST_Rect& rect) const { return !(*this == rect); }
-
- float Width() const { return right - left; }
-
float Height() const {
if (top > bottom)
return top - bottom;
return bottom - top;
}
-
- CFX_PointF LeftTop() const { return CFX_PointF(left, top); }
-
- CFX_PointF RightBottom() const { return CFX_PointF(right, bottom); }
-
- const CLST_Rect operator+=(const CFX_PointF& point) {
- left += point.x;
- right += point.x;
- top += point.y;
- bottom += point.y;
-
- return *this;
- }
-
- const CLST_Rect operator-=(const CFX_PointF& point) {
- left -= point.x;
- right -= point.x;
- top -= point.y;
- bottom -= point.y;
-
- return *this;
- }
-
- CLST_Rect operator+(const CFX_PointF& point) const {
- return CLST_Rect(left + point.x, top + point.y, right + point.x,
- bottom + point.y);
- }
-
- CLST_Rect operator-(const CFX_PointF& point) const {
- return CLST_Rect(left - point.x, top - point.y, right - point.x,
- bottom - point.y);
- }
};
class CFX_ListItem final {
@@ -108,13 +57,13 @@ class CFX_ListItem final {
void SetFontMap(IPVT_FontMap* pFontMap);
CFX_Edit* GetEdit() const;
- void SetRect(const CLST_Rect& rect);
+ void SetRect(const CFX_FloatRect& rect);
void SetSelect(bool bSelected);
void SetText(const CFX_WideString& text);
void SetFontSize(float fFontSize);
CFX_WideString GetText() const;
- CLST_Rect GetRect() const;
+ CFX_FloatRect GetRect() const;
bool IsSelected() const;
float GetItemHeight() const;
uint16_t GetFirstChar() const;
@@ -124,7 +73,7 @@ class CFX_ListItem final {
std::unique_ptr<CFX_Edit> m_pEdit;
bool m_bSelected;
- CLST_Rect m_rcListItem;
+ CFX_FloatRect m_rcListItem;
};
class CFX_ListContainer {