summaryrefslogtreecommitdiff
path: root/fpdfsdk
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
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')
-rw-r--r--fpdfsdk/cba_annotiterator.cpp8
-rw-r--r--fpdfsdk/cfx_systemhandler.cpp6
-rw-r--r--fpdfsdk/cpdfsdk_annot.cpp4
-rw-r--r--fpdfsdk/cpdfsdk_annot.h4
-rw-r--r--fpdfsdk/cpdfsdk_baannot.cpp30
-rw-r--r--fpdfsdk/cpdfsdk_pageview.cpp7
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp46
-rw-r--r--fpdfsdk/cpdfsdk_widget.h2
-rw-r--r--fpdfsdk/formfiller/cffl_formfiller.cpp4
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.cpp14
-rw-r--r--fpdfsdk/formfiller/cffl_interactiveformfiller.h6
-rw-r--r--fpdfsdk/fpdf_flatten.cpp18
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp3
-rw-r--r--fpdfsdk/fpdfdoc.cpp8
-rw-r--r--fpdfsdk/fpdfeditimg.cpp7
-rw-r--r--fpdfsdk/fpdfeditpage.cpp11
-rw-r--r--fpdfsdk/fpdfeditpath.cpp4
-rw-r--r--fpdfsdk/fpdfformfill.cpp15
-rw-r--r--fpdfsdk/fpdftext.cpp9
-rw-r--r--fpdfsdk/fpdfview.cpp6
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp8
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h4
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_page.cpp10
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_page.h4
-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
-rw-r--r--fpdfsdk/javascript/Document.cpp4
-rw-r--r--fpdfsdk/javascript/Field.cpp16
-rw-r--r--fpdfsdk/javascript/color.cpp9
-rw-r--r--fpdfsdk/pdfwindow/PWL_Caret.cpp6
-rw-r--r--fpdfsdk/pdfwindow/PWL_Caret.h2
-rw-r--r--fpdfsdk/pdfwindow/PWL_ComboBox.cpp12
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.cpp28
-rw-r--r--fpdfsdk/pdfwindow/PWL_Edit.h21
-rw-r--r--fpdfsdk/pdfwindow/PWL_EditCtrl.cpp24
-rw-r--r--fpdfsdk/pdfwindow/PWL_EditCtrl.h20
-rw-r--r--fpdfsdk/pdfwindow/PWL_Icon.cpp38
-rw-r--r--fpdfsdk/pdfwindow/PWL_Icon.h12
-rw-r--r--fpdfsdk/pdfwindow/PWL_ListBox.cpp26
-rw-r--r--fpdfsdk/pdfwindow/PWL_ListBox.h20
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.cpp78
-rw-r--r--fpdfsdk/pdfwindow/PWL_ScrollBar.h56
-rw-r--r--fpdfsdk/pdfwindow/PWL_SpecialButton.cpp2
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.cpp116
-rw-r--r--fpdfsdk/pdfwindow/PWL_Utils.h24
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.cpp14
-rw-r--r--fpdfsdk/pdfwindow/PWL_Wnd.h6
-rw-r--r--fpdfsdk/pdfwindow/cpwl_color.cpp27
-rw-r--r--fpdfsdk/pdfwindow/cpwl_color.h20
51 files changed, 441 insertions, 456 deletions
diff --git a/fpdfsdk/cba_annotiterator.cpp b/fpdfsdk/cba_annotiterator.cpp
index 409a9282d1..3e35ff8294 100644
--- a/fpdfsdk/cba_annotiterator.cpp
+++ b/fpdfsdk/cba_annotiterator.cpp
@@ -113,7 +113,7 @@ void CBA_AnnotIterator::GenerateResults() {
while (!sa.empty()) {
int nLeftTopIndex = -1;
- FX_FLOAT fTop = 0.0f;
+ float fTop = 0.0f;
for (int i = sa.size() - 1; i >= 0; i--) {
CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
if (rcAnnot.top > fTop) {
@@ -129,7 +129,7 @@ void CBA_AnnotIterator::GenerateResults() {
std::vector<size_t> aSelect;
for (size_t i = 0; i < sa.size(); ++i) {
CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
- FX_FLOAT fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f;
+ float fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f;
if (fCenterY > rcLeftTop.bottom && fCenterY < rcLeftTop.top)
aSelect.push_back(i);
}
@@ -145,7 +145,7 @@ void CBA_AnnotIterator::GenerateResults() {
while (!sa.empty()) {
int nLeftTopIndex = -1;
- FX_FLOAT fLeft = -1.0f;
+ float fLeft = -1.0f;
for (int i = sa.size() - 1; i >= 0; --i) {
CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
if (fLeft < 0) {
@@ -164,7 +164,7 @@ void CBA_AnnotIterator::GenerateResults() {
std::vector<size_t> aSelect;
for (size_t i = 0; i < sa.size(); ++i) {
CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
- FX_FLOAT fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f;
+ float fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f;
if (fCenterX > rcLeftTop.left && fCenterX < rcLeftTop.right)
aSelect.push_back(i);
}
diff --git a/fpdfsdk/cfx_systemhandler.cpp b/fpdfsdk/cfx_systemhandler.cpp
index b6dc19d48f..ea64412d4c 100644
--- a/fpdfsdk/cfx_systemhandler.cpp
+++ b/fpdfsdk/cfx_systemhandler.cpp
@@ -46,10 +46,10 @@ void CFX_SystemHandler::InvalidateRect(CPDFSDK_Widget* widget, FX_RECT rect) {
CFX_Matrix device2page;
device2page.SetReverse(page2device);
- CFX_PointF left_top = device2page.Transform(CFX_PointF(
- static_cast<FX_FLOAT>(rect.left), static_cast<FX_FLOAT>(rect.top)));
+ CFX_PointF left_top = device2page.Transform(
+ CFX_PointF(static_cast<float>(rect.left), static_cast<float>(rect.top)));
CFX_PointF right_bottom = device2page.Transform(CFX_PointF(
- static_cast<FX_FLOAT>(rect.right), static_cast<FX_FLOAT>(rect.bottom)));
+ static_cast<float>(rect.right), static_cast<float>(rect.bottom)));
CFX_FloatRect rcPDF(left_top.x, right_bottom.y, right_bottom.x, left_top.y);
rcPDF.Normalize();
diff --git a/fpdfsdk/cpdfsdk_annot.cpp b/fpdfsdk/cpdfsdk_annot.cpp
index 4dcce48465..dcfcac92fc 100644
--- a/fpdfsdk/cpdfsdk_annot.cpp
+++ b/fpdfsdk/cpdfsdk_annot.cpp
@@ -43,11 +43,11 @@ CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() {
#endif // PDF_ENABLE_XFA
-FX_FLOAT CPDFSDK_Annot::GetMinWidth() const {
+float CPDFSDK_Annot::GetMinWidth() const {
return kMinWidth;
}
-FX_FLOAT CPDFSDK_Annot::GetMinHeight() const {
+float CPDFSDK_Annot::GetMinHeight() const {
return kMinHeight;
}
diff --git a/fpdfsdk/cpdfsdk_annot.h b/fpdfsdk/cpdfsdk_annot.h
index 36e7b56612..1053c00c13 100644
--- a/fpdfsdk/cpdfsdk_annot.h
+++ b/fpdfsdk/cpdfsdk_annot.h
@@ -32,8 +32,8 @@ class CPDFSDK_Annot : public CFX_Observable<CPDFSDK_Annot> {
virtual CXFA_FFWidget* GetXFAWidget() const;
#endif // PDF_ENABLE_XFA
- virtual FX_FLOAT GetMinWidth() const;
- virtual FX_FLOAT GetMinHeight() const;
+ virtual float GetMinWidth() const;
+ virtual float GetMinHeight() const;
virtual int GetLayoutOrder() const;
virtual CPDF_Annot* GetPDFAnnot() const;
virtual CPDF_Annot::Subtype GetAnnotSubtype() const;
diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp
index 3c96550a42..129491c210 100644
--- a/fpdfsdk/cpdfsdk_baannot.cpp
+++ b/fpdfsdk/cpdfsdk_baannot.cpp
@@ -245,11 +245,11 @@ BorderStyle CPDFSDK_BAAnnot::GetBorderStyle() const {
void CPDFSDK_BAAnnot::SetColor(FX_COLORREF color) {
CPDF_Array* pArray = m_pAnnot->GetAnnotDict()->SetNewFor<CPDF_Array>("C");
- pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetRValue(color)) /
+ pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetRValue(color)) /
255.0f);
- pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetGValue(color)) /
+ pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetGValue(color)) /
255.0f);
- pArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(FXSYS_GetBValue(color)) /
+ pArray->AddNew<CPDF_Number>(static_cast<float>(FXSYS_GetBValue(color)) /
255.0f);
}
@@ -261,28 +261,28 @@ bool CPDFSDK_BAAnnot::GetColor(FX_COLORREF& color) const {
if (CPDF_Array* pEntry = m_pAnnot->GetAnnotDict()->GetArrayFor("C")) {
size_t nCount = pEntry->GetCount();
if (nCount == 1) {
- FX_FLOAT g = pEntry->GetNumberAt(0) * 255;
+ float g = pEntry->GetNumberAt(0) * 255;
color = FXSYS_RGB((int)g, (int)g, (int)g);
return true;
} else if (nCount == 3) {
- FX_FLOAT r = pEntry->GetNumberAt(0) * 255;
- FX_FLOAT g = pEntry->GetNumberAt(1) * 255;
- FX_FLOAT b = pEntry->GetNumberAt(2) * 255;
+ float r = pEntry->GetNumberAt(0) * 255;
+ float g = pEntry->GetNumberAt(1) * 255;
+ float b = pEntry->GetNumberAt(2) * 255;
color = FXSYS_RGB((int)r, (int)g, (int)b);
return true;
} else if (nCount == 4) {
- FX_FLOAT c = pEntry->GetNumberAt(0);
- FX_FLOAT m = pEntry->GetNumberAt(1);
- FX_FLOAT y = pEntry->GetNumberAt(2);
- FX_FLOAT k = pEntry->GetNumberAt(3);
-
- FX_FLOAT r = 1.0f - std::min(1.0f, c + k);
- FX_FLOAT g = 1.0f - std::min(1.0f, m + k);
- FX_FLOAT b = 1.0f - std::min(1.0f, y + k);
+ float c = pEntry->GetNumberAt(0);
+ float m = pEntry->GetNumberAt(1);
+ float y = pEntry->GetNumberAt(2);
+ float k = pEntry->GetNumberAt(3);
+
+ float r = 1.0f - std::min(1.0f, c + k);
+ float g = 1.0f - std::min(1.0f, m + k);
+ float b = 1.0f - std::min(1.0f, y + k);
color = FXSYS_RGB((int)(r * 255), (int)(g * 255), (int)(b * 255));
diff --git a/fpdfsdk/cpdfsdk_pageview.cpp b/fpdfsdk/cpdfsdk_pageview.cpp
index c67948da90..d5a04fef3e 100644
--- a/fpdfsdk/cpdfsdk_pageview.cpp
+++ b/fpdfsdk/cpdfsdk_pageview.cpp
@@ -96,10 +96,9 @@ void CPDFSDK_PageView::PageView_OnDraw(CFX_RenderDevice* pDevice,
if (pPage->GetContext()->GetDocType() == DOCTYPE_DYNAMIC_XFA) {
CFX_Graphics gs(pDevice);
- CFX_RectF rectClip(static_cast<FX_FLOAT>(pClip.left),
- static_cast<FX_FLOAT>(pClip.top),
- static_cast<FX_FLOAT>(pClip.Width()),
- static_cast<FX_FLOAT>(pClip.Height()));
+ CFX_RectF rectClip(
+ static_cast<float>(pClip.left), static_cast<float>(pClip.top),
+ static_cast<float>(pClip.Width()), static_cast<float>(pClip.Height()));
gs.SetClipRect(rectClip);
std::unique_ptr<CXFA_RenderContext> pRenderContext(new CXFA_RenderContext);
CXFA_RenderOptions renderOptions;
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index e5df453d90..75c34b38b4 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -584,11 +584,11 @@ bool CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const {
return iColorType != COLORTYPE_TRANSPARENT;
}
-FX_FLOAT CPDFSDK_Widget::GetFontSize() const {
+float CPDFSDK_Widget::GetFontSize() const {
CPDF_FormControl* pFormCtrl = GetFormControl();
CPDF_DefaultAppearance pDa = pFormCtrl->GetDefaultAppearance();
CFX_ByteString csFont = "";
- FX_FLOAT fFontSize = 0.0f;
+ float fFontSize = 0.0f;
pDa.GetFont(csFont, fFontSize);
return fFontSize;
@@ -892,7 +892,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() {
CPWL_Color crBackground;
CPWL_Color crBorder;
int iColorType;
- FX_FLOAT fc[4];
+ float fc[4];
pControl->GetOriginalBackgroundColor(iColorType, fc);
if (iColorType > 0)
crBackground = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
@@ -901,7 +901,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() {
if (iColorType > 0)
crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ float fBorderWidth = (float)GetBorderWidth();
CPWL_Dash dsBorder(3, 0, 0);
CPWL_Color crLeftTop;
CPWL_Color crRightBottom;
@@ -929,7 +929,7 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() {
CPWL_Color crText(COLORTYPE_GRAY, 0);
- FX_FLOAT fFontSize = 12.0f;
+ float fFontSize = 12.0f;
CFX_ByteString csNameTag;
CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
@@ -1071,7 +1071,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() {
CPDF_FormControl* pControl = GetFormControl();
CPWL_Color crBackground, crBorder, crText;
int iColorType;
- FX_FLOAT fc[4];
+ float fc[4];
pControl->GetOriginalBackgroundColor(iColorType, fc);
if (iColorType > 0)
@@ -1081,7 +1081,7 @@ void CPDFSDK_Widget::ResetAppearance_CheckBox() {
if (iColorType > 0)
crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ float fBorderWidth = (float)GetBorderWidth();
CPWL_Dash dsBorder(3, 0, 0);
CPWL_Color crLeftTop, crRightBottom;
@@ -1191,7 +1191,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() {
CPDF_FormControl* pControl = GetFormControl();
CPWL_Color crBackground, crBorder, crText;
int iColorType;
- FX_FLOAT fc[4];
+ float fc[4];
pControl->GetOriginalBackgroundColor(iColorType, fc);
if (iColorType > 0)
@@ -1201,7 +1201,7 @@ void CPDFSDK_Widget::ResetAppearance_RadioButton() {
if (iColorType > 0)
crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ float fBorderWidth = (float)GetBorderWidth();
CPWL_Dash dsBorder(3, 0, 0);
CPWL_Color crLeftTop;
CPWL_Color crRightBottom;
@@ -1369,7 +1369,7 @@ void CPDFSDK_Widget::ResetAppearance_ComboBox(const CFX_WideString* sValue) {
pEdit->SetPlateRect(rcEdit);
pEdit->SetAlignmentV(1, true);
- FX_FLOAT fFontSize = GetFontSize();
+ float fFontSize = GetFontSize();
if (IsFloatZero(fFontSize))
pEdit->SetAutoFontSize(true, true);
else
@@ -1428,14 +1428,14 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() {
pEdit->SetPlateRect(CFX_FloatRect(rcClient.left, 0.0f, rcClient.right, 0.0f));
- FX_FLOAT fFontSize = GetFontSize();
+ float fFontSize = GetFontSize();
pEdit->SetFontSize(IsFloatZero(fFontSize) ? 12.0f : fFontSize);
pEdit->Initialize();
CFX_ByteTextBuf sList;
- FX_FLOAT fy = rcClient.top;
+ float fy = rcClient.top;
int32_t nTop = pField->GetTopVisibleIndex();
int32_t nCount = pField->CountOptions();
@@ -1453,7 +1453,7 @@ void CPDFSDK_Widget::ResetAppearance_ListBox() {
pEdit->SetText(pField->GetOptionLabel(i));
CFX_FloatRect rcContent = pEdit->GetContentRect();
- FX_FLOAT fItemHeight = rcContent.Height();
+ float fItemHeight = rcContent.Height();
if (bSelected) {
CFX_FloatRect rcItem =
@@ -1530,7 +1530,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const CFX_WideString* sValue) {
int nMaxLen = pField->GetMaxLen();
bool bCharArray = (dwFieldFlags >> 24) & 1;
- FX_FLOAT fFontSize = GetFontSize();
+ float fFontSize = GetFontSize();
#ifdef PDF_ENABLE_XFA
CFX_WideString sValueTmp;
@@ -1642,7 +1642,7 @@ void CPDFSDK_Widget::ResetAppearance_TextField(const CFX_WideString* sValue) {
CFX_FloatRect CPDFSDK_Widget::GetClientRect() const {
CFX_FloatRect rcWindow = GetRotatedRect();
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ float fBorderWidth = (float)GetBorderWidth();
switch (GetBorderStyle()) {
case BorderStyle::BEVELED:
case BorderStyle::INSET:
@@ -1657,8 +1657,8 @@ CFX_FloatRect CPDFSDK_Widget::GetClientRect() const {
CFX_FloatRect CPDFSDK_Widget::GetRotatedRect() const {
CFX_FloatRect rectAnnot = GetRect();
- FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
- FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
+ float fWidth = rectAnnot.right - rectAnnot.left;
+ float fHeight = rectAnnot.top - rectAnnot.bottom;
CPDF_FormControl* pControl = GetFormControl();
CFX_FloatRect rcPDFWindow;
@@ -1691,7 +1691,7 @@ CFX_ByteString CPDFSDK_Widget::GetBorderAppStream() const {
CPWL_Color crBackground = GetFillPWLColor();
CPWL_Color crLeftTop, crRightBottom;
- FX_FLOAT fBorderWidth = (FX_FLOAT)GetBorderWidth();
+ float fBorderWidth = (float)GetBorderWidth();
CPWL_Dash dsBorder(3, 0, 0);
BorderStyle nBorderStyle = GetBorderStyle();
@@ -1722,8 +1722,8 @@ CFX_Matrix CPDFSDK_Widget::GetMatrix() const {
CFX_Matrix mt;
CPDF_FormControl* pControl = GetFormControl();
CFX_FloatRect rcAnnot = GetRect();
- FX_FLOAT fWidth = rcAnnot.right - rcAnnot.left;
- FX_FLOAT fHeight = rcAnnot.top - rcAnnot.bottom;
+ float fWidth = rcAnnot.right - rcAnnot.left;
+ float fHeight = rcAnnot.top - rcAnnot.bottom;
switch (abs(pControl->GetRotation() % 360)) {
case 0:
@@ -1751,7 +1751,7 @@ CPWL_Color CPDFSDK_Widget::GetTextPWLColor() const {
CPDF_DefaultAppearance da = pFormCtrl->GetDefaultAppearance();
if (da.HasColor()) {
int32_t iColorType;
- FX_FLOAT fc[4];
+ float fc[4];
da.GetColor(iColorType, fc);
crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
}
@@ -1764,7 +1764,7 @@ CPWL_Color CPDFSDK_Widget::GetBorderPWLColor() const {
CPDF_FormControl* pFormCtrl = GetFormControl();
int32_t iColorType;
- FX_FLOAT fc[4];
+ float fc[4];
pFormCtrl->GetOriginalBorderColor(iColorType, fc);
if (iColorType > 0)
crBorder = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
@@ -1777,7 +1777,7 @@ CPWL_Color CPDFSDK_Widget::GetFillPWLColor() const {
CPDF_FormControl* pFormCtrl = GetFormControl();
int32_t iColorType;
- FX_FLOAT fc[4];
+ float fc[4];
pFormCtrl->GetOriginalBackgroundColor(iColorType, fc);
if (iColorType > 0)
crFill = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
diff --git a/fpdfsdk/cpdfsdk_widget.h b/fpdfsdk/cpdfsdk_widget.h
index 21e5169706..9f58cc1d61 100644
--- a/fpdfsdk/cpdfsdk_widget.h
+++ b/fpdfsdk/cpdfsdk_widget.h
@@ -77,7 +77,7 @@ class CPDFSDK_Widget : public CPDFSDK_BAAnnot {
bool GetFillColor(FX_COLORREF& color) const;
bool GetBorderColor(FX_COLORREF& color) const;
bool GetTextColor(FX_COLORREF& color) const;
- FX_FLOAT GetFontSize() const;
+ float GetFontSize() const;
int GetSelectedIndex(int nIndex) const;
#ifndef PDF_ENABLE_XFA
diff --git a/fpdfsdk/formfiller/cffl_formfiller.cpp b/fpdfsdk/formfiller/cffl_formfiller.cpp
index da6f9208e0..947c495f19 100644
--- a/fpdfsdk/formfiller/cffl_formfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_formfiller.cpp
@@ -438,8 +438,8 @@ CFX_WideString CFFL_FormFiller::LoadPopupMenuString(int nIndex) {
CFX_FloatRect CFFL_FormFiller::GetPDFWindowRect() const {
CFX_FloatRect rectAnnot = m_pWidget->GetPDFAnnot()->GetRect();
- FX_FLOAT fWidth = rectAnnot.right - rectAnnot.left;
- FX_FLOAT fHeight = rectAnnot.top - rectAnnot.bottom;
+ float fWidth = rectAnnot.right - rectAnnot.left;
+ float fHeight = rectAnnot.top - rectAnnot.bottom;
if ((m_pWidget->GetRotate() / 90) & 0x01)
return CFX_FloatRect(0, 0, fHeight, fWidth);
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
index a830d529cb..4cebc83fc4 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.cpp
@@ -527,10 +527,10 @@ void CFFL_InteractiveFormFiller::UnRegisterFormFiller(CPDFSDK_Annot* pAnnot) {
}
void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
- FX_FLOAT fPopupMin,
- FX_FLOAT fPopupMax,
+ float fPopupMin,
+ float fPopupMax,
int32_t& nRet,
- FX_FLOAT& fPopupRet) {
+ float& fPopupRet) {
CFFL_PrivateData* pData = (CFFL_PrivateData*)pPrivateData;
CFX_FloatRect rcPageView(0, 0, 0, 0);
@@ -540,8 +540,8 @@ void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
CFX_FloatRect rcAnnot = pData->pWidget->GetRect();
- FX_FLOAT fTop = 0.0f;
- FX_FLOAT fBottom = 0.0f;
+ float fTop = 0.0f;
+ float fBottom = 0.0f;
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pData->pWidget;
switch (pWidget->GetRotate() / 90) {
@@ -564,9 +564,9 @@ void CFFL_InteractiveFormFiller::QueryWherePopup(void* pPrivateData,
break;
}
- FX_FLOAT fFactHeight = 0;
+ float fFactHeight = 0;
bool bBottom = true;
- FX_FLOAT fMaxListBoxHeight = 0;
+ float fMaxListBoxHeight = 0;
if (fPopupMax > FFL_MAXLISTBOXHEIGHT) {
if (fPopupMin > FFL_MAXLISTBOXHEIGHT) {
fMaxListBoxHeight = fPopupMin;
diff --git a/fpdfsdk/formfiller/cffl_interactiveformfiller.h b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
index 90fd98c0e8..3c23a6e2f8 100644
--- a/fpdfsdk/formfiller/cffl_interactiveformfiller.h
+++ b/fpdfsdk/formfiller/cffl_interactiveformfiller.h
@@ -139,10 +139,10 @@ class CFFL_InteractiveFormFiller : public IPWL_Filler_Notify {
// IPWL_Filler_Notify:
void QueryWherePopup(void* pPrivateData,
- FX_FLOAT fPopupMin,
- FX_FLOAT fPopupMax,
+ float fPopupMin,
+ float fPopupMax,
int32_t& nRet,
- FX_FLOAT& fPopupRet) override;
+ float& fPopupRet) override;
void OnBeforeKeyStroke(void* pPrivateData,
CFX_WideString& strChange,
const CFX_WideString& strChangeEx,
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index 06ea939b72..c43412cfc7 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -123,14 +123,14 @@ int ParserAnnots(CPDF_Document* pSourceDoc,
return FLATTEN_SUCCESS;
}
-FX_FLOAT GetMinMaxValue(const std::vector<CFX_FloatRect>& array,
- FPDF_TYPE type,
- FPDF_VALUE value) {
+float GetMinMaxValue(const std::vector<CFX_FloatRect>& array,
+ FPDF_TYPE type,
+ FPDF_VALUE value) {
size_t nRects = array.size();
if (nRects <= 0)
return 0.0f;
- std::vector<FX_FLOAT> pArray(nRects);
+ std::vector<float> pArray(nRects);
switch (value) {
case LEFT:
for (size_t i = 0; i < nRects; i++)
@@ -153,7 +153,7 @@ FX_FLOAT GetMinMaxValue(const std::vector<CFX_FloatRect>& array,
return 0.0f;
}
- FX_FLOAT fRet = pArray[0];
+ float fRet = pArray[0];
if (type == MAX) {
for (size_t i = 1; i < nRects; i++)
fRet = std::max(fRet, pArray[i]);
@@ -231,11 +231,11 @@ CFX_Matrix GetMatrix(CFX_FloatRect rcAnnot,
matrix.TransformRect(rcStream);
rcStream.Normalize();
- FX_FLOAT a = rcAnnot.Width() / rcStream.Width();
- FX_FLOAT d = rcAnnot.Height() / rcStream.Height();
+ float a = rcAnnot.Width() / rcStream.Width();
+ float d = rcAnnot.Height() / rcStream.Height();
- FX_FLOAT e = rcAnnot.left - rcStream.left * a;
- FX_FLOAT f = rcAnnot.bottom - rcStream.bottom * d;
+ float e = rcAnnot.left - rcStream.left * a;
+ float f = rcAnnot.bottom - rcStream.bottom * d;
return CFX_Matrix(a, 0, 0, d, e, f);
}
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index 3427f4ea58..32ba3a7525 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -206,8 +206,7 @@ FPDFPageObj_TransformClipPath(FPDF_PAGEOBJECT page_object,
CPDF_PageObject* pPageObj = (CPDF_PageObject*)page_object;
if (!pPageObj)
return;
- CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
- (FX_FLOAT)e, (FX_FLOAT)f);
+ CFX_Matrix matrix((float)a, (float)b, (float)c, (float)d, (float)e, (float)f);
// Special treatment to shading object, because the ClipPath for shading
// object is already transformed.
diff --git a/fpdfsdk/fpdfdoc.cpp b/fpdfsdk/fpdfdoc.cpp
index f7d94c2f97..39c7602565 100644
--- a/fpdfsdk/fpdfdoc.cpp
+++ b/fpdfsdk/fpdfdoc.cpp
@@ -258,9 +258,9 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page,
return nullptr;
return pLinkList
- ->GetLinkAtPoint(
- pPage, CFX_PointF(static_cast<FX_FLOAT>(x), static_cast<FX_FLOAT>(y)),
- nullptr)
+ ->GetLinkAtPoint(pPage,
+ CFX_PointF(static_cast<float>(x), static_cast<float>(y)),
+ nullptr)
.GetDict();
}
@@ -277,7 +277,7 @@ DLLEXPORT int STDCALL FPDFLink_GetLinkZOrderAtPoint(FPDF_PAGE page,
int z_order = -1;
pLinkList->GetLinkAtPoint(
- pPage, CFX_PointF(static_cast<FX_FLOAT>(x), static_cast<FX_FLOAT>(y)),
+ pPage, CFX_PointF(static_cast<float>(x), static_cast<float>(y)),
&z_order);
return z_order;
}
diff --git a/fpdfsdk/fpdfeditimg.cpp b/fpdfsdk/fpdfeditimg.cpp
index 56875e233e..ad5605011c 100644
--- a/fpdfsdk/fpdfeditimg.cpp
+++ b/fpdfsdk/fpdfeditimg.cpp
@@ -78,10 +78,9 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFImageObj_SetMatrix(FPDF_PAGEOBJECT image_object,
return false;
CPDF_ImageObject* pImgObj = reinterpret_cast<CPDF_ImageObject*>(image_object);
- pImgObj->set_matrix(
- CFX_Matrix(static_cast<FX_FLOAT>(a), static_cast<FX_FLOAT>(b),
- static_cast<FX_FLOAT>(c), static_cast<FX_FLOAT>(d),
- static_cast<FX_FLOAT>(e), static_cast<FX_FLOAT>(f)));
+ pImgObj->set_matrix(CFX_Matrix(static_cast<float>(a), static_cast<float>(b),
+ static_cast<float>(c), static_cast<float>(d),
+ static_cast<float>(e), static_cast<float>(f)));
pImgObj->CalcBoundingBox();
return true;
}
diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp
index 63740ba083..cff339c8f8 100644
--- a/fpdfsdk/fpdfeditpage.cpp
+++ b/fpdfsdk/fpdfeditpage.cpp
@@ -112,8 +112,8 @@ DLLEXPORT FPDF_PAGE STDCALL FPDFPage_New(FPDF_DOCUMENT document,
CPDF_Array* pMediaBoxArray = pPageDict->SetNewFor<CPDF_Array>("MediaBox");
pMediaBoxArray->AddNew<CPDF_Number>(0);
pMediaBoxArray->AddNew<CPDF_Number>(0);
- pMediaBoxArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(width));
- pMediaBoxArray->AddNew<CPDF_Number>(static_cast<FX_FLOAT>(height));
+ pMediaBoxArray->AddNew<CPDF_Number>(static_cast<float>(width));
+ pMediaBoxArray->AddNew<CPDF_Number>(static_cast<float>(height));
pPageDict->SetNewFor<CPDF_Number>("Rotate", 0);
pPageDict->SetNewFor<CPDF_Dictionary>("Resources");
@@ -267,8 +267,7 @@ DLLEXPORT void STDCALL FPDFPageObj_Transform(FPDF_PAGEOBJECT page_object,
if (!pPageObj)
return;
- CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
- (FX_FLOAT)e, (FX_FLOAT)f);
+ CFX_Matrix matrix((float)a, (float)b, (float)c, (float)d, (float)e, (float)f);
pPageObj->Transform(matrix);
}
@@ -287,8 +286,8 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
for (size_t i = 0; i < AnnotList.Count(); ++i) {
CPDF_Annot* pAnnot = AnnotList.GetAt(i);
CFX_FloatRect rect = pAnnot->GetRect(); // transformAnnots Rectangle
- CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d,
- (FX_FLOAT)e, (FX_FLOAT)f);
+ CFX_Matrix matrix((float)a, (float)b, (float)c, (float)d, (float)e,
+ (float)f);
matrix.TransformRect(rect);
CPDF_Array* pRectArray = pAnnot->GetAnnotDict()->GetArrayFor("Rect");
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp
index d7ffd8b1f2..f085ed3481 100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdfeditpath.cpp
@@ -35,7 +35,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetStrokeColor(FPDF_PAGEOBJECT path,
auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
pPathObj->m_GeneralState.SetStrokeAlpha(A / 255.f);
- FX_FLOAT rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
+ float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
pPathObj->m_ColorState.SetStrokeColor(
CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
return true;
@@ -60,7 +60,7 @@ DLLEXPORT FPDF_BOOL FPDFPath_SetFillColor(FPDF_PAGEOBJECT path,
auto* pPathObj = reinterpret_cast<CPDF_PathObject*>(path);
pPathObj->m_GeneralState.SetFillAlpha(A / 255.f);
- FX_FLOAT rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
+ float rgb[3] = {R / 255.f, G / 255.f, B / 255.f};
pPathObj->m_ColorState.SetFillColor(
CPDF_ColorSpace::GetStockCS(PDFCS_DEVICERGB), rgb, 3);
return true;
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 57ff6b669c..3c866a91a3 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -156,8 +156,8 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
if (pPage) {
CPDF_InterForm interform(pPage->m_pDocument);
CPDF_FormControl* pFormCtrl = interform.GetControlAtPoint(
- pPage, CFX_PointF(static_cast<FX_FLOAT>(page_x),
- static_cast<FX_FLOAT>(page_y)),
+ pPage,
+ CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)),
nullptr);
if (!pFormCtrl)
return -1;
@@ -198,8 +198,8 @@ DLLEXPORT int STDCALL FPDFPage_HasFormFieldAtPoint(FPDF_FORMHANDLE hHandle,
rcWidget.bottom -= 1.0f;
rcWidget.top += 1.0f;
- if (rcWidget.Contains(CFX_PointF(static_cast<FX_FLOAT>(page_x),
- static_cast<FX_FLOAT>(page_y)))) {
+ if (rcWidget.Contains(CFX_PointF(static_cast<float>(page_x),
+ static_cast<float>(page_y)))) {
return FPDF_FORMFIELD_XFA;
}
pXFAAnnot = pWidgetIterator->MoveToNext();
@@ -227,8 +227,7 @@ DLLEXPORT int STDCALL FPDFPage_FormFieldZOrderAtPoint(FPDF_FORMHANDLE hHandle,
CPDF_InterForm interform(pPage->m_pDocument);
int z_order = -1;
(void)interform.GetControlAtPoint(
- pPage,
- CFX_PointF(static_cast<FX_FLOAT>(page_x), static_cast<FX_FLOAT>(page_y)),
+ pPage, CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)),
&z_order);
return z_order;
}
@@ -318,7 +317,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnLButtonUp(FPDF_FORMHANDLE hHandle,
if (!pPageView)
return false;
- CFX_PointF pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
+ CFX_PointF pt((float)page_x, (float)page_y);
return pPageView->OnLButtonUp(pt, modifier);
}
@@ -343,7 +342,7 @@ DLLEXPORT FPDF_BOOL STDCALL FORM_OnRButtonUp(FPDF_FORMHANDLE hHandle,
if (!pPageView)
return false;
- CFX_PointF pt((FX_FLOAT)page_x, (FX_FLOAT)page_y);
+ CFX_PointF pt((float)page_x, (float)page_y);
return pPageView->OnRButtonUp(pt, modifier);
}
#endif // PDF_ENABLE_XFA
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp
index 0432afd707..cbb682d85a 100644
--- a/fpdfsdk/fpdftext.cpp
+++ b/fpdfsdk/fpdftext.cpp
@@ -134,9 +134,9 @@ DLLEXPORT int STDCALL FPDFText_GetCharIndexAtPos(FPDF_TEXTPAGE text_page,
CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
return textpage->GetIndexAtPos(
- CFX_PointF(static_cast<FX_FLOAT>(x), static_cast<FX_FLOAT>(y)),
- CFX_SizeF(static_cast<FX_FLOAT>(xTolerance),
- static_cast<FX_FLOAT>(yTolerance)));
+ CFX_PointF(static_cast<float>(x), static_cast<float>(y)),
+ CFX_SizeF(static_cast<float>(xTolerance),
+ static_cast<float>(yTolerance)));
}
DLLEXPORT int STDCALL FPDFText_GetText(FPDF_TEXTPAGE text_page,
@@ -201,8 +201,7 @@ DLLEXPORT int STDCALL FPDFText_GetBoundedText(FPDF_TEXTPAGE text_page,
return 0;
CPDF_TextPage* textpage = CPDFTextPageFromFPDFTextPage(text_page);
- CFX_FloatRect rect((FX_FLOAT)left, (FX_FLOAT)bottom, (FX_FLOAT)right,
- (FX_FLOAT)top);
+ CFX_FloatRect rect((float)left, (float)bottom, (float)right, (float)top);
CFX_WideString str = textpage->GetTextByRect(rect);
if (buflen <= 0 || !buffer)
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 9100017bea..4c3631fc88 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -891,8 +891,8 @@ DLLEXPORT void STDCALL FPDF_DeviceToPage(FPDF_PAGE page,
CFX_Matrix device2page;
device2page.SetReverse(page2device);
- CFX_PointF pos = device2page.Transform(CFX_PointF(
- static_cast<FX_FLOAT>(device_x), static_cast<FX_FLOAT>(device_y)));
+ CFX_PointF pos = device2page.Transform(
+ CFX_PointF(static_cast<float>(device_x), static_cast<float>(device_y)));
*page_x = pos.x;
*page_y = pos.y;
@@ -921,7 +921,7 @@ DLLEXPORT void STDCALL FPDF_PageToDevice(FPDF_PAGE page,
CFX_Matrix page2device =
pPage->GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate);
CFX_PointF pos = page2device.Transform(
- CFX_PointF(static_cast<FX_FLOAT>(page_x), static_cast<FX_FLOAT>(page_y)));
+ CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)));
*device_x = FXSYS_round(pos.x);
*device_y = FXSYS_round(pos.y);
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 731b0cc296..743b68b27f 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -108,8 +108,8 @@ void CPDFXFA_DocEnvironment::DisplayCaret(CXFA_FFWidget* hWidget,
}
bool CPDFXFA_DocEnvironment::GetPopupPos(CXFA_FFWidget* hWidget,
- FX_FLOAT fMinPopup,
- FX_FLOAT fMaxPopup,
+ float fMinPopup,
+ float fMaxPopup,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup) {
if (!hWidget)
@@ -185,13 +185,13 @@ bool CPDFXFA_DocEnvironment::GetPopupPos(CXFA_FFWidget* hWidget,
dwPos = 1;
}
- FX_FLOAT fPopupHeight;
+ float fPopupHeight;
if (t < fMinPopup)
fPopupHeight = fMinPopup;
else if (t > fMaxPopup)
fPopupHeight = fMaxPopup;
else
- fPopupHeight = static_cast<FX_FLOAT>(t);
+ fPopupHeight = static_cast<float>(t);
switch (nRotate) {
case 0:
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
index dc18d9a0c6..4624d8008c 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.h
@@ -31,8 +31,8 @@ class CPDFXFA_DocEnvironment : public IXFA_DocEnvironment {
const CFX_RectF* pRtAnchor) override;
// dwPos: (0:bottom 1:top)
bool GetPopupPos(CXFA_FFWidget* hWidget,
- FX_FLOAT fMinPopup,
- FX_FLOAT fMaxPopup,
+ float fMinPopup,
+ float fMaxPopup,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup) override;
bool PopupMenu(CXFA_FFWidget* hWidget, CFX_PointF ptPopup) override;
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
index 8b5bb3d279..d3910ae263 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.cpp
@@ -94,7 +94,7 @@ bool CPDFXFA_Page::LoadPDFPage(CPDF_Dictionary* pageDict) {
return true;
}
-FX_FLOAT CPDFXFA_Page::GetPageWidth() const {
+float CPDFXFA_Page::GetPageWidth() const {
if (!m_pPDFPage && !m_pXFAPageView)
return 0.0f;
@@ -118,7 +118,7 @@ FX_FLOAT CPDFXFA_Page::GetPageWidth() const {
return 0.0f;
}
-FX_FLOAT CPDFXFA_Page::GetPageHeight() const {
+float CPDFXFA_Page::GetPageHeight() const {
if (!m_pPDFPage && !m_pXFAPageView)
return 0.0f;
@@ -158,8 +158,8 @@ void CPDFXFA_Page::DeviceToPage(int start_x,
device2page.SetReverse(
GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate));
- CFX_PointF pos = device2page.Transform(CFX_PointF(
- static_cast<FX_FLOAT>(device_x), static_cast<FX_FLOAT>(device_y)));
+ CFX_PointF pos = device2page.Transform(
+ CFX_PointF(static_cast<float>(device_x), static_cast<float>(device_y)));
*page_x = pos.x;
*page_y = pos.y;
@@ -181,7 +181,7 @@ void CPDFXFA_Page::PageToDevice(int start_x,
GetDisplayMatrix(start_x, start_y, size_x, size_y, rotate);
CFX_PointF pos = page2device.Transform(
- CFX_PointF(static_cast<FX_FLOAT>(page_x), static_cast<FX_FLOAT>(page_y)));
+ CFX_PointF(static_cast<float>(page_x), static_cast<float>(page_y)));
*device_x = FXSYS_round(pos.x);
*device_y = FXSYS_round(pos.y);
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_page.h b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
index 993885d59e..05b9238eb7 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_page.h
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_page.h
@@ -38,8 +38,8 @@ class CPDFXFA_Page {
m_pXFAPageView = pPageView;
}
- FX_FLOAT GetPageWidth() const;
- FX_FLOAT GetPageHeight() const;
+ float GetPageWidth() const;
+ float GetPageHeight() const;
void DeviceToPage(int start_x,
int start_y,
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;
};
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index a45b8b9ea7..45c22b106c 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1468,7 +1468,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj) {
for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
uint32_t charcode = CPDF_Font::kInvalidCharCode;
- FX_FLOAT kerning;
+ float kerning;
pTextObj->GetCharInfo(i, &charcode, &kerning);
CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
@@ -1501,7 +1501,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj,
for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
uint32_t charcode = CPDF_Font::kInvalidCharCode;
- FX_FLOAT kerning;
+ float kerning;
pTextObj->GetCharInfo(i, &charcode, &kerning);
CFX_WideString swUnicode = pFont->UnicodeFromCharCode(charcode);
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index 61a2538df7..12c3508597 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -575,7 +575,7 @@ bool Field::buttonAlignX(CJS_Runtime* pRuntime,
CPDF_IconFit IconFit = pFormControl->GetIconFit();
- FX_FLOAT fLeft, fBottom;
+ float fLeft, fBottom;
IconFit.GetIconPosition(fLeft, fBottom);
vp << (int32_t)fLeft;
@@ -624,7 +624,7 @@ bool Field::buttonAlignY(CJS_Runtime* pRuntime,
CPDF_IconFit IconFit = pFormControl->GetIconFit();
- FX_FLOAT fLeft, fBottom;
+ float fLeft, fBottom;
IconFit.GetIconPosition(fLeft, fBottom);
vp << (int32_t)fBottom;
@@ -2003,11 +2003,11 @@ bool Field::rect(CJS_Runtime* pRuntime,
rcArray.GetElement(pRuntime, 2, Lower_Rightx);
rcArray.GetElement(pRuntime, 3, Lower_Righty);
- FX_FLOAT pArray[4] = {0.0f, 0.0f, 0.0f, 0.0f};
- pArray[0] = static_cast<FX_FLOAT>(Upper_Leftx.ToInt(pRuntime));
- pArray[1] = static_cast<FX_FLOAT>(Lower_Righty.ToInt(pRuntime));
- pArray[2] = static_cast<FX_FLOAT>(Lower_Rightx.ToInt(pRuntime));
- pArray[3] = static_cast<FX_FLOAT>(Upper_Lefty.ToInt(pRuntime));
+ float pArray[4] = {0.0f, 0.0f, 0.0f, 0.0f};
+ pArray[0] = static_cast<float>(Upper_Leftx.ToInt(pRuntime));
+ pArray[1] = static_cast<float>(Lower_Righty.ToInt(pRuntime));
+ pArray[2] = static_cast<float>(Lower_Rightx.ToInt(pRuntime));
+ pArray[3] = static_cast<float>(Upper_Lefty.ToInt(pRuntime));
CFX_FloatRect crRect(pArray);
if (m_bDelay) {
@@ -2485,7 +2485,7 @@ bool Field::textSize(CJS_Runtime* pRuntime,
CPDF_DefaultAppearance FieldAppearance = pFormControl->GetDefaultAppearance();
CFX_ByteString csFontNameTag;
- FX_FLOAT fFontSize;
+ float fFontSize;
FieldAppearance.GetFont(csFontNameTag, fFontSize);
vp << (int)fFontSize;
return true;
diff --git a/fpdfsdk/javascript/color.cpp b/fpdfsdk/javascript/color.cpp
index b5ccbadabf..376eefa248 100644
--- a/fpdfsdk/javascript/color.cpp
+++ b/fpdfsdk/javascript/color.cpp
@@ -121,13 +121,12 @@ void color::ConvertArrayToPWLColor(CJS_Runtime* pRuntime,
if (sSpace == "T") {
*color = CPWL_Color(COLORTYPE_TRANSPARENT);
} else if (sSpace == "G") {
- *color = CPWL_Color(COLORTYPE_GRAY, (FX_FLOAT)d1);
+ *color = CPWL_Color(COLORTYPE_GRAY, (float)d1);
} else if (sSpace == "RGB") {
- *color =
- CPWL_Color(COLORTYPE_RGB, (FX_FLOAT)d1, (FX_FLOAT)d2, (FX_FLOAT)d3);
+ *color = CPWL_Color(COLORTYPE_RGB, (float)d1, (float)d2, (float)d3);
} else if (sSpace == "CMYK") {
- *color = CPWL_Color(COLORTYPE_CMYK, (FX_FLOAT)d1, (FX_FLOAT)d2,
- (FX_FLOAT)d3, (FX_FLOAT)d4);
+ *color =
+ CPWL_Color(COLORTYPE_CMYK, (float)d1, (float)d2, (float)d3, (float)d4);
}
}
diff --git a/fpdfsdk/pdfwindow/PWL_Caret.cpp b/fpdfsdk/pdfwindow/PWL_Caret.cpp
index 3360bbf62a..3658fbc23a 100644
--- a/fpdfsdk/pdfwindow/PWL_Caret.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Caret.cpp
@@ -35,9 +35,9 @@ void CPWL_Caret::DrawThisAppearance(CFX_RenderDevice* pDevice,
CFX_FloatRect rcClip = GetClipRect();
CFX_PathData path;
- FX_FLOAT fCaretX = rcRect.left + m_fWidth * 0.5f;
- FX_FLOAT fCaretTop = rcRect.top;
- FX_FLOAT fCaretBottom = rcRect.bottom;
+ float fCaretX = rcRect.left + m_fWidth * 0.5f;
+ float fCaretTop = rcRect.top;
+ float fCaretBottom = rcRect.bottom;
if (!rcClip.IsEmpty()) {
rcRect.Intersect(rcClip);
if (rcRect.IsEmpty())
diff --git a/fpdfsdk/pdfwindow/PWL_Caret.h b/fpdfsdk/pdfwindow/PWL_Caret.h
index 60ebbdc8e1..7c041f4f5e 100644
--- a/fpdfsdk/pdfwindow/PWL_Caret.h
+++ b/fpdfsdk/pdfwindow/PWL_Caret.h
@@ -45,7 +45,7 @@ class CPWL_Caret : public CPWL_Wnd {
bool m_bFlash;
CFX_PointF m_ptHead;
CFX_PointF m_ptFoot;
- FX_FLOAT m_fWidth;
+ float m_fWidth;
int32_t m_nDelay;
CFX_FloatRect m_rcInvalid;
};
diff --git a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
index bc6909a07d..5adf4561f2 100644
--- a/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ComboBox.cpp
@@ -339,8 +339,8 @@ void CPWL_ComboBox::RePosChildWnd() {
CFX_FloatRect rcEdit = rcClient;
CFX_FloatRect rcList = CPWL_Wnd::GetWindowRect();
- FX_FLOAT fOldWindowHeight = m_rcOldWindow.Height();
- FX_FLOAT fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2;
+ float fOldWindowHeight = m_rcOldWindow.Height();
+ float fOldClientHeight = fOldWindowHeight - GetBorderWidth() * 2;
switch (m_nPopupWhere) {
case 0:
@@ -440,7 +440,7 @@ void CPWL_ComboBox::SetPopup(bool bPopup) {
return;
if (bPopup == m_bPopup)
return;
- FX_FLOAT fListHeight = m_pList->GetContentRect().Height();
+ float fListHeight = m_pList->GetContentRect().Height();
if (!IsFloatBigger(fListHeight, 0.0f))
return;
@@ -453,12 +453,12 @@ void CPWL_ComboBox::SetPopup(bool bPopup) {
return;
#endif // PDF_ENABLE_XFA
int32_t nWhere = 0;
- FX_FLOAT fPopupRet = 0.0f;
- FX_FLOAT fPopupMin = 0.0f;
+ float fPopupRet = 0.0f;
+ float fPopupMin = 0.0f;
if (m_pList->GetCount() > 3)
fPopupMin =
m_pList->GetFirstHeight() * 3 + m_pList->GetBorderWidth() * 2;
- FX_FLOAT fPopupMax = fListHeight + m_pList->GetBorderWidth() * 2;
+ float fPopupMax = fListHeight + m_pList->GetBorderWidth() * 2;
m_pFillerNotify->QueryWherePopup(GetAttachedData(), fPopupMin, fPopupMax,
nWhere, fPopupRet);
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.cpp b/fpdfsdk/pdfwindow/PWL_Edit.cpp
index b77aad9ab0..f84c38e23b 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Edit.cpp
@@ -101,7 +101,7 @@ void CPWL_Edit::RePosChildWnd() {
CFX_FloatRect CPWL_Edit::GetClientRect() const {
CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(
- GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+ GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth()));
if (CPWL_ScrollBar* pVSB = GetVScrollBar()) {
if (pVSB->IsVisible()) {
@@ -329,7 +329,7 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
switch (GetBorderStyle()) {
case BorderStyle::SOLID: {
CFX_GraphStateData gsd;
- gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
+ gsd.m_LineWidth = (float)GetBorderWidth();
CFX_PathData path;
@@ -355,12 +355,12 @@ void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice,
}
case BorderStyle::DASH: {
CFX_GraphStateData gsd;
- gsd.m_LineWidth = (FX_FLOAT)GetBorderWidth();
+ gsd.m_LineWidth = (float)GetBorderWidth();
gsd.SetDashCount(2);
- gsd.m_DashArray[0] = (FX_FLOAT)GetBorderDash().nDash;
- gsd.m_DashArray[1] = (FX_FLOAT)GetBorderDash().nGap;
- gsd.m_DashPhase = (FX_FLOAT)GetBorderDash().nPhase;
+ gsd.m_DashArray[0] = (float)GetBorderDash().nDash;
+ gsd.m_DashArray[1] = (float)GetBorderDash().nGap;
+ gsd.m_DashPhase = (float)GetBorderDash().nPhase;
CFX_PathData path;
for (int32_t i = 0; i < nCharArray - 1; i++) {
@@ -463,7 +463,7 @@ void CPWL_Edit::OnKillFocus() {
m_bFocus = false;
}
-void CPWL_Edit::SetCharSpace(FX_FLOAT fCharSpace) {
+void CPWL_Edit::SetCharSpace(float fCharSpace) {
m_pEdit->SetCharSpace(fCharSpace);
}
@@ -527,16 +527,16 @@ bool CPWL_Edit::IsTextFull() const {
return m_pEdit->IsTextFull();
}
-FX_FLOAT CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont,
- const CFX_FloatRect& rcPlate,
- int32_t nCharArray) {
+float CPWL_Edit::GetCharArrayAutoFontSize(CPDF_Font* pFont,
+ const CFX_FloatRect& rcPlate,
+ int32_t nCharArray) {
if (pFont && !pFont->IsStandardFont()) {
FX_RECT rcBBox;
pFont->GetFontBBox(rcBBox);
CFX_FloatRect rcCell = rcPlate;
- FX_FLOAT xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
- FX_FLOAT ydiv = -rcCell.Height() * 1000.0f / rcBBox.Height();
+ float xdiv = rcCell.Width() / nCharArray * 1000.0f / rcBBox.Width();
+ float ydiv = -rcCell.Height() * 1000.0f / rcBBox.Height();
return xdiv < ydiv ? xdiv : ydiv;
}
@@ -551,8 +551,8 @@ void CPWL_Edit::SetCharArray(int32_t nCharArray) {
if (HasFlag(PWS_AUTOFONTSIZE)) {
if (IPVT_FontMap* pFontMap = GetFontMap()) {
- FX_FLOAT fFontSize = GetCharArrayAutoFontSize(
- pFontMap->GetPDFFont(0), GetClientRect(), nCharArray);
+ float fFontSize = GetCharArrayAutoFontSize(pFontMap->GetPDFFont(0),
+ GetClientRect(), nCharArray);
if (fFontSize > 0.0f) {
m_pEdit->SetAutoFontSize(false, true);
m_pEdit->SetFontSize(fFontSize);
diff --git a/fpdfsdk/pdfwindow/PWL_Edit.h b/fpdfsdk/pdfwindow/PWL_Edit.h
index b6d01300f0..5e1a36610d 100644
--- a/fpdfsdk/pdfwindow/PWL_Edit.h
+++ b/fpdfsdk/pdfwindow/PWL_Edit.h
@@ -21,12 +21,11 @@ class IFX_Edit_UndoItem;
class IPWL_Filler_Notify {
public:
virtual ~IPWL_Filler_Notify() {}
- virtual void QueryWherePopup(
- void* pPrivateData,
- FX_FLOAT fPopupMin,
- FX_FLOAT fPopupMax,
- int32_t& nRet,
- FX_FLOAT& fPopupRet) = 0; // nRet: (0:bottom 1:top)
+ virtual void QueryWherePopup(void* pPrivateData,
+ float fPopupMin,
+ float fPopupMax,
+ int32_t& nRet,
+ float& fPopupRet) = 0; // nRet: (0:bottom 1:top)
virtual void OnBeforeKeyStroke(void* pPrivateData,
CFX_WideString& strChange,
const CFX_WideString& strChangeEx,
@@ -78,7 +77,7 @@ class CPWL_Edit : public CPWL_EditCtrl {
void SetCharArray(int32_t nCharArray);
void SetLimitChar(int32_t nLimitChar);
- void SetCharSpace(FX_FLOAT fCharSpace);
+ void SetCharSpace(float fCharSpace);
bool CanSelectAll() const;
bool CanClear() const;
@@ -96,9 +95,9 @@ class CPWL_Edit : public CPWL_EditCtrl {
bool IsTextFull() const;
- static FX_FLOAT GetCharArrayAutoFontSize(CPDF_Font* pFont,
- const CFX_FloatRect& rcPlate,
- int32_t nCharArray);
+ static float GetCharArrayAutoFontSize(CPDF_Font* pFont,
+ const CFX_FloatRect& rcPlate,
+ int32_t nCharArray);
void SetFillerNotify(IPWL_Filler_Notify* pNotify) {
m_pFillerNotify = pNotify;
@@ -123,7 +122,7 @@ class CPWL_Edit : public CPWL_EditCtrl {
bool IsVScrollBarVisible() const;
void SetParamByFlag();
- FX_FLOAT GetCharArrayAutoFontSize(int32_t nCharArray);
+ float GetCharArrayAutoFontSize(int32_t nCharArray);
CFX_PointF GetWordRightBottomPoint(const CPVT_WordPlace& wpWord);
CPVT_WordRange CombineWordRange(const CPVT_WordRange& wr1,
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
index 4921ab7a08..e7371fd0e7 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.cpp
@@ -84,7 +84,7 @@ void CPWL_EditCtrl::OnNotify(CPWL_Wnd* pWnd,
}
break;
case PNM_SCROLLWINDOW: {
- FX_FLOAT fPos = *(FX_FLOAT*)lParam;
+ float fPos = *(float*)lParam;
switch (wParam) {
case SBT_VSCROLL:
m_pEdit->SetScrollPos(CFX_PointF(m_pEdit->GetScrollPos().x, fPos));
@@ -121,11 +121,11 @@ void CPWL_EditCtrl::CreateEditCaret(const PWL_CREATEPARAM& cp) {
m_pEditCaret->Create(ecp);
}
-void CPWL_EditCtrl::SetFontSize(FX_FLOAT fFontSize) {
+void CPWL_EditCtrl::SetFontSize(float fFontSize) {
m_pEdit->SetFontSize(fFontSize);
}
-FX_FLOAT CPWL_EditCtrl::GetFontSize() const {
+float CPWL_EditCtrl::GetFontSize() const {
return m_pEdit->GetFontSize();
}
@@ -427,8 +427,8 @@ CPDF_Font* CPWL_EditCtrl::GetCaretFont() const {
return nullptr;
}
-FX_FLOAT CPWL_EditCtrl::GetCaretFontSize() const {
- FX_FLOAT fFontSize = GetFontSize();
+float CPWL_EditCtrl::GetCaretFontSize() const {
+ float fFontSize = GetFontSize();
CFX_Edit_Iterator* pIterator = m_pEdit->GetIterator();
pIterator->SetAt(m_pEdit->GetCaret());
@@ -500,12 +500,12 @@ void CPWL_EditCtrl::Undo() {
m_pEdit->Undo();
}
-void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin,
- FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin,
- FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep,
- FX_FLOAT fBigStep) {
+void CPWL_EditCtrl::IOnSetScrollInfoY(float fPlateMin,
+ float fPlateMax,
+ float fContentMin,
+ float fContentMax,
+ float fSmallStep,
+ float fBigStep) {
PWL_SCROLL_INFO Info;
Info.fPlateWidth = fPlateMax - fPlateMin;
@@ -524,7 +524,7 @@ void CPWL_EditCtrl::IOnSetScrollInfoY(FX_FLOAT fPlateMin,
}
}
-void CPWL_EditCtrl::IOnSetScrollPosY(FX_FLOAT fy) {
+void CPWL_EditCtrl::IOnSetScrollPosY(float fy) {
OnNotify(this, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&fy);
}
diff --git a/fpdfsdk/pdfwindow/PWL_EditCtrl.h b/fpdfsdk/pdfwindow/PWL_EditCtrl.h
index 498570b3b0..6977673eac 100644
--- a/fpdfsdk/pdfwindow/PWL_EditCtrl.h
+++ b/fpdfsdk/pdfwindow/PWL_EditCtrl.h
@@ -62,7 +62,7 @@ class CPWL_EditCtrl : public CPWL_Wnd {
int32_t GetCodePage() const { return m_nCodePage; }
CPDF_Font* GetCaretFont() const;
- FX_FLOAT GetCaretFontSize() const;
+ float GetCaretFontSize() const;
bool CanUndo() const;
bool CanRedo() const;
@@ -85,17 +85,17 @@ class CPWL_EditCtrl : public CPWL_Wnd {
intptr_t lParam = 0) override;
void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
void RePosChildWnd() override;
- void SetFontSize(FX_FLOAT fFontSize) override;
- FX_FLOAT GetFontSize() const override;
+ void SetFontSize(float fFontSize) override;
+ float GetFontSize() const override;
void SetCursor() override;
- void IOnSetScrollInfoY(FX_FLOAT fPlateMin,
- FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin,
- FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep,
- FX_FLOAT fBigStep);
- void IOnSetScrollPosY(FX_FLOAT fy);
+ void IOnSetScrollInfoY(float fPlateMin,
+ float fPlateMax,
+ float fContentMin,
+ float fContentMax,
+ float fSmallStep,
+ float fBigStep);
+ void IOnSetScrollPosY(float fy);
void IOnSetCaret(bool bVisible,
const CFX_PointF& ptHead,
const CFX_PointF& ptFoot,
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.cpp b/fpdfsdk/pdfwindow/PWL_Icon.cpp
index 4ce63299e4..3ae7244552 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Icon.cpp
@@ -25,12 +25,12 @@ CFX_ByteString CPWL_Image::GetImageAppStream() {
CFX_Matrix mt;
mt.SetReverse(GetImageMatrix());
- FX_FLOAT fHScale = 1.0f;
- FX_FLOAT fVScale = 1.0f;
+ float fHScale = 1.0f;
+ float fVScale = 1.0f;
GetScale(fHScale, fVScale);
- FX_FLOAT fx = 0.0f;
- FX_FLOAT fy = 0.0f;
+ float fx = 0.0f;
+ float fy = 0.0f;
GetImageOffset(fx, fy);
if (m_pPDFStream && sAlias.GetLength() > 0) {
@@ -59,7 +59,7 @@ CPDF_Stream* CPWL_Image::GetPDFStream() {
return m_pPDFStream;
}
-void CPWL_Image::GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight) {
+void CPWL_Image::GetImageSize(float& fWidth, float& fHeight) {
fWidth = 0.0f;
fHeight = 0.0f;
@@ -100,12 +100,12 @@ void CPWL_Image::SetImageAlias(const char* sImageAlias) {
m_sImageAlias = sImageAlias;
}
-void CPWL_Image::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
+void CPWL_Image::GetScale(float& fHScale, float& fVScale) {
fHScale = 1.0f;
fVScale = 1.0f;
}
-void CPWL_Image::GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) {
+void CPWL_Image::GetImageOffset(float& x, float& y) {
x = 0.0f;
y = 0.0f;
}
@@ -132,7 +132,7 @@ bool CPWL_Icon::IsProportionalScale() {
return false;
}
-void CPWL_Icon::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) {
+void CPWL_Icon::GetIconPosition(float& fLeft, float& fBottom) {
if (m_pIconFit) {
fLeft = 0.0f;
fBottom = 0.0f;
@@ -152,13 +152,13 @@ void CPWL_Icon::GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom) {
}
}
-void CPWL_Icon::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
+void CPWL_Icon::GetScale(float& fHScale, float& fVScale) {
fHScale = 1.0f;
fVScale = 1.0f;
if (m_pPDFStream) {
- FX_FLOAT fImageWidth, fImageHeight;
- FX_FLOAT fPlateWidth, fPlateHeight;
+ float fImageWidth, fImageHeight;
+ float fPlateWidth, fPlateHeight;
CFX_FloatRect rcPlate = GetClientRect();
fPlateWidth = rcPlate.right - rcPlate.left;
@@ -190,7 +190,7 @@ void CPWL_Icon::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
break;
}
- FX_FLOAT fMinScale;
+ float fMinScale;
if (IsProportionalScale()) {
fMinScale = std::min(fHScale, fVScale);
fHScale = fMinScale;
@@ -199,23 +199,23 @@ void CPWL_Icon::GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) {
}
}
-void CPWL_Icon::GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) {
- FX_FLOAT fLeft, fBottom;
+void CPWL_Icon::GetImageOffset(float& x, float& y) {
+ float fLeft, fBottom;
GetIconPosition(fLeft, fBottom);
x = 0.0f;
y = 0.0f;
- FX_FLOAT fImageWidth, fImageHeight;
+ float fImageWidth, fImageHeight;
GetImageSize(fImageWidth, fImageHeight);
- FX_FLOAT fHScale, fVScale;
+ float fHScale, fVScale;
GetScale(fHScale, fVScale);
- FX_FLOAT fImageFactWidth = fImageWidth * fHScale;
- FX_FLOAT fImageFactHeight = fImageHeight * fVScale;
+ float fImageFactWidth = fImageWidth * fHScale;
+ float fImageFactHeight = fImageHeight * fVScale;
- FX_FLOAT fPlateWidth, fPlateHeight;
+ float fPlateWidth, fPlateHeight;
CFX_FloatRect rcPlate = GetClientRect();
fPlateWidth = rcPlate.right - rcPlate.left;
fPlateHeight = rcPlate.top - rcPlate.bottom;
diff --git a/fpdfsdk/pdfwindow/PWL_Icon.h b/fpdfsdk/pdfwindow/PWL_Icon.h
index bdcae9f7bd..49ac1f3f3d 100644
--- a/fpdfsdk/pdfwindow/PWL_Icon.h
+++ b/fpdfsdk/pdfwindow/PWL_Icon.h
@@ -17,13 +17,13 @@ class CPWL_Image : public CPWL_Wnd {
virtual CFX_ByteString GetImageAppStream();
- virtual void GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale);
- virtual void GetImageOffset(FX_FLOAT& x, FX_FLOAT& y);
+ virtual void GetScale(float& fHScale, float& fVScale);
+ virtual void GetImageOffset(float& x, float& y);
virtual CPDF_Stream* GetPDFStream();
public:
void SetPDFStream(CPDF_Stream* pStream);
- void GetImageSize(FX_FLOAT& fWidth, FX_FLOAT& fHeight);
+ void GetImageSize(float& fWidth, float& fHeight);
CFX_Matrix GetImageMatrix();
CFX_ByteString GetImageAlias();
void SetImageAlias(const char* sImageAlias);
@@ -41,12 +41,12 @@ class CPWL_Icon : public CPWL_Image {
virtual CPDF_IconFit* GetIconFit();
// CPWL_Image
- void GetScale(FX_FLOAT& fHScale, FX_FLOAT& fVScale) override;
- void GetImageOffset(FX_FLOAT& x, FX_FLOAT& y) override;
+ void GetScale(float& fHScale, float& fVScale) override;
+ void GetImageOffset(float& x, float& y) override;
int32_t GetScaleMethod();
bool IsProportionalScale();
- void GetIconPosition(FX_FLOAT& fLeft, FX_FLOAT& fBottom);
+ void GetIconPosition(float& fLeft, float& fBottom);
void SetIconFit(CPDF_IconFit* pIconFit) { m_pIconFit = pIconFit; }
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.cpp b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
index 18b45b5c3f..8448204a74 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.cpp
@@ -22,12 +22,12 @@ CPWL_List_Notify::CPWL_List_Notify(CPWL_ListBox* pList) : m_pList(pList) {
CPWL_List_Notify::~CPWL_List_Notify() {}
-void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin,
- FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin,
- FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep,
- FX_FLOAT fBigStep) {
+void CPWL_List_Notify::IOnSetScrollInfoY(float fPlateMin,
+ float fPlateMax,
+ float fContentMin,
+ float fContentMax,
+ float fSmallStep,
+ float fBigStep) {
PWL_SCROLL_INFO Info;
Info.fPlateWidth = fPlateMax - fPlateMin;
@@ -54,7 +54,7 @@ void CPWL_List_Notify::IOnSetScrollInfoY(FX_FLOAT fPlateMin,
}
}
-void CPWL_List_Notify::IOnSetScrollPosY(FX_FLOAT fy) {
+void CPWL_List_Notify::IOnSetScrollPosY(float fy) {
m_pList->OnNotify(m_pList, PNM_SETSCROLLPOS, SBT_VSCROLL, (intptr_t)&fy);
}
@@ -295,7 +295,7 @@ void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd,
intptr_t lParam) {
CPWL_Wnd::OnNotify(pWnd, msg, wParam, lParam);
- FX_FLOAT fPos;
+ float fPos;
switch (msg) {
case PNM_SETSCROLLINFO:
@@ -317,7 +317,7 @@ void CPWL_ListBox::OnNotify(CPWL_Wnd* pWnd,
}
break;
case PNM_SCROLLWINDOW:
- fPos = *(FX_FLOAT*)lParam;
+ fPos = *(float*)lParam;
switch (wParam) {
case SBT_VSCROLL:
m_pList->SetScrollPos(CFX_PointF(0, fPos));
@@ -371,11 +371,11 @@ CFX_WideString CPWL_ListBox::GetText() const {
return m_pList->GetText();
}
-void CPWL_ListBox::SetFontSize(FX_FLOAT fFontSize) {
+void CPWL_ListBox::SetFontSize(float fFontSize) {
m_pList->SetFontSize(fFontSize);
}
-FX_FLOAT CPWL_ListBox::GetFontSize() const {
+float CPWL_ListBox::GetFontSize() const {
return m_pList->GetFontSize();
}
@@ -436,13 +436,13 @@ CFX_FloatRect CPWL_ListBox::GetContentRect() const {
return m_pList->GetContentRect();
}
-FX_FLOAT CPWL_ListBox::GetFirstHeight() const {
+float CPWL_ListBox::GetFirstHeight() const {
return m_pList->GetFirstHeight();
}
CFX_FloatRect CPWL_ListBox::GetListRect() const {
return CPWL_Utils::DeflateRect(
- GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+ GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth()));
}
bool CPWL_ListBox::OnMouseWheel(short zDelta,
diff --git a/fpdfsdk/pdfwindow/PWL_ListBox.h b/fpdfsdk/pdfwindow/PWL_ListBox.h
index fa78b37bcb..9f8f464efb 100644
--- a/fpdfsdk/pdfwindow/PWL_ListBox.h
+++ b/fpdfsdk/pdfwindow/PWL_ListBox.h
@@ -25,13 +25,13 @@ class CPWL_List_Notify {
explicit CPWL_List_Notify(CPWL_ListBox* pList);
~CPWL_List_Notify();
- void IOnSetScrollInfoY(FX_FLOAT fPlateMin,
- FX_FLOAT fPlateMax,
- FX_FLOAT fContentMin,
- FX_FLOAT fContentMax,
- FX_FLOAT fSmallStep,
- FX_FLOAT fBigStep);
- void IOnSetScrollPosY(FX_FLOAT fy);
+ void IOnSetScrollInfoY(float fPlateMin,
+ float fPlateMax,
+ float fContentMin,
+ float fContentMax,
+ float fSmallStep,
+ float fBigStep);
+ void IOnSetScrollPosY(float fy);
void IOnInvalidateRect(CFX_FloatRect* pRect);
void IOnSetCaret(bool bVisible,
@@ -70,8 +70,8 @@ class CPWL_ListBox : public CPWL_Wnd {
intptr_t lParam = 0) override;
void RePosChildWnd() override;
CFX_FloatRect GetFocusRect() const override;
- void SetFontSize(FX_FLOAT fFontSize) override;
- FX_FLOAT GetFontSize() const override;
+ void SetFontSize(float fFontSize) override;
+ float GetFontSize() const override;
virtual CFX_WideString GetText() const;
@@ -94,7 +94,7 @@ class CPWL_ListBox : public CPWL_Wnd {
int32_t GetTopVisibleIndex() const;
int32_t FindNext(int32_t nIndex, wchar_t nChar) const;
CFX_FloatRect GetContentRect() const;
- FX_FLOAT GetFirstHeight() const;
+ float GetFirstHeight() const;
CFX_FloatRect GetListRect() const;
void SetFillerNotify(IPWL_Filler_Notify* pNotify) {
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
index e3799366a5..9289f44aa0 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.cpp
@@ -15,7 +15,7 @@ PWL_FLOATRANGE::PWL_FLOATRANGE() {
Default();
}
-PWL_FLOATRANGE::PWL_FLOATRANGE(FX_FLOAT min, FX_FLOAT max) {
+PWL_FLOATRANGE::PWL_FLOATRANGE(float min, float max) {
Set(min, max);
}
@@ -24,7 +24,7 @@ void PWL_FLOATRANGE::Default() {
fMax = 0;
}
-void PWL_FLOATRANGE::Set(FX_FLOAT min, FX_FLOAT max) {
+void PWL_FLOATRANGE::Set(float min, float max) {
if (min > max) {
fMin = max;
fMax = min;
@@ -34,12 +34,12 @@ void PWL_FLOATRANGE::Set(FX_FLOAT min, FX_FLOAT max) {
}
}
-bool PWL_FLOATRANGE::In(FX_FLOAT x) const {
+bool PWL_FLOATRANGE::In(float x) const {
return (IsFloatBigger(x, fMin) || IsFloatEqual(x, fMin)) &&
(IsFloatSmaller(x, fMax) || IsFloatEqual(x, fMax));
}
-FX_FLOAT PWL_FLOATRANGE::GetWidth() const {
+float PWL_FLOATRANGE::GetWidth() const {
return fMax - fMin;
}
@@ -55,7 +55,7 @@ void PWL_SCROLL_PRIVATEDATA::Default() {
fSmallStep = 1;
}
-void PWL_SCROLL_PRIVATEDATA::SetScrollRange(FX_FLOAT min, FX_FLOAT max) {
+void PWL_SCROLL_PRIVATEDATA::SetScrollRange(float min, float max) {
ScrollRange.Set(min, max);
if (IsFloatSmaller(fScrollPos, ScrollRange.fMin))
@@ -64,19 +64,19 @@ void PWL_SCROLL_PRIVATEDATA::SetScrollRange(FX_FLOAT min, FX_FLOAT max) {
fScrollPos = ScrollRange.fMax;
}
-void PWL_SCROLL_PRIVATEDATA::SetClientWidth(FX_FLOAT width) {
+void PWL_SCROLL_PRIVATEDATA::SetClientWidth(float width) {
fClientWidth = width;
}
-void PWL_SCROLL_PRIVATEDATA::SetSmallStep(FX_FLOAT step) {
+void PWL_SCROLL_PRIVATEDATA::SetSmallStep(float step) {
fSmallStep = step;
}
-void PWL_SCROLL_PRIVATEDATA::SetBigStep(FX_FLOAT step) {
+void PWL_SCROLL_PRIVATEDATA::SetBigStep(float step) {
fBigStep = step;
}
-bool PWL_SCROLL_PRIVATEDATA::SetPos(FX_FLOAT pos) {
+bool PWL_SCROLL_PRIVATEDATA::SetPos(float pos) {
if (ScrollRange.In(pos)) {
fScrollPos = pos;
return true;
@@ -320,8 +320,8 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
// draw arrow
if (rectWnd.top - rectWnd.bottom > 6.0f) {
- FX_FLOAT fX = rectWnd.left + 1.5f;
- FX_FLOAT fY = rectWnd.bottom;
+ float fX = rectWnd.left + 1.5f;
+ float fY = rectWnd.bottom;
CFX_PointF pts[7] = {CFX_PointF(fX + 2.5f, fY + 4.0f),
CFX_PointF(fX + 2.5f, fY + 3.0f),
CFX_PointF(fX + 4.5f, fY + 5.0f),
@@ -365,8 +365,8 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
// draw arrow
if (rectWnd.top - rectWnd.bottom > 6.0f) {
- FX_FLOAT fX = rectWnd.left + 1.5f;
- FX_FLOAT fY = rectWnd.bottom;
+ float fX = rectWnd.left + 1.5f;
+ float fY = rectWnd.bottom;
CFX_PointF pts[7] = {CFX_PointF(fX + 2.5f, fY + 5.0f),
CFX_PointF(fX + 2.5f, fY + 6.0f),
@@ -487,8 +487,8 @@ void CPWL_SBButton::DrawThisAppearance(CFX_RenderDevice* pDevice,
if (!IsEnabled())
crStroke = PWL_DEFAULT_HEAVYGRAYCOLOR.ToFXColor(255);
- FX_FLOAT nFrictionWidth = 5.0f;
- FX_FLOAT nFrictionHeight = 5.5f;
+ float nFrictionWidth = 5.0f;
+ float nFrictionHeight = 5.5f;
CFX_PointF ptLeft =
CFX_PointF(ptCenter.x - nFrictionWidth / 2.0f,
@@ -578,7 +578,7 @@ void CPWL_ScrollBar::OnCreate(PWL_CREATEPARAM& cp) {
void CPWL_ScrollBar::RePosChildWnd() {
CFX_FloatRect rcClient = GetClientRect();
CFX_FloatRect rcMinButton, rcMaxButton;
- FX_FLOAT fBWidth = 0;
+ float fBWidth = 0;
switch (m_sbType) {
case SBT_HSCROLL:
@@ -802,7 +802,7 @@ void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd,
PWL_SCROLL_INFO* pInfo = reinterpret_cast<PWL_SCROLL_INFO*>(lParam);
if (pInfo && *pInfo != m_OriginInfo) {
m_OriginInfo = *pInfo;
- FX_FLOAT fMax =
+ float fMax =
pInfo->fContentMax - pInfo->fContentMin - pInfo->fPlateWidth;
fMax = fMax > 0.0f ? fMax : 0.0f;
SetScrollRange(0, fMax, pInfo->fPlateWidth);
@@ -810,7 +810,7 @@ void CPWL_ScrollBar::OnNotify(CPWL_Wnd* pWnd,
}
} break;
case PNM_SETSCROLLPOS: {
- FX_FLOAT fPos = *(FX_FLOAT*)lParam;
+ float fPos = *(float*)lParam;
switch (m_sbType) {
case SBT_HSCROLL:
fPos = fPos - m_OriginInfo.fContentMin;
@@ -850,16 +850,16 @@ void CPWL_ScrollBar::CreateButtons(const PWL_CREATEPARAM& cp) {
}
}
-FX_FLOAT CPWL_ScrollBar::GetScrollBarWidth() const {
+float CPWL_ScrollBar::GetScrollBarWidth() const {
if (!IsVisible())
return 0;
return PWL_SCROLLBAR_WIDTH;
}
-void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,
- FX_FLOAT fMax,
- FX_FLOAT fClientWidth) {
+void CPWL_ScrollBar::SetScrollRange(float fMin,
+ float fMax,
+ float fClientWidth) {
if (m_pPosButton) {
m_sData.SetScrollRange(fMin, fMax);
m_sData.SetClientWidth(fClientWidth);
@@ -873,8 +873,8 @@ void CPWL_ScrollBar::SetScrollRange(FX_FLOAT fMin,
}
}
-void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos) {
- FX_FLOAT fOldPos = m_sData.fScrollPos;
+void CPWL_ScrollBar::SetScrollPos(float fPos) {
+ float fOldPos = m_sData.fScrollPos;
m_sData.SetPos(fPos);
@@ -882,7 +882,7 @@ void CPWL_ScrollBar::SetScrollPos(FX_FLOAT fPos) {
MovePosButton(true);
}
-void CPWL_ScrollBar::SetScrollStep(FX_FLOAT fBigStep, FX_FLOAT fSmallStep) {
+void CPWL_ScrollBar::SetScrollStep(float fBigStep, float fSmallStep) {
m_sData.SetBigStep(fBigStep);
m_sData.SetSmallStep(fSmallStep);
}
@@ -898,7 +898,7 @@ void CPWL_ScrollBar::MovePosButton(bool bRefresh) {
rcClient = GetClientRect();
rcPosArea = GetScrollArea();
- FX_FLOAT fLeft, fRight, fTop, fBottom;
+ float fLeft, fRight, fTop, fBottom;
switch (m_sbType) {
case SBT_HSCROLL:
@@ -997,9 +997,9 @@ void CPWL_ScrollBar::OnPosButtonLBUp(const CFX_PointF& point) {
}
void CPWL_ScrollBar::OnPosButtonMouseMove(const CFX_PointF& point) {
- FX_FLOAT fOldScrollPos = m_sData.fScrollPos;
+ float fOldScrollPos = m_sData.fScrollPos;
- FX_FLOAT fNewPos = 0;
+ float fNewPos = 0;
switch (m_sbType) {
case SBT_HSCROLL:
@@ -1055,7 +1055,7 @@ void CPWL_ScrollBar::OnPosButtonMouseMove(const CFX_PointF& point) {
void CPWL_ScrollBar::NotifyScrollWindow() {
if (CPWL_Wnd* pParent = GetParentWindow()) {
- FX_FLOAT fPos;
+ float fPos;
switch (m_sbType) {
case SBT_HSCROLL:
fPos = m_OriginInfo.fContentMin + m_sData.fScrollPos;
@@ -1079,10 +1079,10 @@ CFX_FloatRect CPWL_ScrollBar::GetScrollArea() const {
CFX_FloatRect rcMin = m_pMinButton->GetWindowRect();
CFX_FloatRect rcMax = m_pMaxButton->GetWindowRect();
- FX_FLOAT fMinWidth = rcMin.right - rcMin.left;
- FX_FLOAT fMinHeight = rcMin.top - rcMin.bottom;
- FX_FLOAT fMaxWidth = rcMax.right - rcMax.left;
- FX_FLOAT fMaxHeight = rcMax.top - rcMax.bottom;
+ float fMinWidth = rcMin.right - rcMin.left;
+ float fMinHeight = rcMin.top - rcMin.bottom;
+ float fMaxWidth = rcMax.right - rcMax.left;
+ float fMaxHeight = rcMax.top - rcMax.bottom;
switch (m_sbType) {
case SBT_HSCROLL:
@@ -1111,14 +1111,14 @@ CFX_FloatRect CPWL_ScrollBar::GetScrollArea() const {
return rcArea;
}
-FX_FLOAT CPWL_ScrollBar::TrueToFace(FX_FLOAT fTrue) {
+float CPWL_ScrollBar::TrueToFace(float fTrue) {
CFX_FloatRect rcPosArea;
rcPosArea = GetScrollArea();
- FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
+ float fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
- FX_FLOAT fFace = 0;
+ float fFace = 0;
switch (m_sbType) {
case SBT_HSCROLL:
@@ -1134,14 +1134,14 @@ FX_FLOAT CPWL_ScrollBar::TrueToFace(FX_FLOAT fTrue) {
return fFace;
}
-FX_FLOAT CPWL_ScrollBar::FaceToTrue(FX_FLOAT fFace) {
+float CPWL_ScrollBar::FaceToTrue(float fFace) {
CFX_FloatRect rcPosArea;
rcPosArea = GetScrollArea();
- FX_FLOAT fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
+ float fFactWidth = m_sData.ScrollRange.GetWidth() + m_sData.fClientWidth;
fFactWidth = fFactWidth == 0 ? 1 : fFactWidth;
- FX_FLOAT fTrue = 0;
+ float fTrue = 0;
switch (m_sbType) {
case SBT_HSCROLL:
diff --git a/fpdfsdk/pdfwindow/PWL_ScrollBar.h b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
index 9546a9e577..50b0801ca3 100644
--- a/fpdfsdk/pdfwindow/PWL_ScrollBar.h
+++ b/fpdfsdk/pdfwindow/PWL_ScrollBar.h
@@ -30,11 +30,11 @@ struct PWL_SCROLL_INFO {
return !(*this == that);
}
- FX_FLOAT fContentMin;
- FX_FLOAT fContentMax;
- FX_FLOAT fPlateWidth;
- FX_FLOAT fBigStep;
- FX_FLOAT fSmallStep;
+ float fContentMin;
+ float fContentMax;
+ float fPlateWidth;
+ float fBigStep;
+ float fSmallStep;
};
enum PWL_SCROLLBAR_TYPE { SBT_HSCROLL, SBT_VSCROLL };
@@ -67,7 +67,7 @@ class CPWL_SBButton : public CPWL_Wnd {
struct PWL_FLOATRANGE {
public:
PWL_FLOATRANGE();
- PWL_FLOATRANGE(FX_FLOAT min, FX_FLOAT max);
+ PWL_FLOATRANGE(float min, float max);
bool operator==(const PWL_FLOATRANGE& that) const {
return fMin == that.fMin && fMax == that.fMax;
@@ -75,12 +75,12 @@ struct PWL_FLOATRANGE {
bool operator!=(const PWL_FLOATRANGE& that) const { return !(*this == that); }
void Default();
- void Set(FX_FLOAT min, FX_FLOAT max);
- bool In(FX_FLOAT x) const;
- FX_FLOAT GetWidth() const;
+ void Set(float min, float max);
+ bool In(float x) const;
+ float GetWidth() const;
- FX_FLOAT fMin;
- FX_FLOAT fMax;
+ float fMin;
+ float fMax;
};
struct PWL_SCROLL_PRIVATEDATA {
@@ -97,11 +97,11 @@ struct PWL_SCROLL_PRIVATEDATA {
}
void Default();
- void SetScrollRange(FX_FLOAT min, FX_FLOAT max);
- void SetClientWidth(FX_FLOAT width);
- void SetSmallStep(FX_FLOAT step);
- void SetBigStep(FX_FLOAT step);
- bool SetPos(FX_FLOAT pos);
+ void SetScrollRange(float min, float max);
+ void SetClientWidth(float width);
+ void SetSmallStep(float step);
+ void SetBigStep(float step);
+ bool SetPos(float pos);
void AddSmall();
void SubSmall();
@@ -109,10 +109,10 @@ struct PWL_SCROLL_PRIVATEDATA {
void SubBig();
PWL_FLOATRANGE ScrollRange;
- FX_FLOAT fClientWidth;
- FX_FLOAT fScrollPos;
- FX_FLOAT fBigStep;
- FX_FLOAT fSmallStep;
+ float fClientWidth;
+ float fScrollPos;
+ float fBigStep;
+ float fSmallStep;
};
class CPWL_ScrollBar : public CPWL_Wnd {
@@ -136,16 +136,16 @@ class CPWL_ScrollBar : public CPWL_Wnd {
void CreateChildWnd(const PWL_CREATEPARAM& cp) override;
void TimerProc() override;
- FX_FLOAT GetScrollBarWidth() const;
+ float GetScrollBarWidth() const;
PWL_SCROLLBAR_TYPE GetScrollBarType() const { return m_sbType; }
void SetNotifyForever(bool bForever) { m_bNotifyForever = bForever; }
protected:
- void SetScrollRange(FX_FLOAT fMin, FX_FLOAT fMax, FX_FLOAT fClientWidth);
- void SetScrollPos(FX_FLOAT fPos);
+ void SetScrollRange(float fMin, float fMax, float fClientWidth);
+ void SetScrollPos(float fPos);
void MovePosButton(bool bRefresh);
- void SetScrollStep(FX_FLOAT fBigStep, FX_FLOAT fSmallStep);
+ void SetScrollStep(float fBigStep, float fSmallStep);
void NotifyScrollWindow();
CFX_FloatRect GetScrollArea() const;
@@ -164,8 +164,8 @@ class CPWL_ScrollBar : public CPWL_Wnd {
void OnPosButtonLBUp(const CFX_PointF& point);
void OnPosButtonMouseMove(const CFX_PointF& point);
- FX_FLOAT TrueToFace(FX_FLOAT);
- FX_FLOAT FaceToTrue(FX_FLOAT);
+ float TrueToFace(float);
+ float FaceToTrue(float);
PWL_SCROLLBAR_TYPE m_sbType;
PWL_SCROLL_INFO m_OriginInfo;
@@ -176,8 +176,8 @@ class CPWL_ScrollBar : public CPWL_Wnd {
bool m_bMouseDown;
bool m_bMinOrMax;
bool m_bNotifyForever;
- FX_FLOAT m_nOldPos;
- FX_FLOAT m_fOldPosButton;
+ float m_nOldPos;
+ float m_fOldPosButton;
};
#endif // FPDFSDK_PDFWINDOW_PWL_SCROLLBAR_H_
diff --git a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
index 1c46c375a9..d2a13219d2 100644
--- a/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
+++ b/fpdfsdk/pdfwindow/PWL_SpecialButton.cpp
@@ -18,7 +18,7 @@ CFX_ByteString CPWL_PushButton::GetClassName() const {
}
CFX_FloatRect CPWL_PushButton::GetFocusRect() const {
- return CPWL_Utils::DeflateRect(GetWindowRect(), (FX_FLOAT)GetBorderWidth());
+ return CPWL_Utils::DeflateRect(GetWindowRect(), (float)GetBorderWidth());
}
CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false) {}
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.cpp b/fpdfsdk/pdfwindow/PWL_Utils.cpp
index 45668b6a25..f78b590150 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Utils.cpp
@@ -18,8 +18,8 @@
#include "fpdfsdk/pdfwindow/PWL_Wnd.h"
CFX_FloatRect CPWL_Utils::OffsetRect(const CFX_FloatRect& rect,
- FX_FLOAT x,
- FX_FLOAT y) {
+ float x,
+ float y) {
return CFX_FloatRect(rect.left + x, rect.bottom + y, rect.right + x,
rect.top + y);
}
@@ -51,8 +51,8 @@ CPVT_WordRange CPWL_Utils::OverlapWordRange(const CPVT_WordRange& wr1,
}
CFX_ByteString CPWL_Utils::GetAP_Check(const CFX_FloatRect& crBBox) {
- const FX_FLOAT fWidth = crBBox.right - crBBox.left;
- const FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+ const float fWidth = crBBox.right - crBBox.left;
+ const float fHeight = crBBox.top - crBBox.bottom;
CFX_PointF pts[8][3] = {{CFX_PointF(0.28f, 0.52f), CFX_PointF(0.27f, 0.48f),
CFX_PointF(0.29f, 0.40f)},
@@ -84,10 +84,10 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CFX_FloatRect& crBBox) {
for (size_t i = 0; i < FX_ArraySize(pts); ++i) {
size_t nNext = i < FX_ArraySize(pts) - 1 ? i + 1 : 0;
- FX_FLOAT px1 = pts[i][1].x - pts[i][0].x;
- FX_FLOAT py1 = pts[i][1].y - pts[i][0].y;
- FX_FLOAT px2 = pts[i][2].x - pts[nNext][0].x;
- FX_FLOAT py2 = pts[i][2].y - pts[nNext][0].y;
+ float px1 = pts[i][1].x - pts[i][0].x;
+ float py1 = pts[i][1].y - pts[i][0].y;
+ float px2 = pts[i][2].x - pts[nNext][0].x;
+ float py2 = pts[i][2].y - pts[nNext][0].y;
csAP << pts[i][0].x + px1 * FX_BEZIER << " "
<< pts[i][0].y + py1 * FX_BEZIER << " "
@@ -102,8 +102,8 @@ CFX_ByteString CPWL_Utils::GetAP_Check(const CFX_FloatRect& crBBox) {
CFX_ByteString CPWL_Utils::GetAP_Circle(const CFX_FloatRect& crBBox) {
CFX_ByteTextBuf csAP;
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+ float fWidth = crBBox.right - crBBox.left;
+ float fHeight = crBBox.top - crBBox.bottom;
CFX_PointF pt1(crBBox.left, crBBox.bottom + fHeight / 2);
CFX_PointF pt2(crBBox.left + fWidth / 2, crBBox.top);
@@ -112,8 +112,8 @@ CFX_ByteString CPWL_Utils::GetAP_Circle(const CFX_FloatRect& crBBox) {
csAP << pt1.x << " " << pt1.y << " m\n";
- FX_FLOAT px = pt2.x - pt1.x;
- FX_FLOAT py = pt2.y - pt1.y;
+ float px = pt2.x - pt1.x;
+ float py = pt2.y - pt1.y;
csAP << pt1.x << " " << pt1.y + py * FX_BEZIER << " "
<< pt2.x - px * FX_BEZIER << " " << pt2.y << " " << pt2.x << " " << pt2.y
@@ -155,8 +155,8 @@ CFX_ByteString CPWL_Utils::GetAP_Cross(const CFX_FloatRect& crBBox) {
CFX_ByteString CPWL_Utils::GetAP_Diamond(const CFX_FloatRect& crBBox) {
CFX_ByteTextBuf csAP;
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+ float fWidth = crBBox.right - crBBox.left;
+ float fHeight = crBBox.top - crBBox.bottom;
CFX_PointF pt1(crBBox.left, crBBox.bottom + fHeight / 2);
CFX_PointF pt2(crBBox.left + fWidth / 2, crBBox.top);
@@ -187,18 +187,17 @@ CFX_ByteString CPWL_Utils::GetAP_Square(const CFX_FloatRect& crBBox) {
CFX_ByteString CPWL_Utils::GetAP_Star(const CFX_FloatRect& crBBox) {
CFX_ByteTextBuf csAP;
- FX_FLOAT fRadius =
- (crBBox.top - crBBox.bottom) / (1 + (FX_FLOAT)cos(FX_PI / 5.0f));
+ float fRadius = (crBBox.top - crBBox.bottom) / (1 + (float)cos(FX_PI / 5.0f));
CFX_PointF ptCenter = CFX_PointF((crBBox.left + crBBox.right) / 2.0f,
(crBBox.top + crBBox.bottom) / 2.0f);
- FX_FLOAT px[5], py[5];
+ float px[5], py[5];
- FX_FLOAT fAngel = FX_PI / 10.0f;
+ float fAngel = FX_PI / 10.0f;
for (int32_t i = 0; i < 5; i++) {
- px[i] = ptCenter.x + fRadius * (FX_FLOAT)cos(fAngel);
- py[i] = ptCenter.y + fRadius * (FX_FLOAT)sin(fAngel);
+ px[i] = ptCenter.x + fRadius * (float)cos(fAngel);
+ py[i] = ptCenter.y + fRadius * (float)sin(fAngel);
fAngel += FX_PI * 2 / 5.0f;
}
@@ -217,17 +216,17 @@ CFX_ByteString CPWL_Utils::GetAP_Star(const CFX_FloatRect& crBBox) {
}
CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CFX_FloatRect& crBBox,
- FX_FLOAT fRotate) {
+ float fRotate) {
CFX_ByteTextBuf csAP;
- FX_FLOAT fWidth = crBBox.right - crBBox.left;
- FX_FLOAT fHeight = crBBox.top - crBBox.bottom;
+ float fWidth = crBBox.right - crBBox.left;
+ float fHeight = crBBox.top - crBBox.bottom;
CFX_PointF pt1(-fWidth / 2, 0);
CFX_PointF pt2(0, fHeight / 2);
CFX_PointF pt3(fWidth / 2, 0);
- FX_FLOAT px, py;
+ float px, py;
csAP << cos(fRotate) << " " << sin(fRotate) << " " << -sin(fRotate) << " "
<< cos(fRotate) << " " << crBBox.left + fWidth / 2 << " "
@@ -252,7 +251,7 @@ CFX_ByteString CPWL_Utils::GetAP_HalfCircle(const CFX_FloatRect& crBBox,
}
CFX_FloatRect CPWL_Utils::InflateRect(const CFX_FloatRect& rcRect,
- FX_FLOAT fSize) {
+ float fSize) {
if (rcRect.IsEmpty())
return rcRect;
@@ -263,7 +262,7 @@ CFX_FloatRect CPWL_Utils::InflateRect(const CFX_FloatRect& rcRect,
}
CFX_FloatRect CPWL_Utils::DeflateRect(const CFX_FloatRect& rcRect,
- FX_FLOAT fSize) {
+ float fSize) {
if (rcRect.IsEmpty())
return rcRect;
@@ -273,10 +272,9 @@ CFX_FloatRect CPWL_Utils::DeflateRect(const CFX_FloatRect& rcRect,
return rcNew;
}
-CFX_FloatRect CPWL_Utils::ScaleRect(const CFX_FloatRect& rcRect,
- FX_FLOAT fScale) {
- FX_FLOAT fHalfWidth = (rcRect.right - rcRect.left) / 2.0f;
- FX_FLOAT fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f;
+CFX_FloatRect CPWL_Utils::ScaleRect(const CFX_FloatRect& rcRect, float fScale) {
+ float fHalfWidth = (rcRect.right - rcRect.left) / 2.0f;
+ float fHalfHeight = (rcRect.top - rcRect.bottom) / 2.0f;
CFX_PointF ptCenter = CFX_PointF((rcRect.left + rcRect.right) / 2,
(rcRect.top + rcRect.bottom) / 2);
@@ -311,13 +309,13 @@ CFX_ByteString CPWL_Utils::GetCircleFillAppStream(const CFX_FloatRect& rect,
}
CFX_FloatRect CPWL_Utils::GetCenterSquare(const CFX_FloatRect& rect) {
- FX_FLOAT fWidth = rect.right - rect.left;
- FX_FLOAT fHeight = rect.top - rect.bottom;
+ float fWidth = rect.right - rect.left;
+ float fHeight = rect.top - rect.bottom;
- FX_FLOAT fCenterX = (rect.left + rect.right) / 2.0f;
- FX_FLOAT fCenterY = (rect.top + rect.bottom) / 2.0f;
+ float fCenterX = (rect.left + rect.right) / 2.0f;
+ float fCenterY = (rect.top + rect.bottom) / 2.0f;
- FX_FLOAT fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2;
+ float fRadius = (fWidth > fHeight) ? fHeight / 2 : fWidth / 2;
return CFX_FloatRect(fCenterX - fRadius, fCenterY - fRadius,
fCenterX + fRadius, fCenterY + fRadius);
@@ -344,9 +342,9 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
CPDF_IconFit& IconFit,
const CFX_WideString& sLabel,
const CPWL_Color& crText,
- FX_FLOAT fFontSize,
+ float fFontSize,
int32_t nLayOut) {
- const FX_FLOAT fAutoFontScale = 1.0f / 3.0f;
+ const float fAutoFontScale = 1.0f / 3.0f;
std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
pEdit->SetFontMap(pFontMap);
@@ -372,8 +370,8 @@ CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
CFX_FloatRect rcLabel = CFX_FloatRect(0, 0, 0, 0);
CFX_FloatRect rcIcon = CFX_FloatRect(0, 0, 0, 0);
- FX_FLOAT fWidth = 0.0f;
- FX_FLOAT fHeight = 0.0f;
+ float fWidth = 0.0f;
+ float fHeight = 0.0f;
switch (nLayOut) {
case PPBL_LABEL:
@@ -585,7 +583,7 @@ CFX_ByteString CPWL_Utils::GetColorAppStream(const CPWL_Color& color,
}
CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect,
- FX_FLOAT fWidth,
+ float fWidth,
const CPWL_Color& color,
const CPWL_Color& crLeftTop,
const CPWL_Color& crRightBottom,
@@ -594,13 +592,13 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect,
CFX_ByteTextBuf sAppStream;
CFX_ByteString sColor;
- FX_FLOAT fLeft = rect.left;
- FX_FLOAT fRight = rect.right;
- FX_FLOAT fTop = rect.top;
- FX_FLOAT fBottom = rect.bottom;
+ float fLeft = rect.left;
+ float fRight = rect.right;
+ float fTop = rect.top;
+ float fBottom = rect.bottom;
if (fWidth > 0.0f) {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
+ float fHalfWidth = fWidth / 2.0f;
sAppStream << "q\n";
@@ -702,7 +700,7 @@ CFX_ByteString CPWL_Utils::GetBorderAppStream(const CFX_FloatRect& rect,
CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(
const CFX_FloatRect& rect,
- FX_FLOAT fWidth,
+ float fWidth,
const CPWL_Color& color,
const CPWL_Color& crLeftTop,
const CPWL_Color& crRightBottom,
@@ -738,7 +736,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(
}
} break;
case BorderStyle::BEVELED: {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
+ float fHalfWidth = fWidth / 2.0f;
sColor = CPWL_Utils::GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
@@ -765,7 +763,7 @@ CFX_ByteString CPWL_Utils::GetCircleBorderAppStream(
}
} break;
case BorderStyle::INSET: {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
+ float fHalfWidth = fWidth / 2.0f;
sColor = CPWL_Utils::GetColorAppStream(color, false);
if (sColor.GetLength() > 0) {
@@ -961,7 +959,7 @@ void CPWL_Utils::DrawStrokeRect(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
const CFX_FloatRect& rect,
const FX_COLORREF& color,
- FX_FLOAT fWidth) {
+ float fWidth) {
CFX_PathData path;
CFX_FloatRect rcTemp(rect);
path.AppendRect(rcTemp.left, rcTemp.bottom, rcTemp.right, rcTemp.top);
@@ -977,7 +975,7 @@ void CPWL_Utils::DrawStrokeLine(CFX_RenderDevice* pDevice,
const CFX_PointF& ptMoveTo,
const CFX_PointF& ptLineTo,
const FX_COLORREF& color,
- FX_FLOAT fWidth) {
+ float fWidth) {
CFX_PathData path;
path.AppendPoint(ptMoveTo, FXPT_TYPE::MoveTo, false);
path.AppendPoint(ptLineTo, FXPT_TYPE::LineTo, false);
@@ -1005,12 +1003,12 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice,
int32_t nTransparency,
int32_t nStartGray,
int32_t nEndGray) {
- FX_FLOAT fStepGray = 1.0f;
+ float fStepGray = 1.0f;
if (bVertical) {
fStepGray = (nEndGray - nStartGray) / rect.Height();
- for (FX_FLOAT fy = rect.bottom + 0.5f; fy <= rect.top - 0.5f; fy += 1.0f) {
+ for (float fy = rect.bottom + 0.5f; fy <= rect.top - 0.5f; fy += 1.0f) {
int32_t nGray = nStartGray + (int32_t)(fStepGray * (fy - rect.bottom));
CPWL_Utils::DrawStrokeLine(
pDevice, pUser2Device, CFX_PointF(rect.left, fy),
@@ -1022,7 +1020,7 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice,
if (bHorizontal) {
fStepGray = (nEndGray - nStartGray) / rect.Width();
- for (FX_FLOAT fx = rect.left + 0.5f; fx <= rect.right - 0.5f; fx += 1.0f) {
+ for (float fx = rect.left + 0.5f; fx <= rect.right - 0.5f; fx += 1.0f) {
int32_t nGray = nStartGray + (int32_t)(fStepGray * (fx - rect.left));
CPWL_Utils::DrawStrokeLine(
pDevice, pUser2Device, CFX_PointF(fx, rect.bottom),
@@ -1035,19 +1033,19 @@ void CPWL_Utils::DrawShadow(CFX_RenderDevice* pDevice,
void CPWL_Utils::DrawBorder(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
const CFX_FloatRect& rect,
- FX_FLOAT fWidth,
+ float fWidth,
const CPWL_Color& color,
const CPWL_Color& crLeftTop,
const CPWL_Color& crRightBottom,
BorderStyle nStyle,
int32_t nTransparency) {
- FX_FLOAT fLeft = rect.left;
- FX_FLOAT fRight = rect.right;
- FX_FLOAT fTop = rect.top;
- FX_FLOAT fBottom = rect.bottom;
+ float fLeft = rect.left;
+ float fRight = rect.right;
+ float fTop = rect.top;
+ float fBottom = rect.bottom;
if (fWidth > 0.0f) {
- FX_FLOAT fHalfWidth = fWidth / 2.0f;
+ float fHalfWidth = fWidth / 2.0f;
switch (nStyle) {
default:
diff --git a/fpdfsdk/pdfwindow/PWL_Utils.h b/fpdfsdk/pdfwindow/PWL_Utils.h
index a4ecc19ee5..29fe239635 100644
--- a/fpdfsdk/pdfwindow/PWL_Utils.h
+++ b/fpdfsdk/pdfwindow/PWL_Utils.h
@@ -35,21 +35,19 @@ struct CPWL_Color;
class CPWL_Utils {
public:
- static CFX_FloatRect InflateRect(const CFX_FloatRect& rcRect, FX_FLOAT fSize);
- static CFX_FloatRect DeflateRect(const CFX_FloatRect& rcRect, FX_FLOAT fSize);
+ static CFX_FloatRect InflateRect(const CFX_FloatRect& rcRect, float fSize);
+ static CFX_FloatRect DeflateRect(const CFX_FloatRect& rcRect, float fSize);
static CPVT_WordRange OverlapWordRange(const CPVT_WordRange& wr1,
const CPVT_WordRange& wr2);
static CFX_FloatRect GetCenterSquare(const CFX_FloatRect& rect);
- static CFX_FloatRect OffsetRect(const CFX_FloatRect& rect,
- FX_FLOAT x,
- FX_FLOAT y);
+ static CFX_FloatRect OffsetRect(const CFX_FloatRect& rect, float x, float y);
static CFX_ByteString GetColorAppStream(const CPWL_Color& color,
const bool& bFillOrStroke = true);
static CFX_ByteString GetBorderAppStream(const CFX_FloatRect& rect,
- FX_FLOAT fWidth,
+ float fWidth,
const CPWL_Color& color,
const CPWL_Color& crLeftTop,
const CPWL_Color& crRightBottom,
@@ -57,7 +55,7 @@ class CPWL_Utils {
const CPWL_Dash& dash);
static CFX_ByteString GetCircleBorderAppStream(
const CFX_FloatRect& rect,
- FX_FLOAT fWidth,
+ float fWidth,
const CPWL_Color& color,
const CPWL_Color& crLeftTop,
const CPWL_Color& crRightBottom,
@@ -73,7 +71,7 @@ class CPWL_Utils {
CPDF_IconFit& IconFit,
const CFX_WideString& sLabel,
const CPWL_Color& crText,
- FX_FLOAT fFontSize,
+ float fFontSize,
int32_t nLayOut);
static CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox,
int32_t nStyle,
@@ -105,17 +103,17 @@ class CPWL_Utils {
CFX_Matrix* pUser2Device,
const CFX_FloatRect& rect,
const FX_COLORREF& color,
- FX_FLOAT fWidth);
+ float fWidth);
static void DrawStrokeLine(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
const CFX_PointF& ptMoveTo,
const CFX_PointF& ptLineTo,
const FX_COLORREF& color,
- FX_FLOAT fWidth);
+ float fWidth);
static void DrawBorder(CFX_RenderDevice* pDevice,
CFX_Matrix* pUser2Device,
const CFX_FloatRect& rect,
- FX_FLOAT fWidth,
+ float fWidth,
const CPWL_Color& color,
const CPWL_Color& crLeftTop,
const CPWL_Color& crRightBottom,
@@ -136,7 +134,7 @@ class CPWL_Utils {
int32_t nEndGray);
private:
- static CFX_FloatRect ScaleRect(const CFX_FloatRect& rcRect, FX_FLOAT fScale);
+ static CFX_FloatRect ScaleRect(const CFX_FloatRect& rcRect, float fScale);
static CFX_ByteString GetAppStream_Check(const CFX_FloatRect& rcBBox,
const CPWL_Color& crText);
@@ -158,7 +156,7 @@ class CPWL_Utils {
static CFX_ByteString GetAP_Square(const CFX_FloatRect& crBBox);
static CFX_ByteString GetAP_Star(const CFX_FloatRect& crBBox);
static CFX_ByteString GetAP_HalfCircle(const CFX_FloatRect& crBBox,
- FX_FLOAT fRotate);
+ float fRotate);
};
#endif // FPDFSDK_PDFWINDOW_PWL_UTILS_H_
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.cpp b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
index dc307a1be3..075b74651b 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.cpp
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.cpp
@@ -319,7 +319,7 @@ void CPWL_Wnd::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
if (HasFlag(PWS_BORDER)) {
sThis << CPWL_Utils::GetBorderAppStream(
- rectWnd, (FX_FLOAT)GetBorderWidth(), GetBorderColor(),
+ rectWnd, (float)GetBorderWidth(), GetBorderColor(),
GetBorderLeftTopColor(GetBorderStyle()),
GetBorderRightBottomColor(GetBorderStyle()), GetBorderStyle(),
GetBorderDash());
@@ -350,14 +350,14 @@ void CPWL_Wnd::DrawThisAppearance(CFX_RenderDevice* pDevice,
if (!rectWnd.IsEmpty()) {
if (HasFlag(PWS_BACKGROUND)) {
CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(
- rectWnd, (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+ rectWnd, (float)(GetBorderWidth() + GetInnerBorderWidth()));
CPWL_Utils::DrawFillRect(pDevice, pUser2Device, rcClient,
GetBackgroundColor(), GetTransparency());
}
if (HasFlag(PWS_BORDER))
CPWL_Utils::DrawBorder(pDevice, pUser2Device, rectWnd,
- (FX_FLOAT)GetBorderWidth(), GetBorderColor(),
+ (float)GetBorderWidth(), GetBorderColor(),
GetBorderLeftTopColor(GetBorderStyle()),
GetBorderRightBottomColor(GetBorderStyle()),
GetBorderStyle(), GetTransparency());
@@ -520,7 +520,7 @@ CFX_FloatRect CPWL_Wnd::GetWindowRect() const {
CFX_FloatRect CPWL_Wnd::GetClientRect() const {
CFX_FloatRect rcWindow = GetWindowRect();
CFX_FloatRect rcClient = CPWL_Utils::DeflateRect(
- rcWindow, (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+ rcWindow, (float)(GetBorderWidth() + GetInnerBorderWidth()));
if (CPWL_ScrollBar* pVSB = GetVScrollBar())
rcClient.right -= pVSB->GetScrollBarWidth();
@@ -700,7 +700,7 @@ bool CPWL_Wnd::IsReadOnly() const {
void CPWL_Wnd::RePosChildWnd() {
CFX_FloatRect rcContent = CPWL_Utils::DeflateRect(
- GetWindowRect(), (FX_FLOAT)(GetBorderWidth() + GetInnerBorderWidth()));
+ GetWindowRect(), (float)(GetBorderWidth() + GetInnerBorderWidth()));
CPWL_ScrollBar* pVSB = GetVScrollBar();
@@ -767,11 +767,11 @@ CFX_FloatRect CPWL_Wnd::GetFocusRect() const {
return CPWL_Utils::InflateRect(GetWindowRect(), 1);
}
-FX_FLOAT CPWL_Wnd::GetFontSize() const {
+float CPWL_Wnd::GetFontSize() const {
return m_sPrivateParam.fFontSize;
}
-void CPWL_Wnd::SetFontSize(FX_FLOAT fFontSize) {
+void CPWL_Wnd::SetFontSize(float fFontSize) {
m_sPrivateParam.fFontSize = fFontSize;
}
diff --git a/fpdfsdk/pdfwindow/PWL_Wnd.h b/fpdfsdk/pdfwindow/PWL_Wnd.h
index 55836d43a2..ded003c31b 100644
--- a/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -204,7 +204,7 @@ struct PWL_CREATEPARAM {
CPWL_Color sBorderColor; // optional
CPWL_Color sTextColor; // optional
int32_t nTransparency; // optional
- FX_FLOAT fFontSize; // optional
+ float fFontSize; // optional
CPWL_Dash sDash; // optional
void* pAttachedData; // optional
CPWL_Wnd* pParentWnd; // ignore
@@ -269,8 +269,8 @@ class CPWL_Wnd : public CPWL_TimerHandler {
virtual void KillFocus();
virtual void SetCursor();
virtual void SetVisible(bool bVisible);
- virtual void SetFontSize(FX_FLOAT fFontSize);
- virtual FX_FLOAT GetFontSize() const;
+ virtual void SetFontSize(float fFontSize);
+ virtual float GetFontSize() const;
virtual CFX_FloatRect GetFocusRect() const;
virtual CFX_FloatRect GetClientRect() const;
diff --git a/fpdfsdk/pdfwindow/cpwl_color.cpp b/fpdfsdk/pdfwindow/cpwl_color.cpp
index 9c9ca3eff0..689c3dec45 100644
--- a/fpdfsdk/pdfwindow/cpwl_color.cpp
+++ b/fpdfsdk/pdfwindow/cpwl_color.cpp
@@ -10,14 +10,11 @@
namespace {
-bool InRange(FX_FLOAT comp) {
+bool InRange(float comp) {
return comp >= 0.0f && comp <= 1.0f;
}
-CPWL_Color ConvertCMYK2GRAY(FX_FLOAT dC,
- FX_FLOAT dM,
- FX_FLOAT dY,
- FX_FLOAT dK) {
+CPWL_Color ConvertCMYK2GRAY(float dC, float dM, float dY, float dK) {
if (!InRange(dC) || !InRange(dM) || !InRange(dY) || !InRange(dK))
return CPWL_Color(COLORTYPE_GRAY);
return CPWL_Color(
@@ -25,25 +22,25 @@ CPWL_Color ConvertCMYK2GRAY(FX_FLOAT dC,
1.0f - std::min(1.0f, 0.3f * dC + 0.59f * dM + 0.11f * dY + dK));
}
-CPWL_Color ConvertGRAY2CMYK(FX_FLOAT dGray) {
+CPWL_Color ConvertGRAY2CMYK(float dGray) {
if (!InRange(dGray))
return CPWL_Color(COLORTYPE_CMYK);
return CPWL_Color(COLORTYPE_CMYK, 0.0f, 0.0f, 0.0f, 1.0f - dGray);
}
-CPWL_Color ConvertGRAY2RGB(FX_FLOAT dGray) {
+CPWL_Color ConvertGRAY2RGB(float dGray) {
if (!InRange(dGray))
return CPWL_Color(COLORTYPE_RGB);
return CPWL_Color(COLORTYPE_RGB, dGray, dGray, dGray);
}
-CPWL_Color ConvertRGB2GRAY(FX_FLOAT dR, FX_FLOAT dG, FX_FLOAT dB) {
+CPWL_Color ConvertRGB2GRAY(float dR, float dG, float dB) {
if (!InRange(dR) || !InRange(dG) || !InRange(dB))
return CPWL_Color(COLORTYPE_GRAY);
return CPWL_Color(COLORTYPE_GRAY, 0.3f * dR + 0.59f * dG + 0.11f * dB);
}
-CPWL_Color ConvertCMYK2RGB(FX_FLOAT dC, FX_FLOAT dM, FX_FLOAT dY, FX_FLOAT dK) {
+CPWL_Color ConvertCMYK2RGB(float dC, float dM, float dY, float dK) {
if (!InRange(dC) || !InRange(dM) || !InRange(dY) || !InRange(dK))
return CPWL_Color(COLORTYPE_RGB);
return CPWL_Color(COLORTYPE_RGB, 1.0f - std::min(1.0f, dC + dK),
@@ -51,13 +48,13 @@ CPWL_Color ConvertCMYK2RGB(FX_FLOAT dC, FX_FLOAT dM, FX_FLOAT dY, FX_FLOAT dK) {
1.0f - std::min(1.0f, dY + dK));
}
-CPWL_Color ConvertRGB2CMYK(FX_FLOAT dR, FX_FLOAT dG, FX_FLOAT dB) {
+CPWL_Color ConvertRGB2CMYK(float dR, float dG, float dB) {
if (!InRange(dR) || !InRange(dG) || !InRange(dB))
return CPWL_Color(COLORTYPE_CMYK);
- FX_FLOAT c = 1.0f - dR;
- FX_FLOAT m = 1.0f - dG;
- FX_FLOAT y = 1.0f - dB;
+ float c = 1.0f - dR;
+ float m = 1.0f - dG;
+ float y = 1.0f - dB;
return CPWL_Color(COLORTYPE_CMYK, c, m, y, std::min(c, std::min(m, y)));
}
@@ -135,7 +132,7 @@ FX_COLORREF CPWL_Color::ToFXColor(int32_t nTransparency) const {
static_cast<int32_t>(ret.fColor3 * 255));
}
-CPWL_Color CPWL_Color::operator-(FX_FLOAT fColorSub) const {
+CPWL_Color CPWL_Color::operator-(float fColorSub) const {
CPWL_Color sRet(nColorType);
switch (nColorType) {
case COLORTYPE_TRANSPARENT:
@@ -156,7 +153,7 @@ CPWL_Color CPWL_Color::operator-(FX_FLOAT fColorSub) const {
return sRet;
}
-CPWL_Color CPWL_Color::operator/(FX_FLOAT fColorDivide) const {
+CPWL_Color CPWL_Color::operator/(float fColorDivide) const {
CPWL_Color sRet(nColorType);
switch (nColorType) {
case COLORTYPE_TRANSPARENT:
diff --git a/fpdfsdk/pdfwindow/cpwl_color.h b/fpdfsdk/pdfwindow/cpwl_color.h
index f1b34c7eb8..6eae48738f 100644
--- a/fpdfsdk/pdfwindow/cpwl_color.h
+++ b/fpdfsdk/pdfwindow/cpwl_color.h
@@ -11,10 +11,10 @@
struct CPWL_Color {
CPWL_Color(int32_t type = COLORTYPE_TRANSPARENT,
- FX_FLOAT color1 = 0.0f,
- FX_FLOAT color2 = 0.0f,
- FX_FLOAT color3 = 0.0f,
- FX_FLOAT color4 = 0.0f)
+ float color1 = 0.0f,
+ float color2 = 0.0f,
+ float color3 = 0.0f,
+ float color4 = 0.0f)
: nColorType(type),
fColor1(color1),
fColor2(color2),
@@ -28,8 +28,8 @@ struct CPWL_Color {
fColor3(b / 255.0f),
fColor4(0) {}
- CPWL_Color operator/(FX_FLOAT fColorDivide) const;
- CPWL_Color operator-(FX_FLOAT fColorSub) const;
+ CPWL_Color operator/(float fColorDivide) const;
+ CPWL_Color operator-(float fColorSub) const;
CPWL_Color ConvertColorType(int32_t other_nColorType) const;
@@ -44,10 +44,10 @@ struct CPWL_Color {
}
int32_t nColorType;
- FX_FLOAT fColor1;
- FX_FLOAT fColor2;
- FX_FLOAT fColor3;
- FX_FLOAT fColor4;
+ float fColor1;
+ float fColor2;
+ float fColor3;
+ float fColor4;
};
#endif // FPDFSDK_PDFWINDOW_CPWL_COLOR_H_