summaryrefslogtreecommitdiff
path: root/fxbarcode/oned/BC_OnedCode128Writer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxbarcode/oned/BC_OnedCode128Writer.cpp')
-rw-r--r--fxbarcode/oned/BC_OnedCode128Writer.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/fxbarcode/oned/BC_OnedCode128Writer.cpp b/fxbarcode/oned/BC_OnedCode128Writer.cpp
index 50d3fb65a6..034ffc3557 100644
--- a/fxbarcode/oned/BC_OnedCode128Writer.cpp
+++ b/fxbarcode/oned/BC_OnedCode128Writer.cpp
@@ -95,22 +95,20 @@ bool CBC_OnedCode128Writer::CheckContentValidity(
WideString CBC_OnedCode128Writer::FilterContents(
const WideStringView& contents) {
- WideString filterChineseChar;
+ const wchar_t limit = m_codeFormat == BC_CODE128_B ? 126 : 106;
+
+ WideString filtered;
+ filtered.Reserve(contents.GetLength());
for (size_t i = 0; i < contents.GetLength(); i++) {
wchar_t ch = contents[i];
if (ch > 175) {
i++;
continue;
}
- filterChineseChar += ch;
- }
- const wchar_t limit = m_codeFormat == BC_CODE128_B ? 126 : 106;
- WideString filtercontents;
- for (const auto& ch : filterChineseChar) {
if (ch >= 32 && ch <= limit)
- filtercontents += ch;
+ filtered += ch;
}
- return filtercontents;
+ return filtered;
}
bool CBC_OnedCode128Writer::SetTextLocation(BC_TEXT_LOC location) {