Use void returns for fxbarcode methods that always return true
Change-Id: I50915481a65b2eb1cd23b8bbba445ef28b6db887
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/91891
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/fxbarcode/BC_Writer.cpp b/fxbarcode/BC_Writer.cpp
index 2eade2d..b57c987 100644
--- a/fxbarcode/BC_Writer.cpp
+++ b/fxbarcode/BC_Writer.cpp
@@ -10,9 +10,8 @@
CBC_Writer::~CBC_Writer() = default;
-bool CBC_Writer::SetCharEncoding(BC_CHAR_ENCODING encoding) {
+void CBC_Writer::SetCharEncoding(BC_CHAR_ENCODING encoding) {
m_CharEncoding = encoding;
- return true;
}
bool CBC_Writer::SetModuleHeight(int32_t moduleHeight) {
@@ -31,14 +30,12 @@
return true;
}
-bool CBC_Writer::SetHeight(int32_t height) {
+void CBC_Writer::SetHeight(int32_t height) {
m_Height = height;
- return true;
}
-bool CBC_Writer::SetWidth(int32_t width) {
+void CBC_Writer::SetWidth(int32_t width) {
m_Width = width;
- return true;
}
void CBC_Writer::SetTextLocation(BC_TEXT_LOC location) {}
diff --git a/fxbarcode/BC_Writer.h b/fxbarcode/BC_Writer.h
index 08b3e99..134662e 100644
--- a/fxbarcode/BC_Writer.h
+++ b/fxbarcode/BC_Writer.h
@@ -15,11 +15,11 @@
CBC_Writer();
virtual ~CBC_Writer();
- bool SetCharEncoding(BC_CHAR_ENCODING encoding);
+ void SetCharEncoding(BC_CHAR_ENCODING encoding);
bool SetModuleHeight(int32_t moduleHeight);
bool SetModuleWidth(int32_t moduleWidth);
- bool SetHeight(int32_t height);
- bool SetWidth(int32_t width);
+ void SetHeight(int32_t height);
+ void SetWidth(int32_t width);
virtual void SetTextLocation(BC_TEXT_LOC location);
virtual bool SetWideNarrowRatio(int8_t ratio);
diff --git a/fxbarcode/cbc_codebase.cpp b/fxbarcode/cbc_codebase.cpp
index 7f408f3..61c0429 100644
--- a/fxbarcode/cbc_codebase.cpp
+++ b/fxbarcode/cbc_codebase.cpp
@@ -50,8 +50,8 @@
return m_pBCWriter->SetErrorCorrectionLevel(level);
}
-bool CBC_CodeBase::SetCharEncoding(BC_CHAR_ENCODING encoding) {
- return m_pBCWriter->SetCharEncoding(encoding);
+void CBC_CodeBase::SetCharEncoding(BC_CHAR_ENCODING encoding) {
+ m_pBCWriter->SetCharEncoding(encoding);
}
bool CBC_CodeBase::SetModuleHeight(int32_t moduleHeight) {
@@ -62,10 +62,10 @@
return m_pBCWriter->SetModuleWidth(moduleWidth);
}
-bool CBC_CodeBase::SetHeight(int32_t height) {
+void CBC_CodeBase::SetHeight(int32_t height) {
return m_pBCWriter->SetHeight(height);
}
-bool CBC_CodeBase::SetWidth(int32_t width) {
+void CBC_CodeBase::SetWidth(int32_t width) {
return m_pBCWriter->SetWidth(width);
}
diff --git a/fxbarcode/cbc_codebase.h b/fxbarcode/cbc_codebase.h
index cbe53b7..faafed8 100644
--- a/fxbarcode/cbc_codebase.h
+++ b/fxbarcode/cbc_codebase.h
@@ -34,11 +34,11 @@
bool SetStartChar(char start);
bool SetEndChar(char end);
bool SetErrorCorrectionLevel(int32_t level);
- bool SetCharEncoding(BC_CHAR_ENCODING encoding);
+ void SetCharEncoding(BC_CHAR_ENCODING encoding);
bool SetModuleHeight(int32_t moduleHeight);
bool SetModuleWidth(int32_t moduleWidth);
- bool SetHeight(int32_t height);
- bool SetWidth(int32_t width);
+ void SetHeight(int32_t height);
+ void SetWidth(int32_t width);
protected:
std::unique_ptr<CBC_Writer> m_pBCWriter;
diff --git a/fxbarcode/cfx_barcode.cpp b/fxbarcode/cfx_barcode.cpp
index e7abebd..a1c1a58 100644
--- a/fxbarcode/cfx_barcode.cpp
+++ b/fxbarcode/cfx_barcode.cpp
@@ -70,8 +70,9 @@
return m_pBCEngine ? m_pBCEngine->GetType() : BC_TYPE::kUnknown;
}
-bool CFX_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) {
- return m_pBCEngine && m_pBCEngine->SetCharEncoding(encoding);
+void CFX_Barcode::SetCharEncoding(BC_CHAR_ENCODING encoding) {
+ if (m_pBCEngine)
+ m_pBCEngine->SetCharEncoding(encoding);
}
bool CFX_Barcode::SetModuleHeight(int32_t moduleHeight) {
@@ -82,12 +83,14 @@
return m_pBCEngine && m_pBCEngine->SetModuleWidth(moduleWidth);
}
-bool CFX_Barcode::SetHeight(int32_t height) {
- return m_pBCEngine && m_pBCEngine->SetHeight(height);
+void CFX_Barcode::SetHeight(int32_t height) {
+ if (m_pBCEngine)
+ m_pBCEngine->SetHeight(height);
}
-bool CFX_Barcode::SetWidth(int32_t width) {
- return m_pBCEngine && m_pBCEngine->SetWidth(width);
+void CFX_Barcode::SetWidth(int32_t width) {
+ if (m_pBCEngine)
+ m_pBCEngine->SetWidth(width);
}
bool CFX_Barcode::SetPrintChecksum(bool checksum) {
diff --git a/fxbarcode/cfx_barcode.h b/fxbarcode/cfx_barcode.h
index 5ff8a89..763ecac 100644
--- a/fxbarcode/cfx_barcode.h
+++ b/fxbarcode/cfx_barcode.h
@@ -30,13 +30,11 @@
bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix& matrix);
- bool SetCharEncoding(BC_CHAR_ENCODING encoding);
-
+ void SetCharEncoding(BC_CHAR_ENCODING encoding);
bool SetModuleHeight(int32_t moduleHeight);
bool SetModuleWidth(int32_t moduleWidth);
-
- bool SetHeight(int32_t height);
- bool SetWidth(int32_t width);
+ void SetHeight(int32_t height);
+ void SetWidth(int32_t width);
bool SetPrintChecksum(bool checksum);
bool SetDataLength(int32_t length);