Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Unified Diff: xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp

Issue 2048983002: Get rid of NULLs in xfa/fxbarcode/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: nits Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxbarcode/oned/BC_OnedUPCAReader.cpp ('k') | xfa/fxbarcode/pdf417/BC_PDF417.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index f7900d4195477c0a3d3bcc80504da5c46fb728bf..19cb7ec6de0e981d3523233fbd4d90cc411acdbc 100644
--- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -26,7 +26,7 @@
#include "xfa/fxbarcode/oned/BC_OnedUPCAWriter.h"
CBC_OnedUPCAWriter::CBC_OnedUPCAWriter() {
- m_subWriter = NULL;
+ m_subWriter = nullptr;
m_bLeftPadding = TRUE;
m_bRightPadding = TRUE;
}
@@ -84,7 +84,7 @@ uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents,
int32_t& outHeight,
int32_t& e) {
uint8_t* ret = Encode(contents, format, outWidth, outHeight, 0, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
+ BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
return ret;
}
uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents,
@@ -95,13 +95,13 @@ uint8_t* CBC_OnedUPCAWriter::Encode(const CFX_ByteString& contents,
int32_t& e) {
if (format != BCFORMAT_UPC_A) {
e = BCExceptionOnlyEncodeUPC_A;
- return NULL;
+ return nullptr;
}
CFX_ByteString toEAN13String = '0' + contents;
m_iDataLenth = 13;
uint8_t* ret = m_subWriter->Encode(toEAN13String, BCFORMAT_EAN_13, outWidth,
outHeight, hints, e);
- BC_EXCEPTION_CHECK_ReturnValue(e, NULL);
+ BC_EXCEPTION_CHECK_ReturnValue(e, nullptr);
return ret;
}
@@ -171,9 +171,9 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
re = rect3.GetOutterRect();
device->FillRect(&re, m_backgroundColor);
}
- if (pOutBitmap == NULL) {
+ if (!pOutBitmap)
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_FxgeDevice ge;
@@ -225,9 +225,9 @@ void CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents,
tempStr = str.Mid(0, 1);
iLen = tempStr.GetLength();
strWidth = (FX_FLOAT)multiple * 7;
- if (pOutBitmap == NULL) {
+ if (!pOutBitmap)
strWidth = strWidth * m_outputHScale;
- }
+
CalcTextInfo(tempStr, pCharPos, m_pFont, strWidth, iFontSize, blank);
if (pOutBitmap) {
delete ge.GetBitmap();
« no previous file with comments | « xfa/fxbarcode/oned/BC_OnedUPCAReader.cpp ('k') | xfa/fxbarcode/pdf417/BC_PDF417.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698