summaryrefslogtreecommitdiff
path: root/fpdfsdk/fxedit
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-14 14:43:42 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 19:05:58 +0000
commit05df075154a832fcb476e1dfcfb865722d0ea898 (patch)
treeb8b771b62adae74d5d5ee561db75d10de3a848bf /fpdfsdk/fxedit
parent6b94f01d1c8ad386d497428c7397b1a99614aeba (diff)
downloadpdfium-05df075154a832fcb476e1dfcfb865722d0ea898.tar.xz
Replace FX_FLOAT with underlying float type.
Change-Id: I158b7d80b0ec28b742a9f2d5a96f3dde7fb3ab56 Reviewed-on: https://pdfium-review.googlesource.com/3031 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'fpdfsdk/fxedit')
-rw-r--r--fpdfsdk/fxedit/fxet_edit.cpp24
-rw-r--r--fpdfsdk/fxedit/fxet_edit.h12
-rw-r--r--fpdfsdk/fxedit/fxet_list.cpp16
-rw-r--r--fpdfsdk/fxedit/fxet_list.h26
4 files changed, 39 insertions, 39 deletions
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 1acc57795a..0a5c3d940f 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -43,7 +43,7 @@ CFX_ByteString GetWordRenderString(const CFX_ByteString& strWords) {
CFX_ByteString GetFontSetString(IPVT_FontMap* pFontMap,
int32_t nFontIndex,
- FX_FLOAT fFontSize) {
+ float fFontSize) {
if (!pFontMap)
return CFX_ByteString();
@@ -59,7 +59,7 @@ CFX_ByteString GetFontSetString(IPVT_FontMap* pFontMap,
void DrawTextString(CFX_RenderDevice* pDevice,
const CFX_PointF& pt,
CPDF_Font* pFont,
- FX_FLOAT fFontSize,
+ float fFontSize,
CFX_Matrix* pUser2Device,
const CFX_ByteString& str,
FX_ARGB crTextFill,
@@ -673,7 +673,7 @@ CFX_ByteString CFX_Edit::GetEditAppearanceStream(CFX_Edit* pEdit,
sAppStream << nHorzScale << " Tz\n";
}
- FX_FLOAT fCharSpace = pEdit->GetCharSpace();
+ float fCharSpace = pEdit->GetCharSpace();
if (!IsFloatZero(fCharSpace)) {
sAppStream << fCharSpace << " Tc\n";
}
@@ -726,7 +726,7 @@ void CFX_Edit::DrawEdit(CFX_RenderDevice* pDevice,
const bool bContinuous =
pEdit->GetCharArray() == 0 && pEdit->GetCharSpace() <= 0.0f;
uint16_t SubWord = pEdit->GetPasswordChar();
- FX_FLOAT fFontSize = pEdit->GetFontSize();
+ float fFontSize = pEdit->GetFontSize();
CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
int32_t nHorzScale = pEdit->GetHorzScale();
@@ -921,7 +921,7 @@ void CFX_Edit::SetCharArray(int32_t nCharArray) {
Paint();
}
-void CFX_Edit::SetCharSpace(FX_FLOAT fCharSpace) {
+void CFX_Edit::SetCharSpace(float fCharSpace) {
m_pVT->SetCharSpace(fCharSpace);
Paint();
}
@@ -944,7 +944,7 @@ void CFX_Edit::SetAutoFontSize(bool bAuto, bool bPaint) {
Paint();
}
-void CFX_Edit::SetFontSize(FX_FLOAT fFontSize) {
+void CFX_Edit::SetFontSize(float fFontSize) {
m_pVT->SetFontSize(fFontSize);
Paint();
}
@@ -1139,7 +1139,7 @@ bool CFX_Edit::InsertText(const CFX_WideString& sText, int32_t charset) {
return InsertText(sText, charset, true, true);
}
-FX_FLOAT CFX_Edit::GetFontSize() const {
+float CFX_Edit::GetFontSize() const {
return m_pVT->GetFontSize();
}
@@ -1159,7 +1159,7 @@ int32_t CFX_Edit::GetHorzScale() const {
return m_pVT->GetHorzScale();
}
-FX_FLOAT CFX_Edit::GetCharSpace() const {
+float CFX_Edit::GetCharSpace() const {
return m_pVT->GetCharSpace();
}
@@ -1269,7 +1269,7 @@ CFX_PointF CFX_Edit::VTToEdit(const CFX_PointF& point) const {
CFX_FloatRect rcContent = m_pVT->GetContentRect();
CFX_FloatRect rcPlate = m_pVT->GetPlateRect();
- FX_FLOAT fPadding = 0.0f;
+ float fPadding = 0.0f;
switch (m_nAlignment) {
case 0:
@@ -1291,7 +1291,7 @@ CFX_PointF CFX_Edit::EditToVT(const CFX_PointF& point) const {
CFX_FloatRect rcContent = m_pVT->GetContentRect();
CFX_FloatRect rcPlate = m_pVT->GetPlateRect();
- FX_FLOAT fPadding = 0.0f;
+ float fPadding = 0.0f;
switch (m_nAlignment) {
case 0:
@@ -1332,7 +1332,7 @@ void CFX_Edit::SetScrollInfo() {
}
}
-void CFX_Edit::SetScrollPosX(FX_FLOAT fx) {
+void CFX_Edit::SetScrollPosX(float fx) {
if (!m_bEnableScroll)
return;
@@ -1344,7 +1344,7 @@ void CFX_Edit::SetScrollPosX(FX_FLOAT fx) {
}
}
-void CFX_Edit::SetScrollPosY(FX_FLOAT fy) {
+void CFX_Edit::SetScrollPosY(float fy) {
if (!m_bEnableScroll)
return;
diff --git a/fpdfsdk/fxedit/fxet_edit.h b/fpdfsdk/fxedit/fxet_edit.h
index ab83af2e3b..4fcb5569c3 100644
--- a/fpdfsdk/fxedit/fxet_edit.h
+++ b/fpdfsdk/fxedit/fxet_edit.h
@@ -357,12 +357,12 @@ class CFX_Edit {
// Set the maximum number of words in the text.
void SetLimitChar(int32_t nLimitChar);
void SetCharArray(int32_t nCharArray);
- void SetCharSpace(FX_FLOAT fCharSpace);
+ void SetCharSpace(float fCharSpace);
void SetMultiLine(bool bMultiLine, bool bPaint);
void SetAutoReturn(bool bAuto, bool bPaint);
void SetAutoFontSize(bool bAuto, bool bPaint);
void SetAutoScroll(bool bAuto, bool bPaint);
- void SetFontSize(FX_FLOAT fFontSize);
+ void SetFontSize(float fFontSize);
void SetTextOverflow(bool bAllowed, bool bPaint);
void OnMouseDown(const CFX_PointF& point, bool bShift, bool bCtrl);
void OnMouseMove(const CFX_PointF& point, bool bShift, bool bCtrl);
@@ -388,14 +388,14 @@ class CFX_Edit {
CPVT_WordPlace GetCaretWordPlace() const;
CFX_WideString GetSelText() const;
CFX_WideString GetText() const;
- FX_FLOAT GetFontSize() const;
+ float GetFontSize() const;
uint16_t GetPasswordChar() const;
CFX_PointF GetScrollPos() const;
int32_t GetCharArray() const;
CFX_FloatRect GetContentRect() const;
CFX_WideString GetRangeText(const CPVT_WordRange& range) const;
int32_t GetHorzScale() const;
- FX_FLOAT GetCharSpace() const;
+ float GetCharSpace() const;
int32_t GetTotalWords() const;
void SetSel(int32_t nStartChar, int32_t nEndChar);
void GetSel(int32_t& nStartChar, int32_t& nEndChar) const;
@@ -440,8 +440,8 @@ class CFX_Edit {
void RearrangePart(const CPVT_WordRange& range);
void ScrollToCaret();
void SetScrollInfo();
- void SetScrollPosX(FX_FLOAT fx);
- void SetScrollPosY(FX_FLOAT fy);
+ void SetScrollPosX(float fx);
+ void SetScrollPosY(float fy);
void SetScrollLimit();
void SetContentChanged();
diff --git a/fpdfsdk/fxedit/fxet_list.cpp b/fpdfsdk/fxedit/fxet_list.cpp
index 3782cf0a33..d79503556d 100644
--- a/fpdfsdk/fxedit/fxet_list.cpp
+++ b/fpdfsdk/fxedit/fxet_list.cpp
@@ -53,11 +53,11 @@ void CFX_ListItem::SetText(const CFX_WideString& text) {
m_pEdit->SetText(text);
}
-void CFX_ListItem::SetFontSize(FX_FLOAT fFontSize) {
+void CFX_ListItem::SetFontSize(float fFontSize) {
m_pEdit->SetFontSize(fFontSize);
}
-FX_FLOAT CFX_ListItem::GetItemHeight() const {
+float CFX_ListItem::GetItemHeight() const {
return m_pEdit->GetContentRect().Height();
}
@@ -542,7 +542,7 @@ void CFX_ListCtrl::SetScrollPos(const CFX_PointF& point) {
SetScrollPosY(point.y);
}
-void CFX_ListCtrl::SetScrollPosY(FX_FLOAT fy) {
+void CFX_ListCtrl::SetScrollPosY(float fy) {
if (!IsFloatEqual(m_ptScrollPos.y, fy)) {
CFX_FloatRect rcPlate = GetPlateRect();
CFX_FloatRect rcContent = GetContentRectInternal();
@@ -579,14 +579,14 @@ CFX_FloatRect CFX_ListCtrl::GetContentRect() const {
}
void CFX_ListCtrl::ReArrange(int32_t nItemIndex) {
- FX_FLOAT fPosY = 0.0f;
+ float fPosY = 0.0f;
if (CFX_ListItem* pPrevItem = m_aListItems.GetAt(nItemIndex - 1))
fPosY = pPrevItem->GetRect().bottom;
for (int32_t i = nItemIndex, sz = m_aListItems.GetSize(); i < sz; i++) {
if (CFX_ListItem* pListItem = m_aListItems.GetAt(i)) {
- FX_FLOAT fListItemHeight = pListItem->GetItemHeight();
+ float fListItemHeight = pListItem->GetItemHeight();
pListItem->SetRect(CLST_Rect(0.0f, fPosY, 0.0f, fPosY + fListItemHeight));
fPosY += fListItemHeight;
}
@@ -668,7 +668,7 @@ void CFX_ListCtrl::SetFontMap(IPVT_FontMap* pFontMap) {
m_pFontMap = pFontMap;
}
-void CFX_ListCtrl::SetFontSize(FX_FLOAT fFontSize) {
+void CFX_ListCtrl::SetFontSize(float fFontSize) {
m_fFontSize = fFontSize;
}
@@ -696,11 +696,11 @@ CFX_FloatRect CFX_ListCtrl::GetPlateRect() const {
return CFX_ListContainer::GetPlateRect();
}
-FX_FLOAT CFX_ListCtrl::GetFontSize() const {
+float CFX_ListCtrl::GetFontSize() const {
return m_fFontSize;
}
-FX_FLOAT CFX_ListCtrl::GetFirstHeight() const {
+float CFX_ListCtrl::GetFirstHeight() const {
if (CFX_ListItem* pListItem = m_aListItems.GetAt(0)) {
return pListItem->GetItemHeight();
}
diff --git a/fpdfsdk/fxedit/fxet_list.h b/fpdfsdk/fxedit/fxet_list.h
index 9d07187560..00e03d8213 100644
--- a/fpdfsdk/fxedit/fxet_list.h
+++ b/fpdfsdk/fxedit/fxet_list.h
@@ -20,10 +20,10 @@ class CLST_Rect : public CFX_FloatRect {
public:
CLST_Rect() { left = top = right = bottom = 0.0f; }
- CLST_Rect(FX_FLOAT other_left,
- FX_FLOAT other_top,
- FX_FLOAT other_right,
- FX_FLOAT other_bottom) {
+ CLST_Rect(float other_left,
+ float other_top,
+ float other_right,
+ float other_bottom) {
left = other_left;
top = other_top;
right = other_right;
@@ -56,9 +56,9 @@ class CLST_Rect : public CFX_FloatRect {
bool operator!=(const CLST_Rect& rect) const { return !(*this == rect); }
- FX_FLOAT Width() const { return right - left; }
+ float Width() const { return right - left; }
- FX_FLOAT Height() const {
+ float Height() const {
if (top > bottom)
return top - bottom;
return bottom - top;
@@ -108,12 +108,12 @@ class CFX_ListItem final {
void SetRect(const CLST_Rect& rect);
void SetSelect(bool bSelected);
void SetText(const CFX_WideString& text);
- void SetFontSize(FX_FLOAT fFontSize);
+ void SetFontSize(float fFontSize);
CFX_WideString GetText() const;
CLST_Rect GetRect() const;
bool IsSelected() const;
- FX_FLOAT GetItemHeight() const;
+ float GetItemHeight() const;
uint16_t GetFirstChar() const;
private:
@@ -252,13 +252,13 @@ class CFX_ListCtrl : protected CFX_ListContainer {
CFX_WideString GetText() const;
void SetFontMap(IPVT_FontMap* pFontMap);
- void SetFontSize(FX_FLOAT fFontSize);
+ void SetFontSize(float fFontSize);
CFX_FloatRect GetPlateRect() const;
- FX_FLOAT GetFontSize() const;
+ float GetFontSize() const;
CFX_Edit* GetItemEdit(int32_t nIndex) const;
int32_t GetCount() const;
bool IsItemSelected(int32_t nIndex) const;
- FX_FLOAT GetFirstHeight() const;
+ float GetFirstHeight() const;
void SetMultipleSel(bool bMultiple);
bool IsMultipleSel() const;
bool IsValid(int32_t nItemIndex) const;
@@ -280,7 +280,7 @@ class CFX_ListCtrl : protected CFX_ListContainer {
void SelectItems();
bool IsItemVisible(int32_t nItemIndex) const;
void SetScrollInfo();
- void SetScrollPosY(FX_FLOAT fy);
+ void SetScrollPosY(float fy);
void AddItem(const CFX_WideString& str);
CFX_WideString GetItemText(int32_t nIndex) const;
void SetItemSelect(int32_t nItemIndex, bool bSelected);
@@ -296,7 +296,7 @@ class CFX_ListCtrl : protected CFX_ListContainer {
bool m_bCtrlSel; // for multiple
int32_t m_nCaretIndex; // for multiple
CLST_ArrayTemplate<CFX_ListItem*> m_aListItems;
- FX_FLOAT m_fFontSize;
+ float m_fFontSize;
IPVT_FontMap* m_pFontMap;
bool m_bMultiple;
};