summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
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/fxbarcode/oned/BC_OnedEAN8Writer.cpp
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/fxbarcode/oned/BC_OnedEAN8Writer.cpp')
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
index cd21759a19..5f571c2a30 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -185,7 +185,7 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents,
CFX_ByteString tempStr = str.Mid(0, 4);
int32_t iLen = tempStr.GetLength();
int32_t strWidth = 7 * multiple * 4;
- FX_FLOAT blank = 0.0;
+ float blank = 0.0;
CFX_FxgeDevice geBitmap;
if (pOutBitmap)
geBitmap.Attach(pOutBitmap, false, nullptr, false);
@@ -194,19 +194,17 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents,
int32_t iTextHeight = iFontSize + 1;
if (!pOutBitmap) {
CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
- CFX_FloatRect rect(
- (FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight),
- (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height);
+ CFX_FloatRect rect((float)leftPosition, (float)(m_Height - iTextHeight),
+ (float)(leftPosition + strWidth - 0.5), (float)m_Height);
matr.Concat(*matrix);
matr.TransformRect(rect);
FX_RECT re = rect.GetOuterRect();
device->FillRect(&re, m_backgroundColor);
CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
- CFX_FloatRect rect1(
- (FX_FLOAT)(leftPosition + 33 * multiple),
- (FX_FLOAT)(m_Height - iTextHeight),
- (FX_FLOAT)(leftPosition + 33 * multiple + strWidth - 0.5),
- (FX_FLOAT)m_Height);
+ CFX_FloatRect rect1((float)(leftPosition + 33 * multiple),
+ (float)(m_Height - iTextHeight),
+ (float)(leftPosition + 33 * multiple + strWidth - 0.5),
+ (float)m_Height);
matr1.Concat(*matrix);
matr1.TransformRect(rect1);
re = rect1.GetOuterRect();
@@ -215,49 +213,48 @@ void CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents,
if (!pOutBitmap)
strWidth = (int32_t)(strWidth * m_outputHScale);
- CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize,
- blank);
- CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize);
+ CalcTextInfo(tempStr, pCharPos, m_pFont, (float)strWidth, iFontSize, blank);
+ CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (float)iFontSize);
CFX_FxgeDevice ge;
if (pOutBitmap) {
delete ge.GetBitmap();
ge.Create(strWidth, iTextHeight, FXDIB_Argb, nullptr);
ge.GetBitmap()->Clear(m_backgroundColor);
- ge.DrawNormalText(iLen, pCharPos, m_pFont, static_cast<FX_FLOAT>(iFontSize),
+ ge.DrawNormalText(iLen, pCharPos, m_pFont, static_cast<float>(iFontSize),
&affine_matrix, m_fontColor, FXTEXT_CLEARTYPE);
geBitmap.SetDIBits(ge.GetBitmap(), leftPosition, m_Height - iTextHeight);
} else {
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0,
- (FX_FLOAT)leftPosition * m_outputHScale,
- (FX_FLOAT)(m_Height - iTextHeight + iFontSize));
+ (float)leftPosition * m_outputHScale,
+ (float)(m_Height - iTextHeight + iFontSize));
affine_matrix1.Concat(*matrix);
device->DrawNormalText(iLen, pCharPos, m_pFont,
- static_cast<FX_FLOAT>(iFontSize), &affine_matrix1,
+ static_cast<float>(iFontSize), &affine_matrix1,
m_fontColor, FXTEXT_CLEARTYPE);
}
tempStr = str.Mid(4, 4);
iLen = tempStr.GetLength();
- CalcTextInfo(tempStr, pCharPos + 4, m_pFont, (FX_FLOAT)strWidth, iFontSize,
+ CalcTextInfo(tempStr, pCharPos + 4, m_pFont, (float)strWidth, iFontSize,
blank);
if (pOutBitmap) {
delete ge.GetBitmap();
ge.Create(strWidth, iTextHeight, FXDIB_Argb, nullptr);
ge.GetBitmap()->Clear(m_backgroundColor);
ge.DrawNormalText(iLen, pCharPos + 4, m_pFont,
- static_cast<FX_FLOAT>(iFontSize), &affine_matrix,
+ static_cast<float>(iFontSize), &affine_matrix,
m_fontColor, FXTEXT_CLEARTYPE);
geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 33 * multiple,
m_Height - iTextHeight);
} else {
CFX_Matrix affine_matrix1(
1.0, 0.0, 0.0, -1.0,
- (FX_FLOAT)(leftPosition + 33 * multiple) * m_outputHScale,
- (FX_FLOAT)(m_Height - iTextHeight + iFontSize));
+ (float)(leftPosition + 33 * multiple) * m_outputHScale,
+ (float)(m_Height - iTextHeight + iFontSize));
if (matrix) {
affine_matrix1.Concat(*matrix);
}
device->DrawNormalText(iLen, pCharPos + 4, m_pFont,
- static_cast<FX_FLOAT>(iFontSize), &affine_matrix1,
+ static_cast<float>(iFontSize), &affine_matrix1,
m_fontColor, FXTEXT_CLEARTYPE);
}
FX_Free(pCharPos);