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

Unified Diff: xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp

Issue 2221023003: Use smart pointers for class owned pointers in xfa/fxbarcode (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 4 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/pdf417/BC_PDF417.cpp ('k') | xfa/fxbarcode/qrcode/BC_QRCoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp
diff --git a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp
index c9f16cafd18d521b540192dbb984423d2df7ffe9..b2b87bc9a61ee2092d50774792f43f757c1fc540 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCodeWriter.cpp
@@ -35,16 +35,19 @@ CBC_QRCodeWriter::CBC_QRCodeWriter() {
m_iCorrectLevel = 1;
m_iVersion = 0;
}
+
CBC_QRCodeWriter::~CBC_QRCodeWriter() {}
+
void CBC_QRCodeWriter::ReleaseAll() {
- delete CBC_ReedSolomonGF256::QRCodeFild;
- CBC_ReedSolomonGF256::QRCodeFild = nullptr;
+ delete CBC_ReedSolomonGF256::QRCodeField;
+ CBC_ReedSolomonGF256::QRCodeField = nullptr;
delete CBC_ReedSolomonGF256::DataMatrixField;
CBC_ReedSolomonGF256::DataMatrixField = nullptr;
CBC_QRCoderMode::Destroy();
CBC_QRCoderErrorCorrectionLevel::Destroy();
CBC_QRCoderVersion::Destroy();
}
+
FX_BOOL CBC_QRCodeWriter::SetVersion(int32_t version) {
if (version < 0 || version > 40) {
return FALSE;
@@ -52,6 +55,7 @@ FX_BOOL CBC_QRCodeWriter::SetVersion(int32_t version) {
m_iVersion = version;
return TRUE;
}
+
FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(int32_t level) {
if (level < 0 || level > 3) {
return FALSE;
@@ -59,6 +63,7 @@ FX_BOOL CBC_QRCodeWriter::SetErrorCorrectionLevel(int32_t level) {
m_iCorrectLevel = level;
return TRUE;
}
+
uint8_t* CBC_QRCodeWriter::Encode(const CFX_WideString& contents,
int32_t ecLevel,
int32_t& outWidth,
@@ -97,6 +102,7 @@ uint8_t* CBC_QRCodeWriter::Encode(const CFX_WideString& contents,
FXSYS_memcpy(result, qr.GetMatrix()->GetArray(), outWidth * outHeight);
return result;
}
+
uint8_t* CBC_QRCodeWriter::Encode(const CFX_ByteString& contents,
BCFORMAT format,
int32_t& outWidth,
@@ -105,6 +111,7 @@ uint8_t* CBC_QRCodeWriter::Encode(const CFX_ByteString& contents,
int32_t& e) {
return nullptr;
}
+
uint8_t* CBC_QRCodeWriter::Encode(const CFX_ByteString& contents,
BCFORMAT format,
int32_t& outWidth,
« no previous file with comments | « xfa/fxbarcode/pdf417/BC_PDF417.cpp ('k') | xfa/fxbarcode/qrcode/BC_QRCoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698