summaryrefslogtreecommitdiff
path: root/fxbarcode/oned/BC_OnedEAN13Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode/oned/BC_OnedEAN13Writer.cpp')
-rw-r--r--fxbarcode/oned/BC_OnedEAN13Writer.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index a11938a4d9..96b51b0570 100644
--- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -48,17 +48,13 @@ CBC_OnedEAN13Writer::CBC_OnedEAN13Writer() {
m_codeWidth = 3 + (7 * 6) + 5 + (7 * 6) + 3;
}
CBC_OnedEAN13Writer::~CBC_OnedEAN13Writer() {}
+
bool CBC_OnedEAN13Writer::CheckContentValidity(
const CFX_WideStringC& contents) {
- for (int32_t i = 0; i < contents.GetLength(); i++) {
- if (contents.GetAt(i) >= '0' && contents.GetAt(i) <= '9') {
- continue;
- } else {
- return false;
- }
- }
- return true;
+ return std::all_of(contents.begin(), contents.end(),
+ [](const wchar_t& w) { return w >= L'0' && w <= L'9'; });
}
+
CFX_WideString CBC_OnedEAN13Writer::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filtercontents;