summaryrefslogtreecommitdiff
path: root/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2016-02-24 15:26:50 -0800
committerLei Zhang <thestig@chromium.org>2016-02-24 15:26:50 -0800
commit38eaaf36b09b816b963015e33dc4eb02580e0462 (patch)
tree9a2721eb404a2de4ddce91b50cac25b2cac0edb1 /xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
parente1fb98394a6885cf03bdc6391e5a3878aad5b375 (diff)
downloadpdfium-38eaaf36b09b816b963015e33dc4eb02580e0462.tar.xz
Remove foo != NULL checks in xfa/src/fxbarcode.
R=dsinclair@chromium.org Review URL: https://codereview.chromium.org/1726373002 .
Diffstat (limited to 'xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp')
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index 08a849f362..55c50318a5 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -34,10 +34,7 @@ void CBC_OnedUPCAWriter::Init() {
m_subWriter = new CBC_OnedEAN13Writer;
}
CBC_OnedUPCAWriter::~CBC_OnedUPCAWriter() {
- if (m_subWriter != NULL) {
- delete m_subWriter;
- }
- m_subWriter = NULL;
+ delete m_subWriter;
}
FX_BOOL CBC_OnedUPCAWriter::CheckContentValidity(
const CFX_WideStringC& contents) {
@@ -130,7 +127,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
FX_FLOAT strWidth = (FX_FLOAT)35 * multiple;
FX_FLOAT blank = 0.0;
CFX_FxgeDevice geBitmap;
- if (pOutBitmap != NULL) {
+ if (pOutBitmap) {
geBitmap.Attach(pOutBitmap);
}
FX_FLOAT charsWidth = 0;
@@ -181,7 +178,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
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_FxgeDevice ge;
- if (pOutBitmap != NULL) {
+ if (pOutBitmap) {
ge.Create((int)strWidth, iTextHeight, FXDIB_Argb);
ge.GetBitmap()->Clear(m_backgroundColor);
ge.DrawNormalText(iLen, pCharPos + 1, m_pFont,
@@ -193,7 +190,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0,
(FX_FLOAT)leftPosition * m_outputHScale,
(FX_FLOAT)(m_Height - iTextHeight + iFontSize));
- if (matrix != NULL) {
+ if (matrix) {
affine_matrix1.Concat(*matrix);
}
device->DrawNormalText(iLen, pCharPos + 1, m_pFont,
@@ -205,7 +202,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
iLen = tempStr.GetLength();
charsWidth = 0.0f;
CalcTextInfo(tempStr, pCharPos + 6, m_pFont, strWidth, iFontSize, blank);
- if (pOutBitmap != NULL) {
+ if (pOutBitmap) {
FX_RECT rect2(0, 0, (int)strWidth, iTextHeight);
ge.FillRect(&rect2, m_backgroundColor);
ge.DrawNormalText(iLen, pCharPos + 6, m_pFont,
@@ -219,7 +216,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
1.0, 0.0, 0.0, -1.0,
(FX_FLOAT)(leftPosition + 40 * multiple) * m_outputHScale,
(FX_FLOAT)(m_Height - iTextHeight + iFontSize));
- if (matrix != NULL) {
+ if (matrix) {
affine_matrix1.Concat(*matrix);
}
device->DrawNormalText(iLen, pCharPos + 6, m_pFont,
@@ -234,7 +231,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
strWidth = strWidth * m_outputHScale;
}
CalcTextInfo(tempStr, pCharPos, m_pFont, strWidth, iFontSize, blank);
- if (pOutBitmap != NULL) {
+ if (pOutBitmap) {
delete ge.GetBitmap();
ge.Create((int)strWidth, iTextHeight, FXDIB_Argb);
ge.GetBitmap()->Clear(m_backgroundColor);
@@ -246,7 +243,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
} else {
CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, 0,
(FX_FLOAT)(m_Height - iTextHeight + iFontSize));
- if (matrix != NULL) {
+ if (matrix) {
affine_matrix1.Concat(*matrix);
}
device->DrawNormalText(iLen, pCharPos, m_pFont,
@@ -257,7 +254,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
tempStr = str.Mid(11, 1);
iLen = tempStr.GetLength();
CalcTextInfo(tempStr, pCharPos + 11, m_pFont, strWidth, iFontSize, blank);
- if (pOutBitmap != NULL) {
+ if (pOutBitmap) {
delete ge.GetBitmap();
ge.Create((int)strWidth, iTextHeight, FXDIB_Argb);
ge.GetBitmap()->Clear(m_backgroundColor);
@@ -272,7 +269,7 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
1.0, 0.0, 0.0, -1.0,
(FX_FLOAT)(leftPosition + 85 * multiple) * m_outputHScale,
(FX_FLOAT)(m_Height - iTextHeight + iFontSize));
- if (matrix != NULL) {
+ if (matrix) {
affine_matrix1.Concat(*matrix);
}
device->DrawNormalText(iLen, pCharPos + 11, m_pFont,