diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2017-03-14 14:43:42 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-14 19:05:58 +0000 |
commit | 05df075154a832fcb476e1dfcfb865722d0ea898 (patch) | |
tree | b8b771b62adae74d5d5ee561db75d10de3a848bf /xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp | |
parent | 6b94f01d1c8ad386d497428c7397b1a99614aeba (diff) | |
download | pdfium-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_OnedUPCAWriter.cpp')
-rw-r--r-- | xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp | 63 |
1 files changed, 30 insertions, 33 deletions
diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 3cb72f204a..cefae97d8d 100644 --- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -136,8 +136,8 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen); FXSYS_memset(pCharPos, 0, sizeof(FXTEXT_CHARPOS) * iLen); CFX_ByteString tempStr = str.Mid(1, 5); - FX_FLOAT strWidth = (FX_FLOAT)35 * multiple; - FX_FLOAT blank = 0.0; + float strWidth = (float)35 * multiple; + float blank = 0.0; CFX_FxgeDevice geBitmap; if (pOutBitmap) geBitmap.Attach(pOutBitmap, false, nullptr, false); @@ -147,37 +147,34 @@ void CBC_OnedUPCAWriter::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 + 40 * multiple), - (FX_FLOAT)(m_Height - iTextHeight), - (FX_FLOAT)((leftPosition + 40 * multiple) + strWidth - 0.5), - (FX_FLOAT)m_Height); + (float)(leftPosition + 40 * multiple), (float)(m_Height - iTextHeight), + (float)((leftPosition + 40 * multiple) + strWidth - 0.5), + (float)m_Height); matr1.Concat(*matrix); matr1.TransformRect(rect1); re = rect1.GetOuterRect(); device->FillRect(&re, m_backgroundColor); - FX_FLOAT strWidth1 = (FX_FLOAT)multiple * 7; + float strWidth1 = (float)multiple * 7; CFX_Matrix matr2(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); - CFX_FloatRect rect2(0.0, (FX_FLOAT)(m_Height - iTextHeight), - (FX_FLOAT)strWidth1 - 1, (FX_FLOAT)m_Height); + CFX_FloatRect rect2(0.0, (float)(m_Height - iTextHeight), + (float)strWidth1 - 1, (float)m_Height); matr2.Concat(*matrix); matr2.TransformRect(rect2); re = rect2.GetOuterRect(); device->FillRect(&re, m_backgroundColor); CFX_Matrix matr3(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); CFX_FloatRect rect3( - (FX_FLOAT)(leftPosition + 85 * multiple), - (FX_FLOAT)(m_Height - iTextHeight), - (FX_FLOAT)((leftPosition + 85 * multiple) + strWidth1 - 0.5), - (FX_FLOAT)m_Height); + (float)(leftPosition + 85 * multiple), (float)(m_Height - iTextHeight), + (float)((leftPosition + 85 * multiple) + strWidth1 - 0.5), + (float)m_Height); matr3.Concat(*matrix); matr3.TransformRect(rect3); re = rect3.GetOuterRect(); @@ -187,24 +184,24 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, strWidth = strWidth * m_outputHScale; CalcTextInfo(tempStr, pCharPos + 1, m_pFont, strWidth, iFontSize, blank); - CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); + CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (float)iFontSize); CFX_FxgeDevice ge; if (pOutBitmap) { ge.Create((int)strWidth, iTextHeight, FXDIB_Argb, nullptr); ge.GetBitmap()->Clear(m_backgroundColor); ge.DrawNormalText(iLen, pCharPos + 1, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix, + 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)); if (matrix) { affine_matrix1.Concat(*matrix); } device->DrawNormalText(iLen, pCharPos + 1, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix1, + static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(6, 5); @@ -214,25 +211,25 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, FX_RECT rect2(0, 0, (int)strWidth, iTextHeight); ge.FillRect(&rect2, m_backgroundColor); ge.DrawNormalText(iLen, pCharPos + 6, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix, + static_cast<float>(iFontSize), &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 40 * multiple, m_Height - iTextHeight); } else { CFX_Matrix affine_matrix1( 1.0, 0.0, 0.0, -1.0, - (FX_FLOAT)(leftPosition + 40 * multiple) * m_outputHScale, - (FX_FLOAT)(m_Height - iTextHeight + iFontSize)); + (float)(leftPosition + 40 * multiple) * m_outputHScale, + (float)(m_Height - iTextHeight + iFontSize)); if (matrix) { affine_matrix1.Concat(*matrix); } device->DrawNormalText(iLen, pCharPos + 6, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix1, + static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(0, 1); iLen = tempStr.GetLength(); - strWidth = (FX_FLOAT)multiple * 7; + strWidth = (float)multiple * 7; if (!pOutBitmap) strWidth = strWidth * m_outputHScale; @@ -241,17 +238,17 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, delete ge.GetBitmap(); ge.Create((int)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(), 0, m_Height - iTextHeight); } else { CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, 0, - (FX_FLOAT)(m_Height - iTextHeight + iFontSize)); + (float)(m_Height - iTextHeight + iFontSize)); if (matrix) { 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(11, 1); @@ -262,20 +259,20 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, ge.Create((int)strWidth, iTextHeight, FXDIB_Argb, nullptr); ge.GetBitmap()->Clear(m_backgroundColor); ge.DrawNormalText(iLen, pCharPos + 11, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix, + static_cast<float>(iFontSize), &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 85 * multiple, m_Height - iTextHeight); } else { CFX_Matrix affine_matrix1( 1.0, 0.0, 0.0, -1.0, - (FX_FLOAT)(leftPosition + 85 * multiple) * m_outputHScale, - (FX_FLOAT)(m_Height - iTextHeight + iFontSize)); + (float)(leftPosition + 85 * multiple) * m_outputHScale, + (float)(m_Height - iTextHeight + iFontSize)); if (matrix) { affine_matrix1.Concat(*matrix); } device->DrawNormalText(iLen, pCharPos + 11, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix1, + static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } FX_Free(pCharPos); |