summaryrefslogtreecommitdiff
path: root/xfa/fxfa/app
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 /xfa/fxfa/app
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 'xfa/fxfa/app')
-rw-r--r--xfa/fxfa/app/cxfa_loadercontext.h12
-rw-r--r--xfa/fxfa/app/cxfa_textlayout.cpp125
-rw-r--r--xfa/fxfa/app/cxfa_textlayout.h34
-rw-r--r--xfa/fxfa/app/cxfa_textparser.cpp34
-rw-r--r--xfa/fxfa/app/cxfa_textparser.h18
-rw-r--r--xfa/fxfa/app/cxfa_texttabstopscontext.cpp2
-rw-r--r--xfa/fxfa/app/cxfa_texttabstopscontext.h8
-rw-r--r--xfa/fxfa/app/xfa_ffbarcode.cpp2
-rw-r--r--xfa/fxfa/app/xfa_ffcheckbutton.cpp10
-rw-r--r--xfa/fxfa/app/xfa_fffield.cpp20
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.cpp6
-rw-r--r--xfa/fxfa/app/xfa_ffnotify.h6
-rw-r--r--xfa/fxfa/app/xfa_ffpageview.cpp34
-rw-r--r--xfa/fxfa/app/xfa_ffpath.cpp6
-rw-r--r--xfa/fxfa/app/xfa_ffpath.h2
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.cpp6
-rw-r--r--xfa/fxfa/app/xfa_ffpushbutton.h2
-rw-r--r--xfa/fxfa/app/xfa_fftext.cpp12
-rw-r--r--xfa/fxfa/app/xfa_ffwidget.cpp122
-rw-r--r--xfa/fxfa/app/xfa_ffwidgetacc.cpp129
-rw-r--r--xfa/fxfa/app/xfa_ffwidgethandler.cpp2
-rw-r--r--xfa/fxfa/app/xfa_fwladapter.cpp4
-rw-r--r--xfa/fxfa/app/xfa_fwladapter.h4
-rw-r--r--xfa/fxfa/app/xfa_textpiece.h2
24 files changed, 294 insertions, 308 deletions
diff --git a/xfa/fxfa/app/cxfa_loadercontext.h b/xfa/fxfa/app/cxfa_loadercontext.h
index d8ccdbe7e2..4d1a2b3a6b 100644
--- a/xfa/fxfa/app/cxfa_loadercontext.h
+++ b/xfa/fxfa/app/cxfa_loadercontext.h
@@ -22,19 +22,19 @@ class CXFA_LoaderContext {
~CXFA_LoaderContext();
bool m_bSaveLineHeight;
- FX_FLOAT m_fWidth;
- FX_FLOAT m_fHeight;
- FX_FLOAT m_fLastPos;
- FX_FLOAT m_fStartLineOffset;
+ float m_fWidth;
+ float m_fHeight;
+ float m_fLastPos;
+ float m_fStartLineOffset;
int32_t m_iChar;
int32_t m_iLines;
int32_t m_iTotalLines;
CFDE_XMLNode* m_pXMLNode;
CXFA_Node* m_pNode;
CFX_RetainPtr<CFDE_CSSComputedStyle> m_pParentStyle;
- CFX_ArrayTemplate<FX_FLOAT> m_lineHeights;
+ CFX_ArrayTemplate<float> m_lineHeights;
uint32_t m_dwFlags;
- std::vector<FX_FLOAT> m_BlocksHeight;
+ std::vector<float> m_BlocksHeight;
};
#endif // XFA_FXFA_APP_CXFA_LOADERCONTEXT_H_
diff --git a/xfa/fxfa/app/cxfa_textlayout.cpp b/xfa/fxfa/app/cxfa_textlayout.cpp
index 3c0087de09..f25f6cceee 100644
--- a/xfa/fxfa/app/cxfa_textlayout.cpp
+++ b/xfa/fxfa/app/cxfa_textlayout.cpp
@@ -101,11 +101,11 @@ std::unique_ptr<CFX_RTFBreak> CXFA_TextLayout::CreateBreak(bool bDefault) {
return pBreak;
}
-void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) {
+void CXFA_TextLayout::InitBreak(float fLineWidth) {
CXFA_Font font = m_pTextProvider->GetFontNode();
CXFA_Para para = m_pTextProvider->GetParaNode();
- FX_FLOAT fStart = 0;
- FX_FLOAT fStartPos = 0;
+ float fStart = 0;
+ float fStartPos = 0;
if (para) {
CFX_RTFLineAlignment iAlign = CFX_RTFLineAlignment::Left;
switch (para.GetHorizontalAlign()) {
@@ -135,7 +135,7 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) {
fLineWidth = fStart;
fStartPos = fStart;
- FX_FLOAT fIndent = para.GetTextIndent();
+ float fIndent = para.GetTextIndent();
if (fIndent > 0)
fStartPos += fIndent;
}
@@ -148,7 +148,7 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) {
m_pBreak->SetCharSpace(font.GetLetterSpacing());
}
- FX_FLOAT fFontSize = m_textParser.GetFontSize(m_pTextProvider, nullptr);
+ float fFontSize = m_textParser.GetFontSize(m_pTextProvider, nullptr);
m_pBreak->SetFontSize(fFontSize);
m_pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, nullptr));
m_pBreak->SetLineBreakTolerance(fFontSize * 0.2f);
@@ -156,7 +156,7 @@ void CXFA_TextLayout::InitBreak(FX_FLOAT fLineWidth) {
void CXFA_TextLayout::InitBreak(CFDE_CSSComputedStyle* pStyle,
FDE_CSSDisplay eDisplay,
- FX_FLOAT fLineWidth,
+ float fLineWidth,
CFDE_XMLNode* pXMLNode,
CFDE_CSSComputedStyle* pParentStyle) {
if (!pStyle) {
@@ -185,7 +185,7 @@ void CXFA_TextLayout::InitBreak(CFDE_CSSComputedStyle* pStyle,
}
m_pBreak->SetAlignment(iAlign);
- FX_FLOAT fStart = 0;
+ float fStart = 0;
const FDE_CSSRect* pRect = pStyle->GetMarginWidth();
const FDE_CSSRect* pPaddingRect = pStyle->GetPaddingWidth();
if (pRect) {
@@ -215,7 +215,7 @@ void CXFA_TextLayout::InitBreak(CFDE_CSSComputedStyle* pStyle,
}
}
m_pBreak->SetLineBoundary(fStart, fLineWidth);
- FX_FLOAT fIndent = pStyle->GetTextIndent().GetValue();
+ float fIndent = pStyle->GetTextIndent().GetValue();
if (fIndent > 0)
fStart += fIndent;
@@ -230,7 +230,7 @@ void CXFA_TextLayout::InitBreak(CFDE_CSSComputedStyle* pStyle,
}
}
- FX_FLOAT fFontSize = m_textParser.GetFontSize(m_pTextProvider, pStyle);
+ float fFontSize = m_textParser.GetFontSize(m_pTextProvider, pStyle);
m_pBreak->SetFontSize(fFontSize);
m_pBreak->SetLineBreakTolerance(fFontSize * 0.2f);
m_pBreak->SetFont(m_textParser.GetFont(m_pTextProvider, pStyle));
@@ -248,7 +248,7 @@ int32_t CXFA_TextLayout::GetText(CFX_WideString& wsText) {
return wsText.GetLength();
}
-FX_FLOAT CXFA_TextLayout::GetLayoutHeight() {
+float CXFA_TextLayout::GetLayoutHeight() {
if (!m_pLoader)
return 0;
@@ -263,7 +263,7 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() {
return szDef.height;
}
- FX_FLOAT fHeight = m_pLoader->m_fHeight;
+ float fHeight = m_pLoader->m_fHeight;
if (fHeight < 0.1f) {
fHeight = 0;
for (int32_t i = 0; i < iCount; i++)
@@ -272,7 +272,7 @@ FX_FLOAT CXFA_TextLayout::GetLayoutHeight() {
return fHeight;
}
-FX_FLOAT CXFA_TextLayout::StartLayout(FX_FLOAT fWidth) {
+float CXFA_TextLayout::StartLayout(float fWidth) {
if (!m_pLoader)
m_pLoader = pdfium::MakeUnique<CXFA_LoaderContext>();
@@ -298,14 +298,14 @@ FX_FLOAT CXFA_TextLayout::StartLayout(FX_FLOAT fWidth) {
}
bool CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
- FX_FLOAT& fCalcHeight,
- FX_FLOAT fContentAreaHeight,
- FX_FLOAT fTextHeight) {
+ float& fCalcHeight,
+ float fContentAreaHeight,
+ float fTextHeight) {
if (!m_pLoader)
return false;
int32_t iBlockCount = m_Blocks.GetSize();
- FX_FLOAT fHeight = fTextHeight;
+ float fHeight = fTextHeight;
if (fHeight < 0)
fHeight = GetLayoutHeight();
@@ -326,7 +326,7 @@ bool CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
}
}
- FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset;
+ float fLinePos = m_pLoader->m_fStartLineOffset;
int32_t iLineIndex = 0;
if (iBlockCount > 1) {
if (iBlockCount >= (iBlockIndex + 1) * 2) {
@@ -344,7 +344,7 @@ bool CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
int32_t iCount = m_pLoader->m_lineHeights.GetSize();
int32_t i = 0;
for (i = iLineIndex; i < iCount; i++) {
- FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i);
+ float fLineHeight = m_pLoader->m_lineHeights.ElementAt(i);
if ((i == iLineIndex) && (fLineHeight - fContentAreaHeight > 0.001)) {
fCalcHeight = 0;
return true;
@@ -364,7 +364,7 @@ bool CXFA_TextLayout::DoLayout(int32_t iBlockIndex,
(m_pLoader->m_BlocksHeight[iBlockIndex * 2] == iBlockIndex)) {
m_pLoader->m_BlocksHeight[iBlockIndex * 2 + 1] = fCalcHeight;
} else {
- m_pLoader->m_BlocksHeight.push_back((FX_FLOAT)iBlockIndex);
+ m_pLoader->m_BlocksHeight.push_back((float)iBlockIndex);
m_pLoader->m_BlocksHeight.push_back(fCalcHeight);
}
}
@@ -392,7 +392,7 @@ bool CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize,
defaultSize.width = 0xFFFF;
m_pBreak = CreateBreak(false);
- FX_FLOAT fLinePos = 0;
+ float fLinePos = 0;
m_iLines = 0;
m_fMaxWidth = 0;
Loader(defaultSize, fLinePos, false);
@@ -404,7 +404,7 @@ bool CXFA_TextLayout::CalcSize(const CFX_SizeF& minSize,
return true;
}
-bool CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) {
+bool CXFA_TextLayout::Layout(const CFX_SizeF& size, float* fHeight) {
if (size.width < 1)
return false;
@@ -416,7 +416,7 @@ bool CXFA_TextLayout::Layout(const CFX_SizeF& size, FX_FLOAT* fHeight) {
}
m_iLines = 0;
- FX_FLOAT fLinePos = 0;
+ float fLinePos = 0;
Loader(size, fLinePos, true);
UpdateAlign(size.height, fLinePos);
m_pTabstopContext.reset();
@@ -433,7 +433,7 @@ bool CXFA_TextLayout::Layout(int32_t iBlock) {
m_pLoader->m_iTotalLines = -1;
m_iLines = 0;
- FX_FLOAT fLinePos = 0;
+ float fLinePos = 0;
CXFA_Node* pNode = nullptr;
CFX_SizeF szText(m_pLoader->m_fWidth, m_pLoader->m_fHeight);
int32_t iCount = m_Blocks.GetSize();
@@ -523,7 +523,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) {
bool bEndItem = true;
int32_t iBlockCount = m_Blocks.GetSize();
- FX_FLOAT fLinePos = m_pLoader->m_fStartLineOffset;
+ float fLinePos = m_pLoader->m_fStartLineOffset;
int32_t iLineIndex = 0;
if (iBlockIndex > 0) {
int32_t iBlockHeightCount =
@@ -540,7 +540,7 @@ void CXFA_TextLayout::ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex) {
int32_t i = 0;
for (i = iLineIndex; i < iCountHeight; i++) {
- FX_FLOAT fLineHeight = m_pLoader->m_lineHeights.ElementAt(i);
+ float fLineHeight = m_pLoader->m_lineHeights.ElementAt(i);
if (fLinePos + fLineHeight - rtText.height > 0.001) {
m_Blocks.Add(iLineIndex);
m_Blocks.Add(i - iLineIndex);
@@ -619,7 +619,7 @@ bool CXFA_TextLayout::DrawString(CFX_RenderDevice* pFxDevice,
return iPieceLines > 0;
}
-void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) {
+void CXFA_TextLayout::UpdateAlign(float fHeight, float fBottom) {
fHeight -= fBottom;
if (fHeight < 0.1f)
return;
@@ -641,7 +641,7 @@ void CXFA_TextLayout::UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom) {
}
bool CXFA_TextLayout::Loader(const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
bool bSavePieces) {
GetTextDataNode();
if (!m_pTextDataNode)
@@ -665,12 +665,12 @@ bool CXFA_TextLayout::Loader(const CFX_SizeF& szText,
void CXFA_TextLayout::LoadText(CXFA_Node* pNode,
const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
bool bSavePieces) {
InitBreak(szText.width);
CXFA_Para para = m_pTextProvider->GetParaNode();
- FX_FLOAT fSpaceAbove = 0;
+ float fSpaceAbove = 0;
if (para) {
fSpaceAbove = para.GetSpaceAbove();
if (fSpaceAbove < 0.1f) {
@@ -699,7 +699,7 @@ void CXFA_TextLayout::LoadText(CXFA_Node* pNode,
bool CXFA_TextLayout::LoadRichText(
CFDE_XMLNode* pXMLNode,
const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
const CFX_RetainPtr<CFDE_CSSComputedStyle>& pParentStyle,
bool bSavePieces,
CFX_RetainPtr<CXFA_LinkUserData> pLinkData,
@@ -713,7 +713,7 @@ bool CXFA_TextLayout::LoadRichText(
m_textParser.GetParseContextFromMap(pXMLNode);
FDE_CSSDisplay eDisplay = FDE_CSSDisplay::None;
bool bContentNode = false;
- FX_FLOAT fSpaceBelow = 0;
+ float fSpaceBelow = 0;
CFX_RetainPtr<CFDE_CSSComputedStyle> pStyle;
CFX_WideString wsName;
if (bEndBreak) {
@@ -887,8 +887,8 @@ bool CXFA_TextLayout::LoadRichText(
}
bool CXFA_TextLayout::AppendChar(const CFX_WideString& wsText,
- FX_FLOAT& fLinePos,
- FX_FLOAT fSpaceAbove,
+ float& fLinePos,
+ float fSpaceAbove,
bool bSavePieces) {
CFX_BreakType dwStatus = CFX_BreakType::None;
int32_t iChar = 0;
@@ -950,7 +950,7 @@ void CXFA_TextLayout::ProcessText(CFX_WideString& wsText) {
}
void CXFA_TextLayout::EndBreak(CFX_BreakType dwStatus,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
bool bSavePieces) {
dwStatus = m_pBreak->EndBreak(dwStatus);
if (dwStatus != CFX_BreakType::None && dwStatus != CFX_BreakType::Piece)
@@ -977,7 +977,7 @@ void CXFA_TextLayout::DoTabstops(CFDE_CSSComputedStyle* pStyle,
if (iCount > 0) {
iTabstopsIndex++;
m_pTabstopContext->m_bTabstops = true;
- FX_FLOAT fRight = 0;
+ float fRight = 0;
if (iPieces > 1) {
XFA_TextPiece* p = pPieceLine->m_textPieces[iPieces - 2].get();
fRight = p->rtPiece.right();
@@ -985,7 +985,7 @@ void CXFA_TextLayout::DoTabstops(CFDE_CSSComputedStyle* pStyle,
m_pTabstopContext->m_fTabWidth =
pPiece->rtPiece.width + pPiece->rtPiece.left - fRight;
} else if (iTabstopsIndex > -1) {
- FX_FLOAT fLeft = 0;
+ float fLeft = 0;
if (m_pTabstopContext->m_bTabstops) {
XFA_TABSTOPS* pTabstops =
m_pTabstopContext->m_tabstops.GetDataPtr(iTabstopsIndex);
@@ -1014,7 +1014,7 @@ void CXFA_TextLayout::DoTabstops(CFDE_CSSComputedStyle* pStyle,
}
void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
bool bSavePieces,
bool bEndBreak) {
int32_t iPieces = m_pBreak->CountBreakPieces();
@@ -1029,7 +1029,7 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
if (m_pTabstopContext)
m_pTabstopContext->Reset();
- FX_FLOAT fLineStep = 0, fBaseLine = 0;
+ float fLineStep = 0, fBaseLine = 0;
int32_t i = 0;
for (i = 0; i < iPieces; i++) {
const CFX_BreakPiece* pPiece = m_pBreak->GetBreakPieceUnstable(i);
@@ -1037,7 +1037,7 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
static_cast<CXFA_TextUserData*>(pPiece->m_pUserData.Get());
if (pUserData)
pStyle = pUserData->m_pStyle;
- FX_FLOAT fVerScale = pPiece->m_iVerticalScale / 100.0f;
+ float fVerScale = pPiece->m_iVerticalScale / 100.0f;
auto pTP = pdfium::MakeUnique<XFA_TextPiece>();
pTP->iChars = pPiece->m_iChars;
@@ -1055,15 +1055,15 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
pTP->fFontSize = m_textParser.GetFontSize(m_pTextProvider, pStyle.Get());
pTP->rtPiece.left = pPiece->m_iStartPos / 20000.0f;
pTP->rtPiece.width = pPiece->m_iWidth / 20000.0f;
- pTP->rtPiece.height = (FX_FLOAT)pPiece->m_iFontSize * fVerScale / 20.0f;
- FX_FLOAT fBaseLineTemp =
+ pTP->rtPiece.height = (float)pPiece->m_iFontSize * fVerScale / 20.0f;
+ float fBaseLineTemp =
m_textParser.GetBaseline(m_pTextProvider, pStyle.Get());
pTP->rtPiece.top = fBaseLineTemp;
- FX_FLOAT fLineHeight = m_textParser.GetLineHeight(
+ float fLineHeight = m_textParser.GetLineHeight(
m_pTextProvider, pStyle.Get(), m_iLines == 0, fVerScale);
if (fBaseLineTemp > 0) {
- FX_FLOAT fLineHeightTmp = fBaseLineTemp + pTP->rtPiece.height;
+ float fLineHeightTmp = fBaseLineTemp + pTP->rtPiece.height;
if (fLineHeight < fLineHeightTmp)
fLineHeight = fLineHeightTmp;
else
@@ -1077,29 +1077,28 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
DoTabstops(pStyle.Get(), pPieceLine);
}
for (const auto& pTP : pPieceLine->m_textPieces) {
- FX_FLOAT& fTop = pTP->rtPiece.top;
- FX_FLOAT fBaseLineTemp = fTop;
+ float& fTop = pTP->rtPiece.top;
+ float fBaseLineTemp = fTop;
fTop = fLinePos + fLineStep - pTP->rtPiece.height - fBaseLineTemp;
fTop = std::max(0.0f, fTop);
}
fLinePos += fLineStep + fBaseLine;
} else {
- FX_FLOAT fLineStep = 0;
- FX_FLOAT fLineWidth = 0;
+ float fLineStep = 0;
+ float fLineWidth = 0;
for (int32_t i = 0; i < iPieces; i++) {
const CFX_BreakPiece* pPiece = m_pBreak->GetBreakPieceUnstable(i);
CXFA_TextUserData* pUserData =
static_cast<CXFA_TextUserData*>(pPiece->m_pUserData.Get());
if (pUserData)
pStyle = pUserData->m_pStyle;
- FX_FLOAT fVerScale = pPiece->m_iVerticalScale / 100.0f;
- FX_FLOAT fBaseLine =
- m_textParser.GetBaseline(m_pTextProvider, pStyle.Get());
- FX_FLOAT fLineHeight = m_textParser.GetLineHeight(
+ float fVerScale = pPiece->m_iVerticalScale / 100.0f;
+ float fBaseLine = m_textParser.GetBaseline(m_pTextProvider, pStyle.Get());
+ float fLineHeight = m_textParser.GetLineHeight(
m_pTextProvider, pStyle.Get(), m_iLines == 0, fVerScale);
if (fBaseLine > 0) {
- FX_FLOAT fLineHeightTmp =
- fBaseLine + (FX_FLOAT)pPiece->m_iFontSize * fVerScale / 20.0f;
+ float fLineHeightTmp =
+ fBaseLine + (float)pPiece->m_iFontSize * fVerScale / 20.0f;
if (fLineHeight < fLineHeightTmp) {
fLineHeight = fLineHeightTmp;
}
@@ -1110,7 +1109,7 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
fLinePos += fLineStep;
m_fMaxWidth = std::max(m_fMaxWidth, fLineWidth);
if (m_pLoader && m_pLoader->m_bSaveLineHeight) {
- FX_FLOAT fHeight = fLinePos - m_pLoader->m_fLastPos;
+ float fHeight = fLinePos - m_pLoader->m_fLastPos;
m_pLoader->m_fLastPos = fLinePos;
m_pLoader->m_lineHeights.Add(fHeight);
}
@@ -1122,12 +1121,12 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
if (!pStyle && bEndBreak) {
CXFA_Para para = m_pTextProvider->GetParaNode();
if (para) {
- FX_FLOAT fStartPos = para.GetMarginLeft();
- FX_FLOAT fIndent = para.GetTextIndent();
+ float fStartPos = para.GetMarginLeft();
+ float fIndent = para.GetTextIndent();
if (fIndent > 0)
fStartPos += fIndent;
- FX_FLOAT fSpaceBelow = para.GetSpaceBelow();
+ float fSpaceBelow = para.GetSpaceBelow();
if (fSpaceBelow < 0.1f)
fSpaceBelow = 0;
@@ -1138,12 +1137,12 @@ void CXFA_TextLayout::AppendTextLine(CFX_BreakType dwStatus,
}
if (pStyle) {
- FX_FLOAT fStart = 0;
+ float fStart = 0;
const FDE_CSSRect* pRect = pStyle->GetMarginWidth();
if (pRect)
fStart = pRect->left.GetValue();
- FX_FLOAT fTextIndent = pStyle->GetTextIndent().GetValue();
+ float fTextIndent = pStyle->GetTextIndent().GetValue();
if (fTextIndent < 0)
fStart -= fTextIndent;
@@ -1185,7 +1184,7 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice,
int32_t iChars = GetDisplayPos(pPiece, pCharPos);
if (iChars > 0) {
CFX_PointF pt1, pt2;
- FX_FLOAT fEndY = pCharPos[0].m_Origin.y + 1.05f;
+ float fEndY = pCharPos[0].m_Origin.y + 1.05f;
if (pPiece->iPeriod == XFA_ATTRIBUTEENUM_Word) {
for (int32_t i = 0; i < pPiece->iUnderline; i++) {
for (int32_t j = 0; j < iChars; j++) {
@@ -1244,8 +1243,8 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice,
if (iCharsTmp == 0)
return;
- FX_FLOAT fOrgX = 0.0f;
- FX_FLOAT fEndX = 0.0f;
+ float fOrgX = 0.0f;
+ float fEndX = 0.0f;
pPiece = pPieceLine->m_textPieces[iPiecePrev].get();
iChars = GetDisplayPos(pPiece, pCharPos);
if (iChars < 1)
@@ -1263,7 +1262,7 @@ void CXFA_TextLayout::RenderPath(CFDE_RenderDevice* pDevice,
CFX_PointF pt2;
pt1.x = fOrgX;
pt2.x = fEndX;
- FX_FLOAT fEndY = pCharPos[0].m_Origin.y + 1.05f;
+ float fEndY = pCharPos[0].m_Origin.y + 1.05f;
for (int32_t i = 0; i < pPiece->iUnderline; i++) {
pt1.y = fEndY;
pt2.y = fEndY;
diff --git a/xfa/fxfa/app/cxfa_textlayout.h b/xfa/fxfa/app/cxfa_textlayout.h
index cbf3d33ad9..dcf415ac16 100644
--- a/xfa/fxfa/app/cxfa_textlayout.h
+++ b/xfa/fxfa/app/cxfa_textlayout.h
@@ -37,17 +37,17 @@ class CXFA_TextLayout {
~CXFA_TextLayout();
int32_t GetText(CFX_WideString& wsText);
- FX_FLOAT GetLayoutHeight();
- FX_FLOAT StartLayout(FX_FLOAT fWidth = -1);
+ float GetLayoutHeight();
+ float StartLayout(float fWidth = -1);
bool DoLayout(int32_t iBlockIndex,
- FX_FLOAT& fCalcHeight,
- FX_FLOAT fContentAreaHeight = -1,
- FX_FLOAT fTextHeight = -1);
+ float& fCalcHeight,
+ float fContentAreaHeight = -1,
+ float fTextHeight = -1);
bool CalcSize(const CFX_SizeF& minSize,
const CFX_SizeF& maxSize,
CFX_SizeF& defaultSize);
- bool Layout(const CFX_SizeF& size, FX_FLOAT* fHeight = nullptr);
+ bool Layout(const CFX_SizeF& size, float* fHeight = nullptr);
void ItemBlocks(const CFX_RectF& rtText, int32_t iBlockIndex);
bool DrawString(CFX_RenderDevice* pFxDevice,
const CFX_Matrix& tmDoc2Device,
@@ -66,22 +66,22 @@ class CXFA_TextLayout {
void GetTextDataNode();
CFDE_XMLNode* GetXMLContainerNode();
std::unique_ptr<CFX_RTFBreak> CreateBreak(bool bDefault);
- void InitBreak(FX_FLOAT fLineWidth);
+ void InitBreak(float fLineWidth);
void InitBreak(CFDE_CSSComputedStyle* pStyle,
FDE_CSSDisplay eDisplay,
- FX_FLOAT fLineWidth,
+ float fLineWidth,
CFDE_XMLNode* pXMLNode,
CFDE_CSSComputedStyle* pParentStyle = nullptr);
bool Loader(const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
bool bSavePieces = true);
void LoadText(CXFA_Node* pNode,
const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
bool bSavePieces);
bool LoadRichText(CFDE_XMLNode* pXMLNode,
const CFX_SizeF& szText,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
const CFX_RetainPtr<CFDE_CSSComputedStyle>& pParentStyle,
bool bSavePieces,
CFX_RetainPtr<CXFA_LinkUserData> pLinkData,
@@ -89,17 +89,17 @@ class CXFA_TextLayout {
bool bIsOl = false,
int32_t iLiCount = 0);
bool AppendChar(const CFX_WideString& wsText,
- FX_FLOAT& fLinePos,
- FX_FLOAT fSpaceAbove,
+ float& fLinePos,
+ float fSpaceAbove,
bool bSavePieces);
void AppendTextLine(CFX_BreakType dwStatus,
- FX_FLOAT& fLinePos,
+ float& fLinePos,
bool bSavePieces,
bool bEndBreak = false);
- void EndBreak(CFX_BreakType dwStatus, FX_FLOAT& fLinePos, bool bDefault);
+ void EndBreak(CFX_BreakType dwStatus, float& fLinePos, bool bDefault);
bool IsEnd(bool bSavePieces);
void ProcessText(CFX_WideString& wsText);
- void UpdateAlign(FX_FLOAT fHeight, FX_FLOAT fBottom);
+ void UpdateAlign(float fHeight, float fBottom);
void RenderString(CFDE_RenderDevice* pDevice,
CFDE_Brush* pBrush,
CXFA_PieceLine* pPieceLine,
@@ -126,7 +126,7 @@ class CXFA_TextLayout {
std::unique_ptr<CFX_RTFBreak> m_pBreak;
std::unique_ptr<CXFA_LoaderContext> m_pLoader;
int32_t m_iLines;
- FX_FLOAT m_fMaxWidth;
+ float m_fMaxWidth;
CXFA_TextParser m_textParser;
std::vector<std::unique_ptr<CXFA_PieceLine>> m_pieceLines;
std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext;
diff --git a/xfa/fxfa/app/cxfa_textparser.cpp b/xfa/fxfa/app/cxfa_textparser.cpp
index 750a0baaff..6a9aeb04d8 100644
--- a/xfa/fxfa/app/cxfa_textparser.cpp
+++ b/xfa/fxfa/app/cxfa_textparser.cpp
@@ -67,7 +67,7 @@ void CXFA_TextParser::InitCSSData(CXFA_TextProvider* pTextProvider) {
CFGAS_FontMgr* pFontMgr = pDoc->GetApp()->GetFDEFontMgr();
ASSERT(pFontMgr);
m_pSelector = pdfium::MakeUnique<CFDE_CSSStyleSelector>(pFontMgr);
- FX_FLOAT fFontSize = 10;
+ float fFontSize = 10;
CXFA_Font font = pTextProvider->GetFontNode();
if (font) {
fFontSize = font.GetFontSize();
@@ -106,8 +106,8 @@ CFX_RetainPtr<CFDE_CSSComputedStyle> CXFA_TextParser::CreateRootStyle(
CXFA_Font font = pTextProvider->GetFontNode();
CXFA_Para para = pTextProvider->GetParaNode();
auto pStyle = m_pSelector->CreateComputedStyle(nullptr);
- FX_FLOAT fLineHeight = 0;
- FX_FLOAT fFontSize = 10;
+ float fLineHeight = 0;
+ float fFontSize = 10;
if (para) {
fLineHeight = para.GetLineHeight();
@@ -171,7 +171,7 @@ CFX_RetainPtr<CFDE_CSSComputedStyle> CXFA_TextParser::CreateStyle(
return pNewStyle;
uint32_t dwDecoration = pParentStyle->GetTextDecoration();
- FX_FLOAT fBaseLine = 0;
+ float fBaseLine = 0;
if (pParentStyle->GetVerticalAlign() == FDE_CSSVerticalAlign::Number)
fBaseLine = pParentStyle->GetNumberVerticalAlign();
@@ -307,7 +307,7 @@ int32_t CXFA_TextParser::GetVAlign(CXFA_TextProvider* pTextProvider) const {
return para ? para.GetVerticalAlign() : XFA_ATTRIBUTEENUM_Top;
}
-FX_FLOAT CXFA_TextParser::GetTabInterval(CFDE_CSSComputedStyle* pStyle) const {
+float CXFA_TextParser::GetTabInterval(CFDE_CSSComputedStyle* pStyle) const {
CFX_WideString wsValue;
if (pStyle && pStyle->GetCustomStyle(L"tab-interval", wsValue))
return CXFA_Measurement(wsValue.AsStringC()).ToUnit(XFA_UNIT_Pt);
@@ -361,8 +361,8 @@ CFX_RetainPtr<CFGAS_GEFont> CXFA_TextParser::GetFont(
return pFontMgr->GetFont(pDoc, wsFamily, dwStyle);
}
-FX_FLOAT CXFA_TextParser::GetFontSize(CXFA_TextProvider* pTextProvider,
- CFDE_CSSComputedStyle* pStyle) const {
+float CXFA_TextParser::GetFontSize(CXFA_TextProvider* pTextProvider,
+ CFDE_CSSComputedStyle* pStyle) const {
if (pStyle)
return pStyle->GetFontSize();
@@ -466,8 +466,8 @@ FX_ARGB CXFA_TextParser::GetColor(CXFA_TextProvider* pTextProvider,
return 0xFF000000;
}
-FX_FLOAT CXFA_TextParser::GetBaseline(CXFA_TextProvider* pTextProvider,
- CFDE_CSSComputedStyle* pStyle) const {
+float CXFA_TextParser::GetBaseline(CXFA_TextProvider* pTextProvider,
+ CFDE_CSSComputedStyle* pStyle) const {
if (pStyle) {
if (pStyle->GetVerticalAlign() == FDE_CSSVerticalAlign::Number)
return pStyle->GetNumberVerticalAlign();
@@ -477,18 +477,18 @@ FX_FLOAT CXFA_TextParser::GetBaseline(CXFA_TextProvider* pTextProvider,
return 0;
}
-FX_FLOAT CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider,
- CFDE_CSSComputedStyle* pStyle,
- bool bFirst,
- FX_FLOAT fVerScale) const {
- FX_FLOAT fLineHeight = 0;
+float CXFA_TextParser::GetLineHeight(CXFA_TextProvider* pTextProvider,
+ CFDE_CSSComputedStyle* pStyle,
+ bool bFirst,
+ float fVerScale) const {
+ float fLineHeight = 0;
if (pStyle)
fLineHeight = pStyle->GetLineHeight();
else if (CXFA_Para para = pTextProvider->GetParaNode())
fLineHeight = para.GetLineHeight();
if (bFirst) {
- FX_FLOAT fFontSize = GetFontSize(pTextProvider, pStyle);
+ float fFontSize = GetFontSize(pTextProvider, pStyle);
if (fLineHeight < 0.1f)
fLineHeight = fFontSize;
else
@@ -618,7 +618,7 @@ bool CXFA_TextParser::GetTabstops(CFDE_CSSComputedStyle* pStyle,
if (ch == ' ') {
uint32_t dwHashCode = FX_HashCode_GetW(wsAlign.AsStringC(), true);
CXFA_Measurement ms(CFX_WideStringC(pTabStops + iLast, iCur - iLast));
- FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt);
+ float fPos = ms.ToUnit(XFA_UNIT_Pt);
pTabstopContext->Append(dwHashCode, fPos);
wsAlign.clear();
eStatus = TabStopStatus::None;
@@ -633,7 +633,7 @@ bool CXFA_TextParser::GetTabstops(CFDE_CSSComputedStyle* pStyle,
if (!wsAlign.IsEmpty()) {
uint32_t dwHashCode = FX_HashCode_GetW(wsAlign.AsStringC(), true);
CXFA_Measurement ms(CFX_WideStringC(pTabStops + iLast, iCur - iLast));
- FX_FLOAT fPos = ms.ToUnit(XFA_UNIT_Pt);
+ float fPos = ms.ToUnit(XFA_UNIT_Pt);
pTabstopContext->Append(dwHashCode, fPos);
}
return true;
diff --git a/xfa/fxfa/app/cxfa_textparser.h b/xfa/fxfa/app/cxfa_textparser.h
index 86da502dbf..524f125665 100644
--- a/xfa/fxfa/app/cxfa_textparser.h
+++ b/xfa/fxfa/app/cxfa_textparser.h
@@ -43,7 +43,7 @@ class CXFA_TextParser {
int32_t GetVAlign(CXFA_TextProvider* pTextProvider) const;
- FX_FLOAT GetTabInterval(CFDE_CSSComputedStyle* pStyle) const;
+ float GetTabInterval(CFDE_CSSComputedStyle* pStyle) const;
int32_t CountTabs(CFDE_CSSComputedStyle* pStyle) const;
bool IsSpaceRun(CFDE_CSSComputedStyle* pStyle) const;
@@ -52,8 +52,8 @@ class CXFA_TextParser {
CFX_RetainPtr<CFGAS_GEFont> GetFont(CXFA_TextProvider* pTextProvider,
CFDE_CSSComputedStyle* pStyle) const;
- FX_FLOAT GetFontSize(CXFA_TextProvider* pTextProvider,
- CFDE_CSSComputedStyle* pStyle) const;
+ float GetFontSize(CXFA_TextProvider* pTextProvider,
+ CFDE_CSSComputedStyle* pStyle) const;
int32_t GetHorScale(CXFA_TextProvider* pTextProvider,
CFDE_CSSComputedStyle* pStyle,
@@ -70,12 +70,12 @@ class CXFA_TextParser {
int32_t& iLinethrough) const;
FX_ARGB GetColor(CXFA_TextProvider* pTextProvider,
CFDE_CSSComputedStyle* pStyle) const;
- FX_FLOAT GetBaseline(CXFA_TextProvider* pTextProvider,
- CFDE_CSSComputedStyle* pStyle) const;
- FX_FLOAT GetLineHeight(CXFA_TextProvider* pTextProvider,
- CFDE_CSSComputedStyle* pStyle,
- bool bFirst,
- FX_FLOAT fVerScale) const;
+ float GetBaseline(CXFA_TextProvider* pTextProvider,
+ CFDE_CSSComputedStyle* pStyle) const;
+ float GetLineHeight(CXFA_TextProvider* pTextProvider,
+ CFDE_CSSComputedStyle* pStyle,
+ bool bFirst,
+ float fVerScale) const;
bool GetEmbbedObj(CXFA_TextProvider* pTextProvider,
CFDE_XMLNode* pXMLNode,
diff --git a/xfa/fxfa/app/cxfa_texttabstopscontext.cpp b/xfa/fxfa/app/cxfa_texttabstopscontext.cpp
index 3209603af3..b654e87a04 100644
--- a/xfa/fxfa/app/cxfa_texttabstopscontext.cpp
+++ b/xfa/fxfa/app/cxfa_texttabstopscontext.cpp
@@ -15,7 +15,7 @@ CXFA_TextTabstopsContext::CXFA_TextTabstopsContext()
CXFA_TextTabstopsContext::~CXFA_TextTabstopsContext() {}
-void CXFA_TextTabstopsContext::Append(uint32_t dwAlign, FX_FLOAT fTabstops) {
+void CXFA_TextTabstopsContext::Append(uint32_t dwAlign, float fTabstops) {
int32_t i = 0;
for (i = 0; i < m_iTabCount; i++) {
XFA_TABSTOPS* pTabstop = m_tabstops.GetDataPtr(i);
diff --git a/xfa/fxfa/app/cxfa_texttabstopscontext.h b/xfa/fxfa/app/cxfa_texttabstopscontext.h
index 8fe0e6273f..64b83a4421 100644
--- a/xfa/fxfa/app/cxfa_texttabstopscontext.h
+++ b/xfa/fxfa/app/cxfa_texttabstopscontext.h
@@ -11,7 +11,7 @@
struct XFA_TABSTOPS {
uint32_t dwAlign;
- FX_FLOAT fTabstops;
+ float fTabstops;
};
class CXFA_TextTabstopsContext {
@@ -19,7 +19,7 @@ class CXFA_TextTabstopsContext {
CXFA_TextTabstopsContext();
~CXFA_TextTabstopsContext();
- void Append(uint32_t dwAlign, FX_FLOAT fTabstops);
+ void Append(uint32_t dwAlign, float fTabstops);
void RemoveAll();
void Reset();
@@ -27,8 +27,8 @@ class CXFA_TextTabstopsContext {
int32_t m_iTabCount;
int32_t m_iTabIndex;
bool m_bTabstops;
- FX_FLOAT m_fTabWidth;
- FX_FLOAT m_fLeft;
+ float m_fTabWidth;
+ float m_fLeft;
};
#endif // XFA_FXFA_APP_CXFA_TEXTTABSTOPSCONTEXT_H_
diff --git a/xfa/fxfa/app/xfa_ffbarcode.cpp b/xfa/fxfa/app/xfa_ffbarcode.cpp
index 3bbef30d06..6b13069ed2 100644
--- a/xfa/fxfa/app/xfa_ffbarcode.cpp
+++ b/xfa/fxfa/app/xfa_ffbarcode.cpp
@@ -176,7 +176,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() {
int32_t intVal;
char charVal;
bool boolVal;
- FX_FLOAT floatVal;
+ float floatVal;
if (pAcc->GetBarcodeAttribute_CharEncoding(intVal)) {
pBarCodeWidget->SetCharEncoding((BC_CHAR_ENCODING)intVal);
}
diff --git a/xfa/fxfa/app/xfa_ffcheckbutton.cpp b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
index f088b5d4dd..22fdb3d9df 100644
--- a/xfa/fxfa/app/xfa_ffcheckbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffcheckbutton.cpp
@@ -49,7 +49,7 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() {
if (!m_pNormalWidget) {
return;
}
- FX_FLOAT fSize = m_pDataAcc->GetCheckButtonSize();
+ float fSize = m_pDataAcc->GetCheckButtonSize();
pCheckBox->SetBoxSize(fSize);
uint32_t dwStyleEx = FWL_STYLEEXT_CKB_SignShapeCross;
int32_t iCheckMark = m_pDataAcc->GetCheckButtonMark();
@@ -86,14 +86,14 @@ void CXFA_FFCheckButton::UpdateWidgetProperty() {
}
bool CXFA_FFCheckButton::PerformLayout() {
CXFA_FFWidget::PerformLayout();
- FX_FLOAT fCheckSize = m_pDataAcc->GetCheckButtonSize();
+ float fCheckSize = m_pDataAcc->GetCheckButtonSize();
CXFA_Margin mgWidget = m_pDataAcc->GetMargin();
CFX_RectF rtWidget = GetRectWithoutRotate();
if (mgWidget) {
XFA_RectWidthoutMargin(rtWidget, mgWidget);
}
int32_t iCapPlacement = -1;
- FX_FLOAT fCapReserve = 0;
+ float fCapReserve = 0;
CXFA_Caption caption = m_pDataAcc->GetCaption();
if (caption && caption.GetPresence()) {
m_rtCaption = rtWidget;
@@ -189,8 +189,8 @@ void CXFA_FFCheckButton::CapLeftRightPlacement(CXFA_Margin mgCap) {
void CXFA_FFCheckButton::AddUIMargin(int32_t iCapPlacement) {
CFX_RectF rtUIMargin = m_pDataAcc->GetUIMargin();
m_rtUI.top -= rtUIMargin.top / 2 - rtUIMargin.height / 2;
- FX_FLOAT fLeftAddRight = rtUIMargin.left + rtUIMargin.width;
- FX_FLOAT fTopAddBottom = rtUIMargin.top + rtUIMargin.height;
+ float fLeftAddRight = rtUIMargin.left + rtUIMargin.width;
+ float fTopAddBottom = rtUIMargin.top + rtUIMargin.height;
if (m_rtUI.width < fLeftAddRight) {
if (iCapPlacement == XFA_ATTRIBUTEENUM_Right ||
iCapPlacement == XFA_ATTRIBUTEENUM_Left) {
diff --git a/xfa/fxfa/app/xfa_fffield.cpp b/xfa/fxfa/app/xfa_fffield.cpp
index 630d04311f..06763be094 100644
--- a/xfa/fxfa/app/xfa_fffield.cpp
+++ b/xfa/fxfa/app/xfa_fffield.cpp
@@ -94,7 +94,7 @@ void CXFA_FFField::DrawFocus(CFX_Graphics* pGS, CFX_Matrix* pMatrix) {
if (m_dwStatus & XFA_WidgetStatus_Focused) {
CFX_Color cr(0xFF000000);
pGS->SetStrokeColor(&cr);
- FX_FLOAT DashPattern[2] = {1, 1};
+ float DashPattern[2] = {1, 1};
pGS->SetLineDash(0.0f, DashPattern, 2);
pGS->SetLineWidth(0, false);
@@ -124,7 +124,7 @@ void CXFA_FFField::SetEditScrollOffset() {
XFA_Element eType = m_pDataAcc->GetUIType();
if (eType == XFA_Element::TextEdit || eType == XFA_Element::NumericEdit ||
eType == XFA_Element::PasswordEdit) {
- FX_FLOAT fScrollOffset = 0;
+ float fScrollOffset = 0;
CXFA_FFField* pPrev = static_cast<CXFA_FFField*>(GetPrev());
if (pPrev) {
CFX_RectF rtMargin = m_pDataAcc->GetUIMargin();
@@ -153,7 +153,7 @@ void CXFA_FFField::CapPlacement() {
CXFA_Margin mgWidget = m_pDataAcc->GetMargin();
if (mgWidget) {
CXFA_LayoutItem* pItem = this;
- FX_FLOAT fLeftInset = 0, fRightInset = 0, fTopInset = 0, fBottomInset = 0;
+ float fLeftInset = 0, fRightInset = 0, fTopInset = 0, fBottomInset = 0;
mgWidget.GetLeftInset(fLeftInset);
mgWidget.GetRightInset(fRightInset);
mgWidget.GetTopInset(fTopInset);
@@ -171,7 +171,7 @@ void CXFA_FFField::CapPlacement() {
}
XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
- FX_FLOAT fCapReserve = 0;
+ float fCapReserve = 0;
CXFA_Caption caption = m_pDataAcc->GetCaption();
if (caption && caption.GetPresence() != XFA_ATTRIBUTEENUM_Hidden) {
iCapPlacement = (XFA_ATTRIBUTEENUM)caption.GetPlacementType();
@@ -260,8 +260,8 @@ void CXFA_FFField::CapTopBottomPlacement(CXFA_Caption caption,
m_rtCaption.top += m_rtCaption.height;
}
}
- FX_FLOAT fWidth = rtUIMargin.left + rtUIMargin.width;
- FX_FLOAT fHeight = m_rtCaption.height + rtUIMargin.top + rtUIMargin.height;
+ float fWidth = rtUIMargin.left + rtUIMargin.width;
+ float fHeight = m_rtCaption.height + rtUIMargin.top + rtUIMargin.height;
if (fWidth > rtWidget.width) {
m_rtUI.width += fWidth - rtWidget.width;
}
@@ -287,8 +287,8 @@ void CXFA_FFField::CapLeftRightPlacement(CXFA_Caption caption,
m_rtCaption.top += m_rtCaption.height;
}
}
- FX_FLOAT fWidth = m_rtCaption.width + rtUIMargin.left + rtUIMargin.width;
- FX_FLOAT fHeight = rtUIMargin.top + rtUIMargin.height;
+ float fWidth = m_rtCaption.width + rtUIMargin.left + rtUIMargin.width;
+ float fHeight = rtUIMargin.top + rtUIMargin.height;
if (fWidth > rtWidget.width) {
m_rtUI.width += fWidth - rtWidget.width;
if (iCapPlacement == XFA_ATTRIBUTEENUM_Right) {
@@ -323,7 +323,7 @@ void CXFA_FFField::SetFWLRect() {
if (rtUi.width < 1.0)
rtUi.width = 1.0;
if (!m_pDataAcc->GetDoc()->GetXFADoc()->IsInteractive()) {
- FX_FLOAT fFontSize = m_pDataAcc->GetFontSize();
+ float fFontSize = m_pDataAcc->GetFontSize();
if (rtUi.height < fFontSize) {
rtUi.height = fFontSize;
}
@@ -563,7 +563,7 @@ void CXFA_FFField::LayoutCaption() {
if (!pCapTextLayout)
return;
- FX_FLOAT fHeight = 0;
+ float fHeight = 0;
pCapTextLayout->Layout(CFX_SizeF(m_rtCaption.width, m_rtCaption.height),
&fHeight);
if (m_rtCaption.height < fHeight)
diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp
index a0b834b96b..ce6d7db4e2 100644
--- a/xfa/fxfa/app/xfa_ffnotify.cpp
+++ b/xfa/fxfa/app/xfa_ffnotify.cpp
@@ -171,8 +171,8 @@ CXFA_LayoutItem* CXFA_FFNotify::OnCreateLayoutItem(CXFA_Node* pNode) {
}
void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem,
- FX_FLOAT& fCalcWidth,
- FX_FLOAT& fCalcHeight) {
+ float& fCalcWidth,
+ float& fCalcHeight) {
CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData());
if (!pAcc)
return;
@@ -182,7 +182,7 @@ void CXFA_FFNotify::StartFieldDrawLayout(CXFA_Node* pItem,
bool CXFA_FFNotify::FindSplitPos(CXFA_Node* pItem,
int32_t iBlockIndex,
- FX_FLOAT& fCalcHeightPos) {
+ float& fCalcHeightPos) {
CXFA_WidgetAcc* pAcc = static_cast<CXFA_WidgetAcc*>(pItem->GetWidgetData());
return pAcc && pAcc->FindSplitPos(iBlockIndex, fCalcHeightPos);
}
diff --git a/xfa/fxfa/app/xfa_ffnotify.h b/xfa/fxfa/app/xfa_ffnotify.h
index f76d35b639..c002ed4c15 100644
--- a/xfa/fxfa/app/xfa_ffnotify.h
+++ b/xfa/fxfa/app/xfa_ffnotify.h
@@ -44,11 +44,11 @@ class CXFA_FFNotify {
CXFA_LayoutItem* pSender);
void StartFieldDrawLayout(CXFA_Node* pItem,
- FX_FLOAT& fCalcWidth,
- FX_FLOAT& fCalcHeight);
+ float& fCalcWidth,
+ float& fCalcHeight);
bool FindSplitPos(CXFA_Node* pItem,
int32_t iBlockIndex,
- FX_FLOAT& fCalcHeightPos);
+ float& fCalcHeightPos);
bool RunScript(CXFA_Node* pScript, CXFA_Node* pFormItem);
int32_t ExecEventByDeepFirst(CXFA_Node* pFormNode,
XFA_EVENTTYPE eEventType,
diff --git a/xfa/fxfa/app/xfa_ffpageview.cpp b/xfa/fxfa/app/xfa_ffpageview.cpp
index 181f0f19a5..d54e1472a1 100644
--- a/xfa/fxfa/app/xfa_ffpageview.cpp
+++ b/xfa/fxfa/app/xfa_ffpageview.cpp
@@ -35,37 +35,29 @@ CFX_Matrix GetPageMatrix(const CFX_RectF& docPageRect,
bool bFlipY = (dwCoordinatesType & 0x02) != 0;
CFX_Matrix m((bFlipX ? -1.0f : 1.0f), 0, 0, (bFlipY ? -1.0f : 1.0f), 0, 0);
if (iRotate == 0 || iRotate == 2) {
- m.a *= (FX_FLOAT)devicePageRect.width / docPageRect.width;
- m.d *= (FX_FLOAT)devicePageRect.height / docPageRect.height;
+ m.a *= (float)devicePageRect.width / docPageRect.width;
+ m.d *= (float)devicePageRect.height / docPageRect.height;
} else {
- m.a *= (FX_FLOAT)devicePageRect.height / docPageRect.width;
- m.d *= (FX_FLOAT)devicePageRect.width / docPageRect.height;
+ m.a *= (float)devicePageRect.height / docPageRect.width;
+ m.d *= (float)devicePageRect.width / docPageRect.height;
}
m.Rotate(iRotate * 1.57079632675f);
switch (iRotate) {
case 0:
- m.e = bFlipX ? (FX_FLOAT)devicePageRect.right()
- : (FX_FLOAT)devicePageRect.left;
- m.f = bFlipY ? (FX_FLOAT)devicePageRect.bottom()
- : (FX_FLOAT)devicePageRect.top;
+ m.e = bFlipX ? (float)devicePageRect.right() : (float)devicePageRect.left;
+ m.f = bFlipY ? (float)devicePageRect.bottom() : (float)devicePageRect.top;
break;
case 1:
- m.e = bFlipY ? (FX_FLOAT)devicePageRect.left
- : (FX_FLOAT)devicePageRect.right();
- m.f = bFlipX ? (FX_FLOAT)devicePageRect.bottom()
- : (FX_FLOAT)devicePageRect.top;
+ m.e = bFlipY ? (float)devicePageRect.left : (float)devicePageRect.right();
+ m.f = bFlipX ? (float)devicePageRect.bottom() : (float)devicePageRect.top;
break;
case 2:
- m.e = bFlipX ? (FX_FLOAT)devicePageRect.left
- : (FX_FLOAT)devicePageRect.right();
- m.f = bFlipY ? (FX_FLOAT)devicePageRect.top
- : (FX_FLOAT)devicePageRect.bottom();
+ m.e = bFlipX ? (float)devicePageRect.left : (float)devicePageRect.right();
+ m.f = bFlipY ? (float)devicePageRect.top : (float)devicePageRect.bottom();
break;
case 3:
- m.e = bFlipY ? (FX_FLOAT)devicePageRect.right()
- : (FX_FLOAT)devicePageRect.left;
- m.f = bFlipX ? (FX_FLOAT)devicePageRect.top
- : (FX_FLOAT)devicePageRect.bottom();
+ m.e = bFlipY ? (float)devicePageRect.right() : (float)devicePageRect.left;
+ m.f = bFlipX ? (float)devicePageRect.top : (float)devicePageRect.bottom();
break;
default:
break;
@@ -367,7 +359,7 @@ static int32_t XFA_TabOrderWidgetComparator(const void* phWidget1,
auto* param2 = *static_cast<CXFA_TabParam**>(const_cast<void*>(phWidget2));
CFX_RectF rt1 = param1->m_pWidget->GetWidgetRect();
CFX_RectF rt2 = param2->m_pWidget->GetWidgetRect();
- FX_FLOAT x1 = rt1.left, y1 = rt1.top, x2 = rt2.left, y2 = rt2.top;
+ float x1 = rt1.left, y1 = rt1.top, x2 = rt2.left, y2 = rt2.top;
if (y1 < y2 || (y1 - y2 < XFA_FLOAT_PERCISION && x1 < x2))
return -1;
return 1;
diff --git a/xfa/fxfa/app/xfa_ffpath.cpp b/xfa/fxfa/app/xfa_ffpath.cpp
index 43016fe5c6..186d1b1dbd 100644
--- a/xfa/fxfa/app/xfa_ffpath.cpp
+++ b/xfa/fxfa/app/xfa_ffpath.cpp
@@ -20,8 +20,8 @@ CXFA_FFLine::~CXFA_FFLine() {}
void CXFA_FFLine::GetRectFromHand(CFX_RectF& rect,
int32_t iHand,
- FX_FLOAT fLineWidth) {
- FX_FLOAT fHalfWidth = fLineWidth / 2.0f;
+ float fLineWidth) {
+ float fHalfWidth = fLineWidth / 2.0f;
if (rect.height < 1.0f) {
switch (iHand) {
case XFA_ATTRIBUTEENUM_Left:
@@ -64,7 +64,7 @@ void CXFA_FFLine::RenderWidget(CFX_Graphics* pGS,
CXFA_Line lineObj = value.GetLine();
FX_ARGB lineColor = 0xFF000000;
int32_t iStrokeType = 0;
- FX_FLOAT fLineWidth = 1.0f;
+ float fLineWidth = 1.0f;
int32_t iCap = 0;
CXFA_Edge edge = lineObj.GetEdge();
if (edge) {
diff --git a/xfa/fxfa/app/xfa_ffpath.h b/xfa/fxfa/app/xfa_ffpath.h
index 002f75d262..6df53f4e1d 100644
--- a/xfa/fxfa/app/xfa_ffpath.h
+++ b/xfa/fxfa/app/xfa_ffpath.h
@@ -20,7 +20,7 @@ class CXFA_FFLine : public CXFA_FFDraw {
uint32_t dwStatus) override;
private:
- void GetRectFromHand(CFX_RectF& rect, int32_t iHand, FX_FLOAT fLineWidth);
+ void GetRectFromHand(CFX_RectF& rect, int32_t iHand, float fLineWidth);
};
class CXFA_FFArc : public CXFA_FFDraw {
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.cpp b/xfa/fxfa/app/xfa_ffpushbutton.cpp
index 7b6be82035..7989e3207d 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.cpp
+++ b/xfa/fxfa/app/xfa_ffpushbutton.cpp
@@ -117,7 +117,7 @@ bool CXFA_FFPushButton::PerformLayout() {
return true;
}
-FX_FLOAT CXFA_FFPushButton::GetLineWidth() {
+float CXFA_FFPushButton::GetLineWidth() {
CXFA_Border border = m_pDataAcc->GetBorder();
if (border && border.GetPresence() == XFA_ATTRIBUTEENUM_Visible) {
CXFA_Edge edge = border.GetEdge(0);
@@ -210,7 +210,7 @@ void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics,
if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
(m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
CFX_RectF rtFill(0, 0, m_pNormalWidget->GetWidgetRect().Size());
- FX_FLOAT fLineWith = GetLineWidth();
+ float fLineWith = GetLineWidth();
rtFill.Deflate(fLineWith, fLineWith);
CFX_Color cr(FXARGB_MAKE(128, 128, 255, 255));
pGraphics->SetFillColor(&cr);
@@ -223,7 +223,7 @@ void CXFA_FFPushButton::OnDrawWidget(CFX_Graphics* pGraphics,
XFA_FWL_PSBSTYLEEXT_HiliteOutLine) {
if ((m_pNormalWidget->GetStates() & FWL_STATE_PSB_Pressed) &&
(m_pNormalWidget->GetStates() & FWL_STATE_PSB_Hovered)) {
- FX_FLOAT fLineWidth = GetLineWidth();
+ float fLineWidth = GetLineWidth();
CFX_Color cr(FXARGB_MAKE(255, 128, 255, 255));
pGraphics->SetStrokeColor(&cr);
pGraphics->SetLineWidth(fLineWidth);
diff --git a/xfa/fxfa/app/xfa_ffpushbutton.h b/xfa/fxfa/app/xfa_ffpushbutton.h
index eb18ccb11c..70853e8942 100644
--- a/xfa/fxfa/app/xfa_ffpushbutton.h
+++ b/xfa/fxfa/app/xfa_ffpushbutton.h
@@ -38,7 +38,7 @@ class CXFA_FFPushButton : public CXFA_FFField {
void LoadHighlightCaption();
void LayoutHighlightCaption();
void RenderHighlightCaption(CFX_Graphics* pGS, CFX_Matrix* pMatrix = nullptr);
- FX_FLOAT GetLineWidth();
+ float GetLineWidth();
FX_ARGB GetLineColor();
FX_ARGB GetFillColor();
diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp
index 04de9d918a..c4b533f855 100644
--- a/xfa/fxfa/app/xfa_fftext.cpp
+++ b/xfa/fxfa/app/xfa_fftext.cpp
@@ -46,10 +46,10 @@ void CXFA_FFText::RenderWidget(CFX_Graphics* pGS,
if (!pItem->GetPrev() && !pItem->GetNext()) {
XFA_RectWidthoutMargin(rtText, mgWidget);
} else {
- FX_FLOAT fLeftInset;
- FX_FLOAT fRightInset;
- FX_FLOAT fTopInset = 0;
- FX_FLOAT fBottomInset = 0;
+ float fLeftInset;
+ float fRightInset;
+ float fTopInset = 0;
+ float fBottomInset = 0;
mgWidget.GetLeftInset(fLeftInset);
mgWidget.GetRightInset(fRightInset);
if (!pItem->GetPrev())
@@ -91,11 +91,11 @@ bool CXFA_FFText::PerformLayout() {
CFX_RectF rtText = pItem->GetRect(false);
if (CXFA_Margin mgWidget = m_pDataAcc->GetMargin()) {
if (!pItem->GetPrev()) {
- FX_FLOAT fTopInset;
+ float fTopInset;
mgWidget.GetTopInset(fTopInset);
rtText.height -= fTopInset;
} else if (!pItem->GetNext()) {
- FX_FLOAT fBottomInset;
+ float fBottomInset;
mgWidget.GetBottomInset(fBottomInset);
rtText.height -= fBottomInset;
}
diff --git a/xfa/fxfa/app/xfa_ffwidget.cpp b/xfa/fxfa/app/xfa_ffwidget.cpp
index ad175349f6..43bb32feec 100644
--- a/xfa/fxfa/app/xfa_ffwidget.cpp
+++ b/xfa/fxfa/app/xfa_ffwidget.cpp
@@ -57,7 +57,7 @@ CFX_RectF CXFA_FFWidget::RecacheWidgetRect() {
CFX_RectF CXFA_FFWidget::GetRectWithoutRotate() {
CFX_RectF rtWidget = GetWidgetRect();
- FX_FLOAT fValue = 0;
+ float fValue = 0;
switch (m_pDataAcc->GetRotate()) {
case 90:
rtWidget.top = rtWidget.bottom();
@@ -357,8 +357,8 @@ static void XFA_GetMatrix(CFX_Matrix& m,
if (!iRotate) {
return;
}
- FX_FLOAT fAnchorX = 0;
- FX_FLOAT fAnchorY = 0;
+ float fAnchorX = 0;
+ float fAnchorY = 0;
switch (at) {
case XFA_ATTRIBUTEENUM_TopLeft:
fAnchorX = rt.left, fAnchorY = rt.top;
@@ -502,7 +502,7 @@ int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics,
int32_t iCapType) {
switch (iStrokeType) {
case XFA_ATTRIBUTEENUM_DashDot: {
- FX_FLOAT dashArray[] = {4, 1, 2, 1};
+ float dashArray[] = {4, 1, 2, 1};
if (iCapType != XFA_ATTRIBUTEENUM_Butt) {
dashArray[1] = 2;
dashArray[3] = 2;
@@ -511,7 +511,7 @@ int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics,
return FX_DASHSTYLE_DashDot;
}
case XFA_ATTRIBUTEENUM_DashDotDot: {
- FX_FLOAT dashArray[] = {4, 1, 2, 1, 2, 1};
+ float dashArray[] = {4, 1, 2, 1, 2, 1};
if (iCapType != XFA_ATTRIBUTEENUM_Butt) {
dashArray[1] = 2;
dashArray[3] = 2;
@@ -521,7 +521,7 @@ int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics,
return FX_DASHSTYLE_DashDotDot;
}
case XFA_ATTRIBUTEENUM_Dashed: {
- FX_FLOAT dashArray[] = {5, 1};
+ float dashArray[] = {5, 1};
if (iCapType != XFA_ATTRIBUTEENUM_Butt) {
dashArray[1] = 2;
}
@@ -529,7 +529,7 @@ int32_t XFA_StrokeTypeSetLineDash(CFX_Graphics* pGraphics,
return FX_DASHSTYLE_Dash;
}
case XFA_ATTRIBUTEENUM_Dotted: {
- FX_FLOAT dashArray[] = {2, 1};
+ float dashArray[] = {2, 1};
if (iCapType != XFA_ATTRIBUTEENUM_Butt) {
dashArray[1] = 2;
}
@@ -849,12 +849,12 @@ void XFA_DrawImage(CFX_Graphics* pGS,
CFX_RectF rtFit(
rtImage.TopLeft(),
- XFA_UnitPx2Pt((FX_FLOAT)pDIBitmap->GetWidth(), (FX_FLOAT)iImageXDpi),
- XFA_UnitPx2Pt((FX_FLOAT)pDIBitmap->GetHeight(), (FX_FLOAT)iImageYDpi));
+ XFA_UnitPx2Pt((float)pDIBitmap->GetWidth(), (float)iImageXDpi),
+ XFA_UnitPx2Pt((float)pDIBitmap->GetHeight(), (float)iImageYDpi));
switch (iAspect) {
case XFA_ATTRIBUTEENUM_Fit: {
- FX_FLOAT f1 = rtImage.height / rtFit.height;
- FX_FLOAT f2 = rtImage.width / rtFit.width;
+ float f1 = rtImage.height / rtFit.height;
+ float f2 = rtImage.width / rtFit.width;
f1 = std::min(f1, f2);
rtFit.height = rtFit.height * f1;
rtFit.width = rtFit.width * f1;
@@ -862,7 +862,7 @@ void XFA_DrawImage(CFX_Graphics* pGS,
case XFA_ATTRIBUTEENUM_Actual:
break;
case XFA_ATTRIBUTEENUM_Height: {
- FX_FLOAT f1 = rtImage.height / rtFit.height;
+ float f1 = rtImage.height / rtFit.height;
rtFit.height = rtImage.height;
rtFit.width = f1 * rtFit.width;
} break;
@@ -871,7 +871,7 @@ void XFA_DrawImage(CFX_Graphics* pGS,
rtFit.width = rtImage.width;
break;
case XFA_ATTRIBUTEENUM_Width: {
- FX_FLOAT f1 = rtImage.width / rtFit.width;
+ float f1 = rtImage.width / rtFit.width;
rtFit.width = rtImage.width;
rtFit.height = rtFit.height * f1;
} break;
@@ -1137,8 +1137,8 @@ CFX_DIBitmap* XFA_LoadImageFromBuffer(
dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI * 2.54f);
break;
case FXCODEC_RESUNIT_METER:
- dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI / (FX_FLOAT)100 * 2.54f);
- dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI / (FX_FLOAT)100 * 2.54f);
+ dibAttr.m_nXDPI = (int32_t)(dibAttr.m_nXDPI / (float)100 * 2.54f);
+ dibAttr.m_nYDPI = (int32_t)(dibAttr.m_nYDPI / (float)100 * 2.54f);
break;
default:
break;
@@ -1171,7 +1171,7 @@ void XFA_RectWidthoutMargin(CFX_RectF& rt, const CXFA_Margin& mg, bool bUI) {
if (!mg) {
return;
}
- FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset;
+ float fLeftInset, fTopInset, fRightInset, fBottomInset;
mg.GetLeftInset(fLeftInset);
mg.GetTopInset(fTopInset);
mg.GetRightInset(fRightInset);
@@ -1191,7 +1191,7 @@ static void XFA_BOX_GetPath_Arc(CXFA_Box box,
CFX_RectF rtDraw,
CFX_Path& fillPath,
uint32_t dwFlags) {
- FX_FLOAT a, b;
+ float a, b;
a = rtDraw.width / 2.0f;
b = rtDraw.height / 2.0f;
if (box.IsCircular() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) {
@@ -1202,7 +1202,7 @@ static void XFA_BOX_GetPath_Arc(CXFA_Box box,
rtDraw.top = center.y - b;
rtDraw.width = a + a;
rtDraw.height = b + b;
- FX_FLOAT startAngle = 0, sweepAngle = 360;
+ float startAngle = 0, sweepAngle = 360;
bool bStart = box.GetStartAngle(startAngle);
bool bEnd = box.GetSweepAngle(sweepAngle);
if (!bStart && !bEnd) {
@@ -1225,14 +1225,14 @@ static void XFA_BOX_GetPath(CXFA_Box box,
int32_t n = (nIndex & 1) ? nIndex - 1 : nIndex;
CXFA_Corner corner1(strokes[n].GetNode());
CXFA_Corner corner2(strokes[(n + 2) % 8].GetNode());
- FX_FLOAT fRadius1 = bCorner ? corner1.GetRadius() : 0.0f;
- FX_FLOAT fRadius2 = bCorner ? corner2.GetRadius() : 0.0f;
+ float fRadius1 = bCorner ? corner1.GetRadius() : 0.0f;
+ float fRadius2 = bCorner ? corner2.GetRadius() : 0.0f;
bool bInverted = corner1.IsInverted();
- FX_FLOAT offsetY = 0.0f;
- FX_FLOAT offsetX = 0.0f;
+ float offsetY = 0.0f;
+ float offsetX = 0.0f;
bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round;
- FX_FLOAT halfAfter = 0.0f;
- FX_FLOAT halfBefore = 0.0f;
+ float halfAfter = 0.0f;
+ float halfBefore = 0.0f;
CXFA_Stroke stroke = strokes[nIndex];
if (stroke.IsCorner()) {
CXFA_Stroke edgeBefore = strokes[(nIndex + 1 * 8 - 1) % 8];
@@ -1253,14 +1253,14 @@ static void XFA_BOX_GetPath(CXFA_Box box,
halfAfter = edgeAfter.GetThickness() / 2;
}
}
- FX_FLOAT offsetEX = 0.0f;
- FX_FLOAT offsetEY = 0.0f;
- FX_FLOAT sx = 0.0f;
- FX_FLOAT sy = 0.0f;
- FX_FLOAT vx = 1.0f;
- FX_FLOAT vy = 1.0f;
- FX_FLOAT nx = 1.0f;
- FX_FLOAT ny = 1.0f;
+ float offsetEX = 0.0f;
+ float offsetEY = 0.0f;
+ float sx = 0.0f;
+ float sy = 0.0f;
+ float vx = 1.0f;
+ float vy = 1.0f;
+ float nx = 1.0f;
+ float ny = 1.0f;
CFX_PointF cpStart;
CFX_PointF cp1;
CFX_PointF cp2;
@@ -1390,11 +1390,11 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
uint16_t dwFlags) {
if (box.IsArc() || (dwFlags & XFA_DRAWBOX_ForceRound) != 0) {
CXFA_Edge edge = box.GetEdge(0);
- FX_FLOAT fThickness = edge.GetThickness();
+ float fThickness = edge.GetThickness();
if (fThickness < 0) {
fThickness = 0;
}
- FX_FLOAT fHalf = fThickness / 2;
+ float fHalf = fThickness / 2;
int32_t iHand = box.GetHand();
if (iHand == XFA_ATTRIBUTEENUM_Left) {
rtWidget.Inflate(fHalf, fHalf);
@@ -1442,17 +1442,17 @@ static void XFA_BOX_GetFillPath(CXFA_Box box,
}
for (int32_t i = 0; i < 8; i += 2) {
- FX_FLOAT sx = 0.0f;
- FX_FLOAT sy = 0.0f;
- FX_FLOAT vx = 1.0f;
- FX_FLOAT vy = 1.0f;
- FX_FLOAT nx = 1.0f;
- FX_FLOAT ny = 1.0f;
+ float sx = 0.0f;
+ float sy = 0.0f;
+ float vx = 1.0f;
+ float vy = 1.0f;
+ float nx = 1.0f;
+ float ny = 1.0f;
CFX_PointF cp1, cp2;
CXFA_Corner corner1(strokes[i].GetNode());
CXFA_Corner corner2(strokes[(i + 2) % 8].GetNode());
- FX_FLOAT fRadius1 = corner1.GetRadius();
- FX_FLOAT fRadius2 = corner2.GetRadius();
+ float fRadius1 = corner1.GetRadius();
+ float fRadius2 = corner2.GetRadius();
bool bInverted = corner1.IsInverted();
bool bRound = corner1.GetJoinType() == XFA_ATTRIBUTEENUM_Round;
if (bRound) {
@@ -1682,7 +1682,7 @@ static void XFA_BOX_StrokePath(CXFA_Stroke stroke,
if (!stroke || !stroke.IsVisible()) {
return;
}
- FX_FLOAT fThickness = stroke.GetThickness();
+ float fThickness = stroke.GetThickness();
if (fThickness < 0.001f) {
return;
}
@@ -1709,14 +1709,14 @@ static void XFA_BOX_StrokeArc(CXFA_Box box,
return;
}
bool bVisible = false;
- FX_FLOAT fThickness = 0;
+ float fThickness = 0;
int32_t i3DType = box.Get3DStyle(bVisible, fThickness);
if (i3DType) {
if (bVisible && fThickness >= 0.001f) {
dwFlags |= XFA_DRAWBOX_Lowered3D;
}
}
- FX_FLOAT fHalf = edge.GetThickness() / 2;
+ float fHalf = edge.GetThickness() / 2;
if (fHalf < 0) {
fHalf = 0;
}
@@ -1739,7 +1739,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box,
pGS->SaveGraphState();
pGS->SetLineWidth(fHalf);
- FX_FLOAT a, b;
+ float a, b;
a = rtWidget.width / 2.0f;
b = rtWidget.height / 2.0f;
if (dwFlags & XFA_DRAWBOX_ForceRound) {
@@ -1753,7 +1753,7 @@ static void XFA_BOX_StrokeArc(CXFA_Box box,
rtWidget.width = a + a;
rtWidget.height = b + b;
- FX_FLOAT startAngle = 0, sweepAngle = 360;
+ float startAngle = 0, sweepAngle = 360;
startAngle = startAngle * FX_PI / 180.0f;
sweepAngle = -sweepAngle * FX_PI / 180.0f;
@@ -1790,14 +1790,14 @@ static void XFA_BOX_StrokeArc(CXFA_Box box,
}
static void XFA_Draw3DRect(CFX_Graphics* pGraphic,
const CFX_RectF& rt,
- FX_FLOAT fLineWidth,
+ float fLineWidth,
CFX_Matrix* pMatrix,
FX_ARGB argbTopLeft,
FX_ARGB argbBottomRight) {
CFX_Color crLT(argbTopLeft);
pGraphic->SetFillColor(&crLT);
- FX_FLOAT fBottom = rt.bottom();
- FX_FLOAT fRight = rt.right();
+ float fBottom = rt.bottom();
+ float fRight = rt.right();
CFX_Path pathLT;
pathLT.MoveTo(CFX_PointF(rt.left, fBottom));
pathLT.LineTo(CFX_PointF(rt.left, rt.top));
@@ -1823,9 +1823,9 @@ static void XFA_Draw3DRect(CFX_Graphics* pGraphic,
}
static void XFA_BOX_Stroke_3DRect_Lowered(CFX_Graphics* pGS,
CFX_RectF rt,
- FX_FLOAT fThickness,
+ float fThickness,
CFX_Matrix* pMatrix) {
- FX_FLOAT fHalfWidth = fThickness / 2.0f;
+ float fHalfWidth = fThickness / 2.0f;
CFX_RectF rtInner(rt);
rtInner.Deflate(fHalfWidth, fHalfWidth);
CFX_Color cr(0xFF000000);
@@ -1838,9 +1838,9 @@ static void XFA_BOX_Stroke_3DRect_Lowered(CFX_Graphics* pGS,
}
static void XFA_BOX_Stroke_3DRect_Raised(CFX_Graphics* pGS,
CFX_RectF rt,
- FX_FLOAT fThickness,
+ float fThickness,
CFX_Matrix* pMatrix) {
- FX_FLOAT fHalfWidth = fThickness / 2.0f;
+ float fHalfWidth = fThickness / 2.0f;
CFX_RectF rtInner(rt);
rtInner.Deflate(fHalfWidth, fHalfWidth);
CFX_Color cr(0xFF000000);
@@ -1853,9 +1853,9 @@ static void XFA_BOX_Stroke_3DRect_Raised(CFX_Graphics* pGS,
}
static void XFA_BOX_Stroke_3DRect_Etched(CFX_Graphics* pGS,
CFX_RectF rt,
- FX_FLOAT fThickness,
+ float fThickness,
CFX_Matrix* pMatrix) {
- FX_FLOAT fHalfWidth = fThickness / 2.0f;
+ float fHalfWidth = fThickness / 2.0f;
XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFFFFFFFF);
CFX_RectF rtInner(rt);
rtInner.Deflate(fHalfWidth, fHalfWidth);
@@ -1863,9 +1863,9 @@ static void XFA_BOX_Stroke_3DRect_Etched(CFX_Graphics* pGS,
}
static void XFA_BOX_Stroke_3DRect_Embossed(CFX_Graphics* pGS,
CFX_RectF rt,
- FX_FLOAT fThickness,
+ float fThickness,
CFX_Matrix* pMatrix) {
- FX_FLOAT fHalfWidth = fThickness / 2.0f;
+ float fHalfWidth = fThickness / 2.0f;
XFA_Draw3DRect(pGS, rt, fThickness, pMatrix, 0xFF808080, 0xFF000000);
CFX_RectF rtInner(rt);
rtInner.Deflate(fHalfWidth, fHalfWidth);
@@ -1877,7 +1877,7 @@ static void XFA_BOX_Stroke_Rect(CXFA_Box box,
CFX_RectF rtWidget,
CFX_Matrix* pMatrix) {
bool bVisible = false;
- FX_FLOAT fThickness = 0;
+ float fThickness = 0;
int32_t i3DType = box.Get3DStyle(bVisible, fThickness);
if (i3DType) {
if (!bVisible || fThickness < 0.001f) {
@@ -1981,11 +1981,11 @@ static void XFA_BOX_Stroke(CXFA_Box box,
}
for (int32_t i = 1; i < 8; i += 2) {
CXFA_Edge edge(strokes[i].GetNode());
- FX_FLOAT fThickness = edge.GetThickness();
+ float fThickness = edge.GetThickness();
if (fThickness < 0) {
fThickness = 0;
}
- FX_FLOAT fHalf = fThickness / 2;
+ float fHalf = fThickness / 2;
int32_t iHand = box.GetHand();
switch (i) {
case 1:
diff --git a/xfa/fxfa/app/xfa_ffwidgetacc.cpp b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
index 655c9da511..52c11508aa 100644
--- a/xfa/fxfa/app/xfa_ffwidgetacc.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgetacc.cpp
@@ -45,7 +45,7 @@ class CXFA_WidgetLayoutData {
CXFA_WidgetLayoutData() : m_fWidgetHeight(-1) {}
virtual ~CXFA_WidgetLayoutData() {}
- FX_FLOAT m_fWidgetHeight;
+ float m_fWidgetHeight;
};
class CXFA_TextLayoutData : public CXFA_WidgetLayoutData {
@@ -128,7 +128,7 @@ class CXFA_FieldLayoutData : public CXFA_WidgetLayoutData {
std::unique_ptr<CXFA_TextLayout> m_pCapTextLayout;
std::unique_ptr<CXFA_TextProvider> m_pCapTextProvider;
std::unique_ptr<CFDE_TextOut> m_pTextOut;
- std::vector<FX_FLOAT> m_FieldSplitArray;
+ std::vector<float> m_FieldSplitArray;
};
class CXFA_TextEditData : public CXFA_FieldLayoutData {
@@ -718,7 +718,7 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
LoadCaption();
XFA_Element eUIType = GetUIType();
int32_t iCapPlacement = caption.GetPlacementType();
- FX_FLOAT fCapReserve = caption.GetReserve();
+ float fCapReserve = caption.GetReserve();
const bool bVert = iCapPlacement == XFA_ATTRIBUTEENUM_Top ||
iCapPlacement == XFA_ATTRIBUTEENUM_Bottom;
const bool bReserveExit = fCapReserve > 0.01;
@@ -735,7 +735,7 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
bVert ? szCap.height = fCapReserve : szCap.width = fCapReserve;
}
} else {
- FX_FLOAT fFontSize = 10.0f;
+ float fFontSize = 10.0f;
if (CXFA_Font font = caption.GetFont()) {
fFontSize = font.GetFontSize();
} else if (CXFA_Font widgetfont = GetFont()) {
@@ -749,7 +749,7 @@ void CXFA_WidgetAcc::CalcCaptionSize(CFX_SizeF& szCap) {
}
}
if (CXFA_Margin mgCap = caption.GetMargin()) {
- FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset;
+ float fLeftInset, fTopInset, fRightInset, fBottomInset;
mgCap.GetLeftInset(fLeftInset);
mgCap.GetTopInset(fTopInset);
mgCap.GetRightInset(fRightInset);
@@ -792,7 +792,7 @@ bool CXFA_WidgetAcc::CalculateFieldAutoSize(CFX_SizeF& size) {
bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
- FX_FLOAT fLeftInset, fTopInset, fRightInset, fBottomInset;
+ float fLeftInset, fTopInset, fRightInset, fBottomInset;
mgWidget.GetLeftInset(fLeftInset);
mgWidget.GetTopInset(fTopInset);
mgWidget.GetRightInset(fRightInset);
@@ -804,9 +804,9 @@ bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
if (para)
size.width += para.GetMarginLeft() + para.GetTextIndent();
- FX_FLOAT fVal = 0;
- FX_FLOAT fMin = 0;
- FX_FLOAT fMax = 0;
+ float fVal = 0;
+ float fMin = 0;
+ float fMax = 0;
if (GetWidth(fVal)) {
size.width = fVal;
} else {
@@ -830,7 +830,7 @@ bool CXFA_WidgetAcc::CalculateWidgetAutoSize(CFX_SizeF& size) {
}
void CXFA_WidgetAcc::CalculateTextContentSize(CFX_SizeF& size) {
- FX_FLOAT fFontSize = GetFontSize();
+ float fFontSize = GetFontSize();
CFX_WideString wsText;
GetValue(wsText, XFA_VALUEPICTURE_Display);
if (wsText.IsEmpty()) {
@@ -885,7 +885,7 @@ bool CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
size.width -= rtUIMargin.left + rtUIMargin.width;
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
- FX_FLOAT fLeftInset, fRightInset;
+ float fLeftInset, fRightInset;
mgWidget.GetLeftInset(fLeftInset);
mgWidget.GetRightInset(fRightInset);
size.width -= fLeftInset + fRightInset;
@@ -914,7 +914,7 @@ bool CXFA_WidgetAcc::CalculateTextEditAutoSize(CFX_SizeF& size) {
return CalculateFieldAutoSize(size);
}
bool CXFA_WidgetAcc::CalculateCheckButtonAutoSize(CFX_SizeF& size) {
- FX_FLOAT fCheckSize = GetCheckButtonSize();
+ float fCheckSize = GetCheckButtonSize();
size = CFX_SizeF(fCheckSize, fCheckSize);
return CalculateFieldAutoSize(size);
}
@@ -932,9 +932,8 @@ bool CXFA_WidgetAcc::CalculateImageAutoSize(CFX_SizeF& size) {
int32_t iImageYDpi = 0;
GetImageDpi(iImageXDpi, iImageYDpi);
CFX_RectF rtImage(
- 0, 0,
- XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetWidth(), (FX_FLOAT)iImageXDpi),
- XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetHeight(), (FX_FLOAT)iImageYDpi));
+ 0, 0, XFA_UnitPx2Pt((float)pBitmap->GetWidth(), (float)iImageXDpi),
+ XFA_UnitPx2Pt((float)pBitmap->GetHeight(), (float)iImageYDpi));
CFX_RectF rtFit;
if (GetWidth(rtFit.width)) {
@@ -961,9 +960,8 @@ bool CXFA_WidgetAcc::CalculateImageEditAutoSize(CFX_SizeF& size) {
int32_t iImageYDpi = 0;
GetImageEditDpi(iImageXDpi, iImageYDpi);
CFX_RectF rtImage(
- 0, 0,
- XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetWidth(), (FX_FLOAT)iImageXDpi),
- XFA_UnitPx2Pt((FX_FLOAT)pBitmap->GetHeight(), (FX_FLOAT)iImageYDpi));
+ 0, 0, XFA_UnitPx2Pt((float)pBitmap->GetWidth(), (float)iImageXDpi),
+ XFA_UnitPx2Pt((float)pBitmap->GetHeight(), (float)iImageYDpi));
CFX_RectF rtFit;
if (GetWidth(rtFit.width)) {
@@ -1017,15 +1015,15 @@ void CXFA_WidgetAcc::LoadText() {
InitLayoutData();
static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get())->LoadText(this);
}
-FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc) {
+float CXFA_WidgetAcc::CalculateWidgetAutoWidth(float fWidthCalc) {
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
- FX_FLOAT fLeftInset, fRightInset;
+ float fLeftInset, fRightInset;
mgWidget.GetLeftInset(fLeftInset);
mgWidget.GetRightInset(fRightInset);
fWidthCalc += fLeftInset + fRightInset;
}
- FX_FLOAT fMin = 0, fMax = 0;
+ float fMin = 0, fMax = 0;
if (GetMinWidth(fMin)) {
fWidthCalc = std::max(fWidthCalc, fMin);
}
@@ -1034,25 +1032,25 @@ FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoWidth(FX_FLOAT fWidthCalc) {
}
return fWidthCalc;
}
-FX_FLOAT CXFA_WidgetAcc::GetWidthWithoutMargin(FX_FLOAT fWidthCalc) {
+float CXFA_WidgetAcc::GetWidthWithoutMargin(float fWidthCalc) {
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
- FX_FLOAT fLeftInset, fRightInset;
+ float fLeftInset, fRightInset;
mgWidget.GetLeftInset(fLeftInset);
mgWidget.GetRightInset(fRightInset);
fWidthCalc -= fLeftInset + fRightInset;
}
return fWidthCalc;
}
-FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc) {
+float CXFA_WidgetAcc::CalculateWidgetAutoHeight(float fHeightCalc) {
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
- FX_FLOAT fTopInset, fBottomInset;
+ float fTopInset, fBottomInset;
mgWidget.GetTopInset(fTopInset);
mgWidget.GetBottomInset(fBottomInset);
fHeightCalc += fTopInset + fBottomInset;
}
- FX_FLOAT fMin = 0, fMax = 0;
+ float fMin = 0, fMax = 0;
if (GetMinHeight(fMin)) {
fHeightCalc = std::max(fHeightCalc, fMin);
}
@@ -1061,18 +1059,17 @@ FX_FLOAT CXFA_WidgetAcc::CalculateWidgetAutoHeight(FX_FLOAT fHeightCalc) {
}
return fHeightCalc;
}
-FX_FLOAT CXFA_WidgetAcc::GetHeightWithoutMargin(FX_FLOAT fHeightCalc) {
+float CXFA_WidgetAcc::GetHeightWithoutMargin(float fHeightCalc) {
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
- FX_FLOAT fTopInset, fBottomInset;
+ float fTopInset, fBottomInset;
mgWidget.GetTopInset(fTopInset);
mgWidget.GetBottomInset(fBottomInset);
fHeightCalc -= fTopInset + fBottomInset;
}
return fHeightCalc;
}
-void CXFA_WidgetAcc::StartWidgetLayout(FX_FLOAT& fCalcWidth,
- FX_FLOAT& fCalcHeight) {
+void CXFA_WidgetAcc::StartWidgetLayout(float& fCalcWidth, float& fCalcHeight) {
InitLayoutData();
XFA_Element eUIType = GetUIType();
if (eUIType == XFA_Element::Text) {
@@ -1085,7 +1082,7 @@ void CXFA_WidgetAcc::StartWidgetLayout(FX_FLOAT& fCalcWidth,
return;
}
m_pLayoutData->m_fWidgetHeight = -1;
- FX_FLOAT fWidth = 0;
+ float fWidth = 0;
if (fCalcWidth > 0 && fCalcHeight < 0) {
if (!GetHeight(fCalcHeight)) {
CalculateAccWidthAndHeight(eUIType, fCalcWidth, fCalcHeight);
@@ -1102,8 +1099,8 @@ void CXFA_WidgetAcc::StartWidgetLayout(FX_FLOAT& fCalcWidth,
m_pLayoutData->m_fWidgetHeight = fCalcHeight;
}
void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_Element eUIType,
- FX_FLOAT& fWidth,
- FX_FLOAT& fCalcHeight) {
+ float& fWidth,
+ float& fCalcHeight) {
CFX_SizeF sz(fWidth, m_pLayoutData->m_fWidgetHeight);
switch (eUIType) {
case XFA_Element::Barcode:
@@ -1143,7 +1140,7 @@ void CXFA_WidgetAcc::CalculateAccWidthAndHeight(XFA_Element eUIType,
m_pLayoutData->m_fWidgetHeight = sz.height;
fCalcHeight = sz.height;
}
-bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
+bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, float& fCalcHeight) {
XFA_Element eUIType = GetUIType();
if (eUIType == XFA_Element::Subform) {
return false;
@@ -1154,8 +1151,8 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
fCalcHeight = 0;
return true;
}
- FX_FLOAT fTopInset = 0;
- FX_FLOAT fBottomInset = 0;
+ float fTopInset = 0;
+ float fBottomInset = 0;
if (iBlockIndex == 0) {
CXFA_Margin mgWidget = GetMargin();
if (mgWidget) {
@@ -1167,7 +1164,7 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
fBottomInset += rtUIMargin.width;
}
if (eUIType == XFA_Element::Text) {
- FX_FLOAT fHeight = fCalcHeight;
+ float fHeight = fCalcHeight;
if (iBlockIndex == 0) {
fCalcHeight = fCalcHeight - fTopInset;
if (fCalcHeight < 0) {
@@ -1189,7 +1186,7 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
return true;
}
XFA_ATTRIBUTEENUM iCapPlacement = XFA_ATTRIBUTEENUM_Unknown;
- FX_FLOAT fCapReserve = 0;
+ float fCapReserve = 0;
if (iBlockIndex == 0) {
CXFA_Caption caption = GetCaption();
if (caption && caption.GetPresence() != XFA_ATTRIBUTEENUM_Hidden) {
@@ -1213,20 +1210,20 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
CXFA_FieldLayoutData* pFieldData =
static_cast<CXFA_FieldLayoutData*>(m_pLayoutData.get());
int32_t iLinesCount = 0;
- FX_FLOAT fHeight = m_pLayoutData->m_fWidgetHeight;
+ float fHeight = m_pLayoutData->m_fWidgetHeight;
CFX_WideString wsText;
GetValue(wsText, XFA_VALUEPICTURE_Display);
if (wsText.IsEmpty()) {
iLinesCount = 1;
} else {
if (!pFieldData->m_pTextOut) {
- FX_FLOAT fWidth = 0;
+ float fWidth = 0;
GetWidth(fWidth);
CalculateAccWidthAndHeight(eUIType, fWidth, fHeight);
}
iLinesCount = pFieldData->m_pTextOut->GetTotalLines();
}
- std::vector<FX_FLOAT>* pFieldArray = &pFieldData->m_FieldSplitArray;
+ std::vector<float>* pFieldArray = &pFieldData->m_FieldSplitArray;
int32_t iFieldSplitCount = pdfium::CollectionSize<int32_t>(*pFieldArray);
for (int32_t i = 0; i < iBlockIndex * 3; i += 3) {
iLinesCount -= (int32_t)(*pFieldArray)[i + 1];
@@ -1235,17 +1232,17 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
if (iLinesCount == 0) {
return false;
}
- FX_FLOAT fLineHeight = GetLineHeight();
- FX_FLOAT fFontSize = GetFontSize();
- FX_FLOAT fTextHeight = iLinesCount * fLineHeight - fLineHeight + fFontSize;
- FX_FLOAT fSpaceAbove = 0;
- FX_FLOAT fStartOffset = 0;
+ float fLineHeight = GetLineHeight();
+ float fFontSize = GetFontSize();
+ float fTextHeight = iLinesCount * fLineHeight - fLineHeight + fFontSize;
+ float fSpaceAbove = 0;
+ float fStartOffset = 0;
if (fHeight > 0.1f && iBlockIndex == 0) {
fStartOffset = fTopInset;
fHeight -= (fTopInset + fBottomInset);
if (CXFA_Para para = GetPara()) {
fSpaceAbove = para.GetSpaceAbove();
- FX_FLOAT fSpaceBelow = para.GetSpaceBelow();
+ float fSpaceBelow = para.GetSpaceBelow();
fHeight -= (fSpaceAbove + fSpaceBelow);
switch (para.GetVerticalAlign()) {
case XFA_ATTRIBUTEENUM_Top:
@@ -1322,17 +1319,17 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
}
return true;
}
- FX_FLOAT fTextNum =
+ float fTextNum =
fCalcHeight + XFA_FLOAT_PERCISION - fCapReserve - fStartOffset;
int32_t iLineNum =
(int32_t)((fTextNum + (fLineHeight - fFontSize)) / fLineHeight);
if (iLineNum >= iLinesCount) {
if (fCalcHeight - fStartOffset - fTextHeight >= fFontSize) {
if (iFieldSplitCount / 3 == (iBlockIndex + 1)) {
- (*pFieldArray)[iBlockIndex * 3 + 1] = (FX_FLOAT)iLinesCount;
+ (*pFieldArray)[iBlockIndex * 3 + 1] = (float)iLinesCount;
(*pFieldArray)[iBlockIndex * 3 + 2] = fCalcHeight;
} else {
- pFieldArray->push_back((FX_FLOAT)iLinesCount);
+ pFieldArray->push_back((float)iLinesCount);
pFieldArray->push_back(fCalcHeight);
}
return false;
@@ -1348,13 +1345,12 @@ bool CXFA_WidgetAcc::FindSplitPos(int32_t iBlockIndex, FX_FLOAT& fCalcHeight) {
}
}
if (iLineNum > 0) {
- FX_FLOAT fSplitHeight =
- iLineNum * fLineHeight + fCapReserve + fStartOffset;
+ float fSplitHeight = iLineNum * fLineHeight + fCapReserve + fStartOffset;
if (iFieldSplitCount / 3 == (iBlockIndex + 1)) {
- (*pFieldArray)[iBlockIndex * 3 + 1] = (FX_FLOAT)iLineNum;
+ (*pFieldArray)[iBlockIndex * 3 + 1] = (float)iLineNum;
(*pFieldArray)[iBlockIndex * 3 + 2] = fSplitHeight;
} else {
- pFieldArray->push_back((FX_FLOAT)iLineNum);
+ pFieldArray->push_back((float)iLineNum);
pFieldArray->push_back(fSplitHeight);
}
if (fabs(fSplitHeight - fCalcHeight) < XFA_FLOAT_PERCISION) {
@@ -1394,14 +1390,13 @@ void CXFA_WidgetAcc::InitLayoutData() {
m_pLayoutData = pdfium::MakeUnique<CXFA_WidgetLayoutData>();
}
-void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth,
- FX_FLOAT& fCalcHeight) {
+void CXFA_WidgetAcc::StartTextLayout(float& fCalcWidth, float& fCalcHeight) {
LoadText();
CXFA_TextLayout* pTextLayout =
static_cast<CXFA_TextLayoutData*>(m_pLayoutData.get())->GetTextLayout();
- FX_FLOAT fTextHeight = 0;
+ float fTextHeight = 0;
if (fCalcWidth > 0 && fCalcHeight > 0) {
- FX_FLOAT fWidth = GetWidthWithoutMargin(fCalcWidth);
+ float fWidth = GetWidthWithoutMargin(fCalcWidth);
pTextLayout->StartLayout(fWidth);
fTextHeight = fCalcHeight;
fTextHeight = GetHeightWithoutMargin(fTextHeight);
@@ -1409,17 +1404,17 @@ void CXFA_WidgetAcc::StartTextLayout(FX_FLOAT& fCalcWidth,
return;
}
if (fCalcWidth > 0 && fCalcHeight < 0) {
- FX_FLOAT fWidth = GetWidthWithoutMargin(fCalcWidth);
+ float fWidth = GetWidthWithoutMargin(fCalcWidth);
pTextLayout->StartLayout(fWidth);
}
if (fCalcWidth < 0 && fCalcHeight < 0) {
- FX_FLOAT fMaxWidth = -1;
+ float fMaxWidth = -1;
bool bRet = GetWidth(fMaxWidth);
if (bRet) {
- FX_FLOAT fWidth = GetWidthWithoutMargin(fMaxWidth);
+ float fWidth = GetWidthWithoutMargin(fMaxWidth);
pTextLayout->StartLayout(fWidth);
} else {
- FX_FLOAT fWidth = pTextLayout->StartLayout(fMaxWidth);
+ float fWidth = pTextLayout->StartLayout(fMaxWidth);
fMaxWidth = CalculateWidgetAutoWidth(fWidth);
fWidth = GetWidthWithoutMargin(fMaxWidth);
pTextLayout->StartLayout(fWidth);
@@ -1509,15 +1504,15 @@ CFX_RetainPtr<CFGAS_GEFont> CXFA_WidgetAcc::GetFDEFont() {
return pDoc->GetApp()->GetXFAFontMgr()->GetFont(pDoc, wsFontName,
dwFontStyle);
}
-FX_FLOAT CXFA_WidgetAcc::GetFontSize() {
- FX_FLOAT fFontSize = 10.0f;
+float CXFA_WidgetAcc::GetFontSize() {
+ float fFontSize = 10.0f;
if (CXFA_Font font = GetFont()) {
fFontSize = font.GetFontSize();
}
return fFontSize < 0.1f ? 10.0f : fFontSize;
}
-FX_FLOAT CXFA_WidgetAcc::GetLineHeight() {
- FX_FLOAT fLineHeight = 0;
+float CXFA_WidgetAcc::GetLineHeight() {
+ float fLineHeight = 0;
if (CXFA_Para para = GetPara()) {
fLineHeight = para.GetLineHeight();
}
@@ -1636,7 +1631,7 @@ CXFA_Font CXFA_TextProvider::GetFontNode() {
bool CXFA_TextProvider::IsCheckButtonAndAutoWidth() {
XFA_Element eType = m_pWidgetAcc->GetUIType();
if (eType == XFA_Element::CheckButton) {
- FX_FLOAT fWidth = 0;
+ float fWidth = 0;
return !m_pWidgetAcc->GetWidth(fWidth);
}
return false;
diff --git a/xfa/fxfa/app/xfa_ffwidgethandler.cpp b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
index 2fddfb6156..dc3850c778 100644
--- a/xfa/fxfa/app/xfa_ffwidgethandler.cpp
+++ b/xfa/fxfa/app/xfa_ffwidgethandler.cpp
@@ -499,7 +499,7 @@ CXFA_Node* CXFA_FFWidgetHandler::CreateFontNode(CXFA_Node* pParent) const {
CXFA_Node* CXFA_FFWidgetHandler::CreateMarginNode(CXFA_Node* pParent,
uint32_t dwFlags,
- FX_FLOAT fInsets[4]) const {
+ float fInsets[4]) const {
CXFA_Node* pMargin = CreateCopyNode(XFA_Element::Margin, pParent);
if (dwFlags & 0x01)
pMargin->SetMeasure(XFA_ATTRIBUTE_LeftInset,
diff --git a/xfa/fxfa/app/xfa_fwladapter.cpp b/xfa/fxfa/app/xfa_fwladapter.cpp
index e1f3e202ed..af578fcf8f 100644
--- a/xfa/fxfa/app/xfa_fwladapter.cpp
+++ b/xfa/fxfa/app/xfa_fwladapter.cpp
@@ -25,8 +25,8 @@ void CXFA_FWLAdapterWidgetMgr::RepaintWidget(CFWL_Widget* pWidget) {
}
bool CXFA_FWLAdapterWidgetMgr::GetPopupPos(CFWL_Widget* pWidget,
- FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
+ float fMinHeight,
+ float fMaxHeight,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup) {
CXFA_FFWidget* pFFWidget = pWidget->GetLayoutItem();
diff --git a/xfa/fxfa/app/xfa_fwladapter.h b/xfa/fxfa/app/xfa_fwladapter.h
index c68fb7015f..b4a3481588 100644
--- a/xfa/fxfa/app/xfa_fwladapter.h
+++ b/xfa/fxfa/app/xfa_fwladapter.h
@@ -19,8 +19,8 @@ class CXFA_FWLAdapterWidgetMgr {
void RepaintWidget(CFWL_Widget* pWidget);
bool GetPopupPos(CFWL_Widget* pWidget,
- FX_FLOAT fMinHeight,
- FX_FLOAT fMaxHeight,
+ float fMinHeight,
+ float fMaxHeight,
const CFX_RectF& rtAnchor,
CFX_RectF& rtPopup);
};
diff --git a/xfa/fxfa/app/xfa_textpiece.h b/xfa/fxfa/app/xfa_textpiece.h
index 6802df5566..fd1f3bdbaa 100644
--- a/xfa/fxfa/app/xfa_textpiece.h
+++ b/xfa/fxfa/app/xfa_textpiece.h
@@ -32,7 +32,7 @@ class XFA_TextPiece {
int32_t iPeriod;
int32_t iLineThrough;
FX_ARGB dwColor;
- FX_FLOAT fFontSize;
+ float fFontSize;
CFX_RectF rtPiece;
CFX_RetainPtr<CFGAS_GEFont> pFont;
CFX_RetainPtr<CXFA_LinkUserData> pLinkData;