summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp')
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp51
1 files changed, 24 insertions, 27 deletions
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);