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 | |
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')
-rw-r--r-- | xfa/fxbarcode/BC_TwoDimWriter.cpp | 26 | ||||
-rw-r--r-- | xfa/fxbarcode/cbc_onecode.cpp | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/cbc_onecode.h | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp | 10 | ||||
-rw-r--r-- | xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h | 2 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OneDimWriter.cpp | 90 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OneDimWriter.h | 22 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp | 51 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp | 39 | ||||
-rw-r--r-- | xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp | 63 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417.cpp | 4 | ||||
-rw-r--r-- | xfa/fxbarcode/pdf417/BC_PDF417.h | 6 |
12 files changed, 152 insertions, 165 deletions
diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp index b9aae361d6..328352c6c1 100644 --- a/xfa/fxbarcode/BC_TwoDimWriter.cpp +++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp @@ -23,7 +23,7 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, const CFX_Matrix* matrix) { CFX_GraphStateData stateData; CFX_PathData path; - path.AppendRect(0, 0, (FX_FLOAT)m_Width, (FX_FLOAT)m_Height); + path.AppendRect(0, 0, (float)m_Width, (float)m_Height); device->DrawPath(&path, matrix, &stateData, m_backgroundColor, m_backgroundColor, FXFILL_ALTERNATE); int32_t leftPos = 0; @@ -34,17 +34,17 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device, } CFX_Matrix matri = *matrix; if (m_Width < m_output->GetWidth() && m_Height < m_output->GetHeight()) { - CFX_Matrix matriScale( - (FX_FLOAT)m_Width / (FX_FLOAT)m_output->GetWidth(), 0.0, 0.0, - (FX_FLOAT)m_Height / (FX_FLOAT)m_output->GetHeight(), 0.0, 0.0); + CFX_Matrix matriScale((float)m_Width / (float)m_output->GetWidth(), 0.0, + 0.0, (float)m_Height / (float)m_output->GetHeight(), + 0.0, 0.0); matriScale.Concat(*matrix); matri = matriScale; } for (int32_t x = 0; x < m_output->GetWidth(); x++) { for (int32_t y = 0; y < m_output->GetHeight(); y++) { CFX_PathData rect; - rect.AppendRect((FX_FLOAT)leftPos + x, (FX_FLOAT)topPos + y, - (FX_FLOAT)(leftPos + x + 1), (FX_FLOAT)(topPos + y + 1)); + rect.AppendRect((float)leftPos + x, (float)topPos + y, + (float)(leftPos + x + 1), (float)(topPos + y + 1)); if (m_output->Get(x, y)) { CFX_GraphStateData data; device->DrawPath(&rect, &matri, &data, m_barColor, 0, FXFILL_WINDING); @@ -98,7 +98,7 @@ void CBC_TwoDimWriter::RenderResult(uint8_t* code, int32_t inputHeight = codeHeight; int32_t tempWidth = inputWidth + 2; int32_t tempHeight = inputHeight + 2; - FX_FLOAT moduleHSize = std::min(m_ModuleWidth, m_ModuleHeight); + float moduleHSize = std::min(m_ModuleWidth, m_ModuleHeight); moduleHSize = std::min(moduleHSize, 8.0f); moduleHSize = std::max(moduleHSize, 1.0f); pdfium::base::CheckedNumeric<int32_t> scaledWidth = tempWidth; @@ -115,14 +115,14 @@ void CBC_TwoDimWriter::RenderResult(uint8_t* code, } } else { if (m_Width > outputWidth || m_Height > outputHeight) { - outputWidth = (int32_t)(outputWidth * - ceil((FX_FLOAT)m_Width / (FX_FLOAT)outputWidth)); - outputHeight = (int32_t)( - outputHeight * ceil((FX_FLOAT)m_Height / (FX_FLOAT)outputHeight)); + outputWidth = + (int32_t)(outputWidth * ceil((float)m_Width / (float)outputWidth)); + outputHeight = + (int32_t)(outputHeight * ceil((float)m_Height / (float)outputHeight)); } } - int32_t multiX = (int32_t)ceil((FX_FLOAT)outputWidth / (FX_FLOAT)tempWidth); - int32_t multiY = (int32_t)ceil((FX_FLOAT)outputHeight / (FX_FLOAT)tempHeight); + int32_t multiX = (int32_t)ceil((float)outputWidth / (float)tempWidth); + int32_t multiY = (int32_t)ceil((float)outputHeight / (float)tempHeight); if (m_bFixedSize) { multiX = std::min(multiX, multiY); multiY = multiX; diff --git a/xfa/fxbarcode/cbc_onecode.cpp b/xfa/fxbarcode/cbc_onecode.cpp index 55c2837bd4..cf916402fb 100644 --- a/xfa/fxbarcode/cbc_onecode.cpp +++ b/xfa/fxbarcode/cbc_onecode.cpp @@ -62,7 +62,7 @@ bool CBC_OneCode::SetFont(CFX_Font* cFont) { return false; } -void CBC_OneCode::SetFontSize(FX_FLOAT size) { +void CBC_OneCode::SetFontSize(float size) { if (m_pBCWriter) static_cast<CBC_OneDimWriter*>(m_pBCWriter.get())->SetFontSize(size); } diff --git a/xfa/fxbarcode/cbc_onecode.h b/xfa/fxbarcode/cbc_onecode.h index e348b4ee2c..ac7eacebfb 100644 --- a/xfa/fxbarcode/cbc_onecode.h +++ b/xfa/fxbarcode/cbc_onecode.h @@ -27,7 +27,7 @@ class CBC_OneCode : public CBC_CodeBase { virtual void SetDataLength(int32_t length); virtual void SetCalChecksum(bool calc); virtual bool SetFont(CFX_Font* cFont); - virtual void SetFontSize(FX_FLOAT size); + virtual void SetFontSize(float size); virtual void SetFontStyle(int32_t style); virtual void SetFontColor(FX_ARGB color); }; diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp index ec6eb02b1c..90877c7ef3 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp @@ -140,7 +140,7 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, if (startpos >= msg.GetLength()) { return currentMode; } - std::vector<FX_FLOAT> charCounts; + std::vector<float> charCounts; if (currentMode == ASCII_ENCODATION) { charCounts.push_back(0); charCounts.push_back(1); @@ -189,12 +189,10 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg, if (isDigit(c)) { charCounts[ASCII_ENCODATION] += 0.5; } else if (isExtendedASCII(c)) { - charCounts[ASCII_ENCODATION] = - (FX_FLOAT)ceil(charCounts[ASCII_ENCODATION]); + charCounts[ASCII_ENCODATION] = (float)ceil(charCounts[ASCII_ENCODATION]); charCounts[ASCII_ENCODATION] += 2; } else { - charCounts[ASCII_ENCODATION] = - (FX_FLOAT)ceil(charCounts[ASCII_ENCODATION]); + charCounts[ASCII_ENCODATION] = (float)ceil(charCounts[ASCII_ENCODATION]); charCounts[ASCII_ENCODATION]++; } if (isNativeC40(c)) { @@ -320,7 +318,7 @@ wchar_t CBC_HighLevelEncoder::randomize253State(wchar_t ch, : (wchar_t)(tempVariable - 254); } int32_t CBC_HighLevelEncoder::findMinimums( - std::vector<FX_FLOAT>& charCounts, + std::vector<float>& charCounts, CFX_ArrayTemplate<int32_t>& intCharCounts, int32_t min, CFX_ArrayTemplate<uint8_t>& mins) { diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h index cfd16ed676..821dedd29f 100644 --- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h +++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h @@ -63,7 +63,7 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint { private: static wchar_t randomize253State(wchar_t ch, int32_t codewordPosition); - static int32_t findMinimums(std::vector<FX_FLOAT>& charCounts, + static int32_t findMinimums(std::vector<float>& charCounts, CFX_ArrayTemplate<int32_t>& intCharCounts, int32_t min, CFX_ArrayTemplate<uint8_t>& mins); diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp index dd7fcaa864..02ae58dc84 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp @@ -71,7 +71,7 @@ bool CBC_OneDimWriter::SetFont(CFX_Font* cFont) { return true; } -void CBC_OneDimWriter::SetFontSize(FX_FLOAT size) { +void CBC_OneDimWriter::SetFontSize(float size) { m_fFontSize = size; } @@ -151,39 +151,39 @@ int32_t CBC_OneDimWriter::AppendPattern(uint8_t* target, void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString& text, FXTEXT_CHARPOS* charPos, CFX_Font* cFont, - FX_FLOAT geWidth, + float geWidth, int32_t fontSize, - FX_FLOAT& charsLen) { + float& charsLen) { std::unique_ptr<CFX_UnicodeEncodingEx> encoding( FX_CreateFontEncodingEx(cFont)); int32_t length = text.GetLength(); uint32_t* pCharCode = FX_Alloc(uint32_t, text.GetLength()); - FX_FLOAT charWidth = 0; + float charWidth = 0; for (int32_t j = 0; j < text.GetLength(); j++) { pCharCode[j] = encoding->CharCodeFromUnicode(text[j]); int32_t glyp_code = encoding->GlyphFromCharCode(pCharCode[j]); int32_t glyp_value = cFont->GetGlyphWidth(glyp_code); - FX_FLOAT temp = (FX_FLOAT)((glyp_value)*fontSize / 1000.0); + float temp = (float)((glyp_value)*fontSize / 1000.0); charWidth += temp; } charsLen = charWidth; - FX_FLOAT leftPositon = (FX_FLOAT)(geWidth - charsLen) / 2.0f; + float leftPositon = (float)(geWidth - charsLen) / 2.0f; if (leftPositon < 0 && geWidth == 0) { leftPositon = 0; } - FX_FLOAT penX = 0.0; - FX_FLOAT penY = - (FX_FLOAT)FXSYS_abs(cFont->GetDescent()) * (FX_FLOAT)fontSize / 1000.0f; - FX_FLOAT left = leftPositon; - FX_FLOAT top = 0.0; + float penX = 0.0; + float penY = + (float)FXSYS_abs(cFont->GetDescent()) * (float)fontSize / 1000.0f; + float left = leftPositon; + float top = 0.0; charPos[0].m_Origin = CFX_PointF(penX + left, penY + top); charPos[0].m_GlyphIndex = encoding->GlyphFromCharCode(pCharCode[0]); charPos[0].m_FontCharWidth = cFont->GetGlyphWidth(charPos[0].m_GlyphIndex); #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ charPos[0].m_ExtGID = charPos[0].m_GlyphIndex; #endif - penX += (FX_FLOAT)(charPos[0].m_FontCharWidth) * (FX_FLOAT)fontSize / 1000.0f; + penX += (float)(charPos[0].m_FontCharWidth) * (float)fontSize / 1000.0f; for (int32_t i = 1; i < length; i++) { charPos[i].m_Origin = CFX_PointF(penX + left, penY + top); charPos[i].m_GlyphIndex = encoding->GlyphFromCharCode(pCharCode[i]); @@ -191,8 +191,7 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString& text, #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ charPos[i].m_ExtGID = charPos[i].m_GlyphIndex; #endif - penX += - (FX_FLOAT)(charPos[i].m_FontCharWidth) * (FX_FLOAT)fontSize / 1000.0f; + penX += (float)(charPos[i].m_FontCharWidth) * (float)fontSize / 1000.0f; } FX_Free(pCharCode); } @@ -200,37 +199,37 @@ void CBC_OneDimWriter::CalcTextInfo(const CFX_ByteString& text, void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice* device, const CFX_Matrix* matrix, const CFX_ByteString str, - FX_FLOAT geWidth, + float geWidth, FXTEXT_CHARPOS* pCharPos, - FX_FLOAT locX, - FX_FLOAT locY, + float locX, + float locY, int32_t barWidth) { int32_t iFontSize = (int32_t)fabs(m_fFontSize); int32_t iTextHeight = iFontSize + 1; - CFX_FloatRect rect((FX_FLOAT)locX, (FX_FLOAT)locY, (FX_FLOAT)(locX + geWidth), - (FX_FLOAT)(locY + iTextHeight)); + CFX_FloatRect rect((float)locX, (float)locY, (float)(locX + geWidth), + (float)(locY + iTextHeight)); if (geWidth != m_Width) { rect.right -= 1; } matrix->TransformRect(rect); FX_RECT re = rect.GetOuterRect(); device->FillRect(&re, m_backgroundColor); - CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, (FX_FLOAT)locX, - (FX_FLOAT)(locY + iFontSize)); + CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, (float)locX, + (float)(locY + iFontSize)); if (matrix) { affine_matrix.Concat(*matrix); } device->DrawNormalText(str.GetLength(), pCharPos, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix, + static_cast<float>(iFontSize), &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); } void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap* pOutBitmap, const CFX_ByteString str, - FX_FLOAT geWidth, + float geWidth, FXTEXT_CHARPOS* pCharPos, - FX_FLOAT locX, - FX_FLOAT locY, + float locX, + float locY, int32_t barWidth) { int32_t iFontSize = (int32_t)fabs(m_fFontSize); int32_t iTextHeight = iFontSize + 1; @@ -239,10 +238,10 @@ void CBC_OneDimWriter::ShowBitmapChars(CFX_DIBitmap* pOutBitmap, FX_RECT geRect(0, 0, (int)geWidth, iTextHeight); ge.FillRect(&geRect, m_backgroundColor); CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, - static_cast<FX_FLOAT>(iFontSize)); + static_cast<float>(iFontSize)); ge.DrawNormalText(str.GetLength(), pCharPos, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix, - m_fontColor, FXTEXT_CLEARTYPE); + static_cast<float>(iFontSize), &affine_matrix, m_fontColor, + FXTEXT_CLEARTYPE); CFX_FxgeDevice geBitmap; geBitmap.Attach(pOutBitmap, false, nullptr, false); geBitmap.SetDIBits(ge.GetBitmap(), (int)locX, (int)locY); @@ -267,14 +266,14 @@ void CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents, int32_t iLen = str.GetLength(); FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLen); FXSYS_memset(pCharPos, 0, sizeof(FXTEXT_CHARPOS) * iLen); - FX_FLOAT charsLen = 0; - FX_FLOAT geWidth = 0; + float charsLen = 0; + float geWidth = 0; if (m_locTextLoc == BC_TEXT_LOC_ABOVEEMBED || m_locTextLoc == BC_TEXT_LOC_BELOWEMBED) { geWidth = 0; } else if (m_locTextLoc == BC_TEXT_LOC_ABOVE || m_locTextLoc == BC_TEXT_LOC_BELOW) { - geWidth = (FX_FLOAT)barWidth; + geWidth = (float)barWidth; } int32_t iFontSize = (int32_t)fabs(m_fFontSize); int32_t iTextHeight = iFontSize + 1; @@ -293,7 +292,7 @@ void CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents, case BC_TEXT_LOC_ABOVE: locX = 0; locY = 0; - geWidth = (FX_FLOAT)barWidth; + geWidth = (float)barWidth; break; case BC_TEXT_LOC_BELOWEMBED: locX = (int32_t)(barWidth - charsLen) / 2; @@ -304,15 +303,15 @@ void CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents, default: locX = 0; locY = m_Height - iTextHeight; - geWidth = (FX_FLOAT)barWidth; + geWidth = (float)barWidth; break; } if (device) { - ShowDeviceChars(device, matrix, str, geWidth, pCharPos, (FX_FLOAT)locX, - (FX_FLOAT)locY, barWidth); + ShowDeviceChars(device, matrix, str, geWidth, pCharPos, (float)locX, + (float)locY, barWidth); } else { - ShowBitmapChars(pOutBitmap, str, geWidth, pCharPos, (FX_FLOAT)locX, - (FX_FLOAT)locY, barWidth); + ShowBitmapChars(pOutBitmap, str, geWidth, pCharPos, (float)locX, + (float)locY, barWidth); } FX_Free(pCharPos); } @@ -364,16 +363,15 @@ void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device, CFX_GraphStateData stateData; CFX_PathData path; - path.AppendRect(0, 0, (FX_FLOAT)m_Width, (FX_FLOAT)m_Height); + path.AppendRect(0, 0, (float)m_Width, (float)m_Height); device->DrawPath(&path, matrix, &stateData, m_backgroundColor, m_backgroundColor, FXFILL_ALTERNATE); - CFX_Matrix matri(m_outputHScale, 0.0, 0.0, (FX_FLOAT)m_Height, 0.0, 0.0); + CFX_Matrix matri(m_outputHScale, 0.0, 0.0, (float)m_Height, 0.0, 0.0); matri.Concat(*matrix); for (int32_t x = 0; x < m_output->GetWidth(); x++) { for (int32_t y = 0; y < m_output->GetHeight(); y++) { CFX_PathData rect; - rect.AppendRect((FX_FLOAT)x, (FX_FLOAT)y, (FX_FLOAT)(x + 1), - (FX_FLOAT)(y + 1)); + rect.AppendRect((float)x, (float)y, (float)(x + 1), (float)(y + 1)); if (m_output->Get(x, y)) { CFX_GraphStateData data; device->DrawPath(&rect, &matri, &data, m_barColor, 0, FXFILL_WINDING); @@ -417,18 +415,18 @@ void CBC_OneDimWriter::RenderResult(const CFX_WideStringC& contents, codeLength += rightPadding; m_outputHScale = 1.0; if (m_Width > 0) { - m_outputHScale = (FX_FLOAT)m_Width / (FX_FLOAT)codeLength; + m_outputHScale = (float)m_Width / (float)codeLength; } if (!isDevice) { m_outputHScale = - std::max(m_outputHScale, static_cast<FX_FLOAT>(m_ModuleWidth)); + std::max(m_outputHScale, static_cast<float>(m_ModuleWidth)); } - FX_FLOAT dataLengthScale = 1.0; + float dataLengthScale = 1.0; if (m_iDataLenth > 0 && contents.GetLength() != 0) { - dataLengthScale = FX_FLOAT(contents.GetLength()) / FX_FLOAT(m_iDataLenth); + dataLengthScale = float(contents.GetLength()) / float(m_iDataLenth); } if (m_iDataLenth > 0 && contents.GetLength() == 0) { - dataLengthScale = FX_FLOAT(1) / FX_FLOAT(m_iDataLenth); + dataLengthScale = float(1) / float(m_iDataLenth); } m_multiple = 1; if (!isDevice) { diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.h b/xfa/fxbarcode/oned/BC_OneDimWriter.h index b7c5cebe06..b2447cffb7 100644 --- a/xfa/fxbarcode/oned/BC_OneDimWriter.h +++ b/xfa/fxbarcode/oned/BC_OneDimWriter.h @@ -55,7 +55,7 @@ class CBC_OneDimWriter : public CBC_Writer { virtual void SetPrintChecksum(bool checksum); virtual void SetDataLength(int32_t length); virtual void SetCalcChecksum(bool state); - virtual void SetFontSize(FX_FLOAT size); + virtual void SetFontSize(float size); virtual void SetFontStyle(int32_t style); virtual void SetFontColor(FX_ARGB color); bool SetFont(CFX_Font* cFont); @@ -64,9 +64,9 @@ class CBC_OneDimWriter : public CBC_Writer { virtual void CalcTextInfo(const CFX_ByteString& text, FXTEXT_CHARPOS* charPos, CFX_Font* cFont, - FX_FLOAT geWidth, + float geWidth, int32_t fontSize, - FX_FLOAT& charsLen); + float& charsLen); virtual void ShowChars(const CFX_WideStringC& contents, CFX_DIBitmap* pOutBitmap, CFX_RenderDevice* device, @@ -76,18 +76,18 @@ class CBC_OneDimWriter : public CBC_Writer { int32_t& e); virtual void ShowBitmapChars(CFX_DIBitmap* pOutBitmap, const CFX_ByteString str, - FX_FLOAT geWidth, + float geWidth, FXTEXT_CHARPOS* pCharPos, - FX_FLOAT locX, - FX_FLOAT locY, + float locX, + float locY, int32_t barWidth); virtual void ShowDeviceChars(CFX_RenderDevice* device, const CFX_Matrix* matrix, const CFX_ByteString str, - FX_FLOAT geWidth, + float geWidth, FXTEXT_CHARPOS* pCharPos, - FX_FLOAT locX, - FX_FLOAT locY, + float locX, + float locY, int32_t barWidth); virtual int32_t AppendPattern(uint8_t* target, int32_t pos, @@ -102,7 +102,7 @@ class CBC_OneDimWriter : public CBC_Writer { int32_t m_iDataLenth; bool m_bCalcChecksum; CFX_Font* m_pFont; - FX_FLOAT m_fFontSize; + float m_fFontSize; int32_t m_iFontStyle; uint32_t m_fontColor; BC_TEXT_LOC m_locTextLoc; @@ -112,7 +112,7 @@ class CBC_OneDimWriter : public CBC_Writer { std::unique_ptr<CBC_CommonBitMatrix> m_output; int32_t m_barWidth; int32_t m_multiple; - FX_FLOAT m_outputHScale; + float m_outputHScale; }; #endif // XFA_FXBARCODE_ONED_BC_ONEDIMWRITER_H_ diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp index 47e47eaddb..555b58643d 100644 --- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -194,18 +194,16 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, int32_t strWidth = multiple * 42; 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_FloatRect rect1( - (FX_FLOAT)(leftPosition + 47 * multiple), - (FX_FLOAT)(m_Height - iTextHeight), - (FX_FLOAT)(leftPosition + 47 * multiple + strWidth - 0.5), - (FX_FLOAT)m_Height); + CFX_FloatRect rect1((float)(leftPosition + 47 * multiple), + (float)(m_Height - iTextHeight), + (float)(leftPosition + 47 * multiple + strWidth - 0.5), + (float)m_Height); CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); matr1.Concat(*matrix); matr1.TransformRect(rect1); @@ -213,63 +211,63 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, device->FillRect(&re, m_backgroundColor); int32_t strWidth1 = multiple * 7; CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); - CFX_FloatRect rect2(0.0f, (FX_FLOAT)(m_Height - iTextHeight), - (FX_FLOAT)strWidth1 - 0.5f, (FX_FLOAT)m_Height); + CFX_FloatRect rect2(0.0f, (float)(m_Height - iTextHeight), + (float)strWidth1 - 0.5f, (float)m_Height); matr2.Concat(*matrix); matr2.TransformRect(rect2); re = rect2.GetOuterRect(); device->FillRect(&re, m_backgroundColor); } - FX_FLOAT blank = 0.0; + float blank = 0.0; iLen = tempStr.GetLength(); if (!pOutBitmap) { strWidth = (int32_t)(strWidth * m_outputHScale); } - CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (FX_FLOAT)strWidth, iFontSize, + CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (float)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(strWidth, iTextHeight, FXDIB_Argb, nullptr); FX_RECT rect(0, 0, strWidth, iTextHeight); ge.FillRect(&rect, 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(7, 6); iLen = tempStr.GetLength(); - CalcTextInfo(tempStr, pCharPos + 7, m_pFont, (FX_FLOAT)strWidth, iFontSize, + CalcTextInfo(tempStr, pCharPos + 7, m_pFont, (float)strWidth, iFontSize, blank); if (pOutBitmap) { FX_RECT rect1(0, 0, strWidth, iTextHeight); ge.FillRect(&rect1, m_backgroundColor); ge.DrawNormalText(iLen, pCharPos + 7, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix, + static_cast<float>(iFontSize), &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 47 * multiple, m_Height - iTextHeight); } else { CFX_Matrix affine_matrix1( 1.0, 0.0, 0.0, -1.0, - (FX_FLOAT)(leftPosition + 47 * multiple) * m_outputHScale, - (FX_FLOAT)(m_Height - iTextHeight + iFontSize)); + (float)(leftPosition + 47 * multiple) * m_outputHScale, + (float)(m_Height - iTextHeight + iFontSize)); if (matrix) { affine_matrix1.Concat(*matrix); } device->DrawNormalText(iLen, pCharPos + 7, m_pFont, - static_cast<FX_FLOAT>(iFontSize), &affine_matrix1, + static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(0, 1); @@ -278,23 +276,22 @@ void CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, if (!pOutBitmap) strWidth = (int32_t)(strWidth * m_outputHScale); - CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize, - blank); + CalcTextInfo(tempStr, pCharPos, 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, 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.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); } FX_Free(pCharPos); 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); 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); diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/fxbarcode/pdf417/BC_PDF417.cpp index 94c65b8538..f7aad69953 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.cpp +++ b/xfa/fxbarcode/pdf417/BC_PDF417.cpp @@ -540,7 +540,7 @@ CFX_ArrayTemplate<int32_t>* CBC_PDF417::determineDimensions( int32_t sourceCodeWords, int32_t errorCorrectionCodeWords, int32_t& e) { - FX_FLOAT ratio = 0.0f; + float ratio = 0.0f; CFX_ArrayTemplate<int32_t>* dimension = nullptr; for (int32_t cols = m_minCols; cols <= m_maxCols; cols++) { int32_t rows = @@ -551,7 +551,7 @@ CFX_ArrayTemplate<int32_t>* CBC_PDF417::determineDimensions( if (rows > m_maxRows) { continue; } - FX_FLOAT newRatio = + float newRatio = ((17 * cols + 69) * DEFAULT_MODULE_WIDTH) / (rows * HEIGHT); if (dimension && fabsf(newRatio - PREFERRED_RATIO) > fabsf(ratio - PREFERRED_RATIO)) { diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.h b/xfa/fxbarcode/pdf417/BC_PDF417.h index 3ba5aa2f0c..b382e5d26e 100644 --- a/xfa/fxbarcode/pdf417/BC_PDF417.h +++ b/xfa/fxbarcode/pdf417/BC_PDF417.h @@ -36,9 +36,9 @@ class CBC_PDF417 { static const int32_t START_PATTERN = 0x1fea8; static const int32_t STOP_PATTERN = 0x3fa29; static const int32_t CODEWORD_TABLE[][929]; - static constexpr FX_FLOAT PREFERRED_RATIO = 3.0f; - static constexpr FX_FLOAT DEFAULT_MODULE_WIDTH = 0.357f; - static constexpr FX_FLOAT HEIGHT = 2.0f; + static constexpr float PREFERRED_RATIO = 3.0f; + static constexpr float DEFAULT_MODULE_WIDTH = 0.357f; + static constexpr float HEIGHT = 2.0f; static int32_t calculateNumberOfRows(int32_t m, int32_t k, int32_t c); static int32_t getNumberOfPadCodewords(int32_t m, |