summaryrefslogtreecommitdiff
path: root/xfa/fxbarcode
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-13 16:43:37 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-14 14:14:51 +0000
commit812e96c2b4c5908a1979da5e27cdcecda0d1dfc9 (patch)
treef0b0607f6b757eb22237527215094bd87b5d03ba /xfa/fxbarcode
parent893822aa5b6254591f8e80fbffcbb4fa6ad849aa (diff)
downloadpdfium-812e96c2b4c5908a1979da5e27cdcecda0d1dfc9.tar.xz
Replace FX_CHAR and FX_WCHAR with underlying types.
Change-Id: I96e0a20d66b9184d22f64d8e4ce0dadd5a78c1e8 Reviewed-on: https://pdfium-review.googlesource.com/2967 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'xfa/fxbarcode')
-rw-r--r--xfa/fxbarcode/BC_Dimension.cpp2
-rw-r--r--xfa/fxbarcode/BC_Utils.cpp4
-rw-r--r--xfa/fxbarcode/cbc_codabar.cpp4
-rw-r--r--xfa/fxbarcode/cbc_codabar.h4
-rw-r--r--xfa/fxbarcode/cbc_ean13.cpp2
-rw-r--r--xfa/fxbarcode/cbc_ean8.cpp4
-rw-r--r--xfa/fxbarcode/cbc_upca.cpp2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp19
-rw-r--r--xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h4
-rw-r--r--xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp22
-rw-r--r--xfa/fxbarcode/datamatrix/BC_Base256Encoder.h2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_C40Encoder.cpp46
-rw-r--r--xfa/fxbarcode/datamatrix/BC_C40Encoder.h2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp24
-rw-r--r--xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp8
-rw-r--r--xfa/fxbarcode/datamatrix/BC_EncoderContext.h6
-rw-r--r--xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp4
-rw-r--r--xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp54
-rw-r--r--xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h42
-rw-r--r--xfa/fxbarcode/datamatrix/BC_TextEncoder.cpp42
-rw-r--r--xfa/fxbarcode/datamatrix/BC_TextEncoder.h2
-rw-r--r--xfa/fxbarcode/datamatrix/BC_X12Encoder.cpp16
-rw-r--r--xfa/fxbarcode/datamatrix/BC_X12Encoder.h2
-rw-r--r--xfa/fxbarcode/oned/BC_OneDimWriter.cpp2
-rw-r--r--xfa/fxbarcode/oned/BC_OneDimWriter.h2
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp28
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h10
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp4
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp55
-rw-r--r--xfa/fxbarcode/oned/BC_OnedCode39Writer.h2
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp2
-rw-r--r--xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp2
-rw-r--r--xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp2
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417.cpp4
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp12
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp84
-rw-r--r--xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h12
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp2
-rw-r--r--xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h2
-rw-r--r--xfa/fxbarcode/utils.h4
41 files changed, 270 insertions, 278 deletions
diff --git a/xfa/fxbarcode/BC_Dimension.cpp b/xfa/fxbarcode/BC_Dimension.cpp
index 0cb076ce22..7a4b256f31 100644
--- a/xfa/fxbarcode/BC_Dimension.cpp
+++ b/xfa/fxbarcode/BC_Dimension.cpp
@@ -42,5 +42,5 @@ int32_t CBC_Dimension::hashCode() {
return m_width * 32713 + m_height;
}
CFX_WideString CBC_Dimension::toString() {
- return (FX_WCHAR)(m_width + (FX_WCHAR)'x' + m_height);
+ return (wchar_t)(m_width + (wchar_t)'x' + m_height);
}
diff --git a/xfa/fxbarcode/BC_Utils.cpp b/xfa/fxbarcode/BC_Utils.cpp
index 5d881c7be1..b1dcf4a973 100644
--- a/xfa/fxbarcode/BC_Utils.cpp
+++ b/xfa/fxbarcode/BC_Utils.cpp
@@ -11,7 +11,7 @@ bool BC_FX_ByteString_Replace(CFX_ByteString& dst,
uint32_t first,
uint32_t last,
int32_t count,
- FX_CHAR c) {
+ char c) {
if (first > last || count <= 0) {
return false;
}
@@ -21,7 +21,7 @@ bool BC_FX_ByteString_Replace(CFX_ByteString& dst,
}
return true;
}
-void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, FX_CHAR c) {
+void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, char c) {
for (int32_t i = 0; i < count; i++) {
dst += c;
}
diff --git a/xfa/fxbarcode/cbc_codabar.cpp b/xfa/fxbarcode/cbc_codabar.cpp
index 6f6ab4a96c..53e351d5a2 100644
--- a/xfa/fxbarcode/cbc_codabar.cpp
+++ b/xfa/fxbarcode/cbc_codabar.cpp
@@ -27,14 +27,14 @@ CBC_Codabar::CBC_Codabar() : CBC_OneCode(new CBC_OnedCodaBarWriter) {}
CBC_Codabar::~CBC_Codabar() {}
-bool CBC_Codabar::SetStartChar(FX_CHAR start) {
+bool CBC_Codabar::SetStartChar(char start) {
if (!m_pBCWriter)
return false;
return static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->SetStartChar(start);
}
-bool CBC_Codabar::SetEndChar(FX_CHAR end) {
+bool CBC_Codabar::SetEndChar(char end) {
if (m_pBCWriter)
return static_cast<CBC_OnedCodaBarWriter*>(m_pBCWriter.get())
->SetEndChar(end);
diff --git a/xfa/fxbarcode/cbc_codabar.h b/xfa/fxbarcode/cbc_codabar.h
index 28631a9cb5..43f1a010c0 100644
--- a/xfa/fxbarcode/cbc_codabar.h
+++ b/xfa/fxbarcode/cbc_codabar.h
@@ -27,8 +27,8 @@ class CBC_Codabar : public CBC_OneCode {
bool RenderBitmap(CFX_DIBitmap*& pOutBitmap, int32_t& e) override;
BC_TYPE GetType() override;
- bool SetStartChar(FX_CHAR start);
- bool SetEndChar(FX_CHAR end);
+ bool SetStartChar(char start);
+ bool SetEndChar(char end);
bool SetTextLocation(BC_TEXT_LOC location);
bool SetWideNarrowRatio(int32_t ratio);
diff --git a/xfa/fxbarcode/cbc_ean13.cpp b/xfa/fxbarcode/cbc_ean13.cpp
index 450fba04c9..abd5f198a3 100644
--- a/xfa/fxbarcode/cbc_ean13.cpp
+++ b/xfa/fxbarcode/cbc_ean13.cpp
@@ -34,7 +34,7 @@ CFX_WideString CBC_EAN13::Preprocess(const CFX_WideStringC& contents) {
int32_t length = encodeContents.GetLength();
if (length <= 12) {
for (int32_t i = 0; i < 12 - length; i++)
- encodeContents = FX_WCHAR('0') + encodeContents;
+ encodeContents = wchar_t('0') + encodeContents;
CFX_ByteString byteString = encodeContents.UTF8Encode();
int32_t checksum = static_cast<CBC_OnedEAN13Writer*>(m_pBCWriter.get())
diff --git a/xfa/fxbarcode/cbc_ean8.cpp b/xfa/fxbarcode/cbc_ean8.cpp
index 64ba617331..bfb458521e 100644
--- a/xfa/fxbarcode/cbc_ean8.cpp
+++ b/xfa/fxbarcode/cbc_ean8.cpp
@@ -34,12 +34,12 @@ CFX_WideString CBC_EAN8::Preprocess(const CFX_WideStringC& contents) {
int32_t length = encodeContents.GetLength();
if (length <= 7) {
for (int32_t i = 0; i < 7 - length; i++)
- encodeContents = FX_WCHAR('0') + encodeContents;
+ encodeContents = wchar_t('0') + encodeContents;
CFX_ByteString byteString = encodeContents.UTF8Encode();
int32_t checksum = static_cast<CBC_OnedEAN8Writer*>(m_pBCWriter.get())
->CalcChecksum(byteString);
- encodeContents += FX_WCHAR(checksum - 0 + '0');
+ encodeContents += wchar_t(checksum - 0 + '0');
}
if (length > 8)
encodeContents = encodeContents.Mid(0, 8);
diff --git a/xfa/fxbarcode/cbc_upca.cpp b/xfa/fxbarcode/cbc_upca.cpp
index b282d5cd79..87f58093ae 100644
--- a/xfa/fxbarcode/cbc_upca.cpp
+++ b/xfa/fxbarcode/cbc_upca.cpp
@@ -34,7 +34,7 @@ CFX_WideString CBC_UPCA::Preprocess(const CFX_WideStringC& contents) {
int32_t length = encodeContents.GetLength();
if (length <= 11) {
for (int32_t i = 0; i < 11 - length; i++)
- encodeContents = FX_WCHAR('0') + encodeContents;
+ encodeContents = wchar_t('0') + encodeContents;
CFX_ByteString byteString = encodeContents.UTF8Encode();
int32_t checksum = pWriter->CalcChecksum(byteString);
diff --git a/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp
index 00d8fc1615..88a12b23a2 100644
--- a/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.cpp
@@ -37,16 +37,15 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext& context, int32_t& e) {
int32_t n = CBC_HighLevelEncoder::determineConsecutiveDigitCount(
context.m_msg, context.m_pos);
if (n >= 2) {
- FX_WCHAR code =
- encodeASCIIDigits(context.m_msg.GetAt(context.m_pos),
- context.m_msg.GetAt(context.m_pos + 1), e);
+ wchar_t code = encodeASCIIDigits(context.m_msg.GetAt(context.m_pos),
+ context.m_msg.GetAt(context.m_pos + 1), e);
if (e != BCExceptionNO) {
return;
}
context.writeCodeword(code);
context.m_pos += 2;
} else {
- FX_WCHAR c = context.getCurrentChar();
+ wchar_t c = context.getCurrentChar();
int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(
context.m_msg, context.m_pos, getEncodingMode());
if (newMode != getEncodingMode()) {
@@ -77,21 +76,21 @@ void CBC_ASCIIEncoder::Encode(CBC_EncoderContext& context, int32_t& e) {
}
} else if (CBC_HighLevelEncoder::isExtendedASCII(c)) {
context.writeCodeword(CBC_HighLevelEncoder::UPPER_SHIFT);
- context.writeCodeword((FX_WCHAR)(c - 128 + 1));
+ context.writeCodeword((wchar_t)(c - 128 + 1));
context.m_pos++;
} else {
- context.writeCodeword((FX_WCHAR)(c + 1));
+ context.writeCodeword((wchar_t)(c + 1));
context.m_pos++;
}
}
}
-FX_WCHAR CBC_ASCIIEncoder::encodeASCIIDigits(FX_WCHAR digit1,
- FX_WCHAR digit2,
- int32_t& e) {
+wchar_t CBC_ASCIIEncoder::encodeASCIIDigits(wchar_t digit1,
+ wchar_t digit2,
+ int32_t& e) {
if (CBC_HighLevelEncoder::isDigit(digit1) &&
CBC_HighLevelEncoder::isDigit(digit2)) {
int32_t num = (digit1 - 48) * 10 + (digit2 - 48);
- return (FX_WCHAR)(num + 130);
+ return (wchar_t)(num + 130);
}
e = BCExceptionIllegalArgumentNotGigits;
return 0;
diff --git a/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h b/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h
index 40559b532d..a0cfaa76ed 100644
--- a/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_ASCIIEncoder.h
@@ -21,9 +21,7 @@ class CBC_ASCIIEncoder : public CBC_Encoder {
void Encode(CBC_EncoderContext& context, int32_t& e) override;
private:
- static FX_WCHAR encodeASCIIDigits(FX_WCHAR digit1,
- FX_WCHAR digit2,
- int32_t& e);
+ static wchar_t encodeASCIIDigits(wchar_t digit1, wchar_t digit2, int32_t& e);
};
#endif // XFA_FXBARCODE_DATAMATRIX_BC_ASCIIENCODER_H_
diff --git a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp
index b8e427c7fc..333377e392 100644
--- a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.cpp
@@ -35,9 +35,9 @@ int32_t CBC_Base256Encoder::getEncodingMode() {
}
void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
CFX_WideString buffer;
- buffer += (FX_WCHAR)'\0';
+ buffer += (wchar_t)'\0';
while (context.hasMoreCharacters()) {
- FX_WCHAR c = context.getCurrentChar();
+ wchar_t c = context.getCurrentChar();
buffer += c;
context.m_pos++;
int32_t newMode = CBC_HighLevelEncoder::lookAheadTest(
@@ -48,9 +48,9 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
}
}
int32_t dataCount = buffer.GetLength() - 1;
- FX_CHAR buf[128];
+ char buf[128];
FXSYS_itoa(dataCount, buf, 10);
- buffer.SetAt(0, FX_WCHAR(*buf) - '0');
+ buffer.SetAt(0, wchar_t(*buf) - '0');
int32_t lengthFieldSize = 1;
int32_t currentSize =
context.getCodewordCount() + dataCount + lengthFieldSize;
@@ -61,10 +61,10 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
bool mustPad = (context.m_symbolInfo->m_dataCapacity - currentSize) > 0;
if (context.hasMoreCharacters() || mustPad) {
if (dataCount <= 249) {
- buffer.SetAt(0, (FX_WCHAR)dataCount);
+ buffer.SetAt(0, (wchar_t)dataCount);
} else if (dataCount > 249 && dataCount <= 1555) {
- buffer.SetAt(0, (FX_WCHAR)((dataCount / 250) + 249));
- buffer.Insert(1, (FX_WCHAR)(dataCount % 250));
+ buffer.SetAt(0, (wchar_t)((dataCount / 250) + 249));
+ buffer.Insert(1, (wchar_t)(dataCount % 250));
} else {
e = BCExceptionIllegalStateMessageLengthInvalid;
return;
@@ -75,13 +75,13 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
randomize255State(buffer.GetAt(i), context.getCodewordCount() + 1));
}
}
-FX_WCHAR CBC_Base256Encoder::randomize255State(FX_WCHAR ch,
- int32_t codewordPosition) {
+wchar_t CBC_Base256Encoder::randomize255State(wchar_t ch,
+ int32_t codewordPosition) {
int32_t pseudoRandom = ((149 * codewordPosition) % 255) + 1;
int32_t tempVariable = ch + pseudoRandom;
if (tempVariable <= 255) {
- return (FX_WCHAR)tempVariable;
+ return (wchar_t)tempVariable;
} else {
- return (FX_WCHAR)(tempVariable - 256);
+ return (wchar_t)(tempVariable - 256);
}
}
diff --git a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h
index c41c79db08..41229afb80 100644
--- a/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_Base256Encoder.h
@@ -19,7 +19,7 @@ class CBC_Base256Encoder : public CBC_Encoder {
void Encode(CBC_EncoderContext& context, int32_t& e) override;
private:
- static FX_WCHAR randomize255State(FX_WCHAR ch, int32_t codewordPosition);
+ static wchar_t randomize255State(wchar_t ch, int32_t codewordPosition);
};
#endif // XFA_FXBARCODE_DATAMATRIX_BC_BASE256ENCODER_H_
diff --git a/xfa/fxbarcode/datamatrix/BC_C40Encoder.cpp b/xfa/fxbarcode/datamatrix/BC_C40Encoder.cpp
index 50f02ca52d..04fcb6b541 100644
--- a/xfa/fxbarcode/datamatrix/BC_C40Encoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_C40Encoder.cpp
@@ -37,7 +37,7 @@ int32_t CBC_C40Encoder::getEncodingMode() {
void CBC_C40Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
CFX_WideString buffer;
while (context.hasMoreCharacters()) {
- FX_WCHAR c = context.getCurrentChar();
+ wchar_t c = context.getCurrentChar();
context.m_pos++;
int32_t lastCharSize = encodeChar(c, buffer, e);
if (e != BCExceptionNO) {
@@ -100,7 +100,7 @@ void CBC_C40Encoder::handleEOD(CBC_EncoderContext& context,
}
int32_t available = context.m_symbolInfo->m_dataCapacity - curCodewordCount;
if (rest == 2) {
- buffer += (FX_WCHAR)'\0';
+ buffer += (wchar_t)'\0';
while (buffer.GetLength() >= 3) {
writeNextTriplet(context, buffer);
}
@@ -128,39 +128,39 @@ void CBC_C40Encoder::handleEOD(CBC_EncoderContext& context,
}
context.signalEncoderChange(ASCII_ENCODATION);
}
-int32_t CBC_C40Encoder::encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e) {
+int32_t CBC_C40Encoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) {
if (c == ' ') {
- sb += (FX_WCHAR)'\3';
+ sb += (wchar_t)'\3';
return 1;
} else if ((c >= '0') && (c <= '9')) {
- sb += (FX_WCHAR)(c - 48 + 4);
+ sb += (wchar_t)(c - 48 + 4);
return 1;
} else if ((c >= 'A') && (c <= 'Z')) {
- sb += (FX_WCHAR)(c - 65 + 14);
+ sb += (wchar_t)(c - 65 + 14);
return 1;
} else if (c <= 0x1f) {
- sb += (FX_WCHAR)'\0';
+ sb += (wchar_t)'\0';
sb += c;
return 2;
} else if ((c >= '!') && (c <= '/')) {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)(c - 33);
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)(c - 33);
return 2;
} else if ((c >= ':') && (c <= '@')) {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)(c - 58 + 15);
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)(c - 58 + 15);
return 2;
} else if ((c >= '[') && (c <= '_')) {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)(c - 91 + 22);
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)(c - 91 + 22);
return 2;
} else if ((c >= 60) && (c <= 0x7f)) {
- sb += (FX_WCHAR)'\2';
- sb += (FX_WCHAR)(c - 96);
+ sb += (wchar_t)'\2';
+ sb += (wchar_t)(c - 96);
return 2;
} else if (c >= 80) {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)0x001e;
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)0x001e;
int32_t len = 2;
len += encodeChar((c - 128), sb, e);
if (e != BCExceptionNO)
@@ -179,7 +179,7 @@ int32_t CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext& context,
int32_t count = buffer.GetLength();
buffer.Delete(count - lastCharSize, count);
context.m_pos--;
- FX_WCHAR c = context.getCurrentChar();
+ wchar_t c = context.getCurrentChar();
lastCharSize = encodeChar(c, removed, e);
if (e != BCExceptionNO)
return -1;
@@ -188,12 +188,12 @@ int32_t CBC_C40Encoder::backtrackOneCharacter(CBC_EncoderContext& context,
}
CFX_WideString CBC_C40Encoder::encodeToCodewords(CFX_WideString sb,
int32_t startPos) {
- FX_WCHAR c1 = sb.GetAt(startPos);
- FX_WCHAR c2 = sb.GetAt(startPos + 1);
- FX_WCHAR c3 = sb.GetAt(startPos + 2);
+ wchar_t c1 = sb.GetAt(startPos);
+ wchar_t c2 = sb.GetAt(startPos + 1);
+ wchar_t c3 = sb.GetAt(startPos + 2);
int32_t v = (1600 * c1) + (40 * c2) + c3 + 1;
- FX_WCHAR cw1 = (FX_WCHAR)(v / 256);
- FX_WCHAR cw2 = (FX_WCHAR)(v % 256);
+ wchar_t cw1 = (wchar_t)(v / 256);
+ wchar_t cw2 = (wchar_t)(v % 256);
CFX_WideString b1(cw1);
CFX_WideString b2(cw2);
return b1 + b2;
diff --git a/xfa/fxbarcode/datamatrix/BC_C40Encoder.h b/xfa/fxbarcode/datamatrix/BC_C40Encoder.h
index 9737981f75..03dee140df 100644
--- a/xfa/fxbarcode/datamatrix/BC_C40Encoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_C40Encoder.h
@@ -24,7 +24,7 @@ class CBC_C40Encoder : public CBC_Encoder {
virtual void handleEOD(CBC_EncoderContext& context,
CFX_WideString& buffer,
int32_t& e);
- virtual int32_t encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e);
+ virtual int32_t encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e);
private:
int32_t backtrackOneCharacter(CBC_EncoderContext& context,
diff --git a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
index 7db117d003..2ffc8413a3 100644
--- a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
@@ -37,7 +37,7 @@ int32_t CBC_EdifactEncoder::getEncodingMode() {
void CBC_EdifactEncoder::Encode(CBC_EncoderContext& context, int32_t& e) {
CFX_WideString buffer;
while (context.hasMoreCharacters()) {
- FX_WCHAR c = context.getCurrentChar();
+ wchar_t c = context.getCurrentChar();
encodeChar(c, buffer, e);
if (e != BCExceptionNO) {
return;
@@ -58,7 +58,7 @@ void CBC_EdifactEncoder::Encode(CBC_EncoderContext& context, int32_t& e) {
}
}
}
- buffer += (FX_WCHAR)31;
+ buffer += (wchar_t)31;
handleEOD(context, buffer, e);
}
void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext& context,
@@ -115,13 +115,11 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext& context,
}
context.signalEncoderChange(ASCII_ENCODATION);
}
-void CBC_EdifactEncoder::encodeChar(FX_WCHAR c,
- CFX_WideString& sb,
- int32_t& e) {
+void CBC_EdifactEncoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) {
if (c >= ' ' && c <= '?') {
sb += c;
} else if (c >= '@' && c <= '^') {
- sb += (FX_WCHAR)(c - 64);
+ sb += (wchar_t)(c - 64);
} else {
CBC_HighLevelEncoder::illegalCharacter(c, e);
}
@@ -134,14 +132,14 @@ CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb,
e = BCExceptionNoContents;
return CFX_WideString();
}
- FX_WCHAR c1 = sb.GetAt(startPos);
- FX_WCHAR c2 = len >= 2 ? sb.GetAt(startPos + 1) : 0;
- FX_WCHAR c3 = len >= 3 ? sb.GetAt(startPos + 2) : 0;
- FX_WCHAR c4 = len >= 4 ? sb.GetAt(startPos + 3) : 0;
+ wchar_t c1 = sb.GetAt(startPos);
+ wchar_t c2 = len >= 2 ? sb.GetAt(startPos + 1) : 0;
+ wchar_t c3 = len >= 3 ? sb.GetAt(startPos + 2) : 0;
+ wchar_t c4 = len >= 4 ? sb.GetAt(startPos + 3) : 0;
int32_t v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4;
- FX_WCHAR cw1 = (FX_WCHAR)((v >> 16) & 255);
- FX_WCHAR cw2 = (FX_WCHAR)((v >> 8) & 255);
- FX_WCHAR cw3 = (FX_WCHAR)(v & 255);
+ wchar_t cw1 = (wchar_t)((v >> 16) & 255);
+ wchar_t cw2 = (wchar_t)((v >> 8) & 255);
+ wchar_t cw3 = (wchar_t)(v & 255);
CFX_WideString res;
res += cw1;
if (len >= 2) {
diff --git a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h
index 3eb762fe6d..afe013e02e 100644
--- a/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_EdifactEncoder.h
@@ -22,7 +22,7 @@ class CBC_EdifactEncoder : public CBC_Encoder {
static void handleEOD(CBC_EncoderContext& context,
CFX_WideString buffer,
int32_t& e);
- static void encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e);
+ static void encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e);
static CFX_WideString encodeToCodewords(CFX_WideString sb,
int32_t startPos,
int32_t& e);
diff --git a/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp b/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp
index b01b3120e3..6af2bc4e83 100644
--- a/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_EncoderContext.cpp
@@ -36,7 +36,7 @@ CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString msg,
CFX_WideString sb;
int32_t c = dststr.GetLength();
for (int32_t i = 0; i < c; i++) {
- FX_WCHAR ch = (FX_WCHAR)(dststr.GetAt(i) & 0xff);
+ wchar_t ch = (wchar_t)(dststr.GetAt(i) & 0xff);
if (ch == '?' && dststr.GetAt(i) != '?') {
e = BCExceptionCharactersOutsideISO88591Encoding;
}
@@ -66,16 +66,16 @@ CFX_WideString CBC_EncoderContext::getMessage() {
void CBC_EncoderContext::setSkipAtEnd(int32_t count) {
m_skipAtEnd = count;
}
-FX_WCHAR CBC_EncoderContext::getCurrentChar() {
+wchar_t CBC_EncoderContext::getCurrentChar() {
return m_msg.GetAt(m_pos);
}
-FX_WCHAR CBC_EncoderContext::getCurrent() {
+wchar_t CBC_EncoderContext::getCurrent() {
return m_msg.GetAt(m_pos);
}
void CBC_EncoderContext::writeCodewords(CFX_WideString codewords) {
m_codewords += codewords;
}
-void CBC_EncoderContext::writeCodeword(FX_WCHAR codeword) {
+void CBC_EncoderContext::writeCodeword(wchar_t codeword) {
m_codewords += codeword;
}
int32_t CBC_EncoderContext::getCodewordCount() {
diff --git a/xfa/fxbarcode/datamatrix/BC_EncoderContext.h b/xfa/fxbarcode/datamatrix/BC_EncoderContext.h
index 8d0ea5d7ed..03018b2ffe 100644
--- a/xfa/fxbarcode/datamatrix/BC_EncoderContext.h
+++ b/xfa/fxbarcode/datamatrix/BC_EncoderContext.h
@@ -23,10 +23,10 @@ class CBC_EncoderContext : public CBC_SymbolShapeHint {
void setSizeConstraints(CBC_Dimension* minSize, CBC_Dimension* maxSize);
CFX_WideString getMessage();
void setSkipAtEnd(int32_t count);
- FX_WCHAR getCurrentChar();
- FX_WCHAR getCurrent();
+ wchar_t getCurrentChar();
+ wchar_t getCurrent();
void writeCodewords(CFX_WideString codewords);
- void writeCodeword(FX_WCHAR codeword);
+ void writeCodeword(wchar_t codeword);
int32_t getCodewordCount();
void signalEncoderChange(int32_t encoding);
void resetEncoderSignal();
diff --git a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp
index 17eec1ee4f..ffdd308d54 100644
--- a/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_ErrorCorrection.cpp
@@ -150,7 +150,7 @@ CFX_WideString CBC_ErrorCorrection::encodeECC200(CFX_WideString codewords,
for (int32_t block = 0; block < blockCount; block++) {
CFX_WideString temp;
for (int32_t d = block; d < symbolInfo->m_dataCapacity; d += blockCount) {
- temp += (FX_WCHAR)codewords.GetAt(d);
+ temp += (wchar_t)codewords.GetAt(d);
}
CFX_WideString ecc = createECCBlock(temp, errorSizes[block], e);
if (e != BCExceptionNO)
@@ -203,7 +203,7 @@ CFX_WideString CBC_ErrorCorrection::createECCBlock(CFX_WideString codewords,
}
CFX_WideString strecc;
for (int32_t j = 0; j < numECWords; j++) {
- strecc += (FX_WCHAR)ecc[numECWords - j - 1];
+ strecc += (wchar_t)ecc[numECWords - j - 1];
}
FX_Free(ecc);
return strecc;
diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
index abd3584761..ec6eb02b1c 100644
--- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
@@ -40,17 +40,17 @@
#include "xfa/fxbarcode/datamatrix/BC_X12Encoder.h"
#include "xfa/fxbarcode/utils.h"
-FX_WCHAR CBC_HighLevelEncoder::LATCH_TO_C40 = 230;
-FX_WCHAR CBC_HighLevelEncoder::LATCH_TO_BASE256 = 231;
-FX_WCHAR CBC_HighLevelEncoder::UPPER_SHIFT = 235;
-FX_WCHAR CBC_HighLevelEncoder::LATCH_TO_ANSIX12 = 238;
-FX_WCHAR CBC_HighLevelEncoder::LATCH_TO_TEXT = 239;
-FX_WCHAR CBC_HighLevelEncoder::LATCH_TO_EDIFACT = 240;
-FX_WCHAR CBC_HighLevelEncoder::C40_UNLATCH = 254;
-FX_WCHAR CBC_HighLevelEncoder::X12_UNLATCH = 254;
-FX_WCHAR CBC_HighLevelEncoder::PAD = 129;
-FX_WCHAR CBC_HighLevelEncoder::MACRO_05 = 236;
-FX_WCHAR CBC_HighLevelEncoder::MACRO_06 = 237;
+wchar_t CBC_HighLevelEncoder::LATCH_TO_C40 = 230;
+wchar_t CBC_HighLevelEncoder::LATCH_TO_BASE256 = 231;
+wchar_t CBC_HighLevelEncoder::UPPER_SHIFT = 235;
+wchar_t CBC_HighLevelEncoder::LATCH_TO_ANSIX12 = 238;
+wchar_t CBC_HighLevelEncoder::LATCH_TO_TEXT = 239;
+wchar_t CBC_HighLevelEncoder::LATCH_TO_EDIFACT = 240;
+wchar_t CBC_HighLevelEncoder::C40_UNLATCH = 254;
+wchar_t CBC_HighLevelEncoder::X12_UNLATCH = 254;
+wchar_t CBC_HighLevelEncoder::PAD = 129;
+wchar_t CBC_HighLevelEncoder::MACRO_05 = 236;
+wchar_t CBC_HighLevelEncoder::MACRO_06 = 237;
const wchar_t* CBC_HighLevelEncoder::MACRO_05_HEADER = L"[)>05";
const wchar_t* CBC_HighLevelEncoder::MACRO_06_HEADER = L"[)>06";
const wchar_t CBC_HighLevelEncoder::MACRO_TRAILER = 0x0004;
@@ -184,7 +184,7 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg,
}
return C40_ENCODATION;
}
- FX_WCHAR c = msg.GetAt(startpos + charsProcessed);
+ wchar_t c = msg.GetAt(startpos + charsProcessed);
charsProcessed++;
if (isDigit(c)) {
charCounts[ASCII_ENCODATION] += 0.5;
@@ -271,7 +271,7 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg,
if (intCharCounts[C40_ENCODATION] == intCharCounts[X12_ENCODATION]) {
int32_t p = startpos + charsProcessed + 1;
while (p < msg.GetLength()) {
- FX_WCHAR tc = msg.GetAt(p);
+ wchar_t tc = msg.GetAt(p);
if (isX12TermSep(tc)) {
return X12_ENCODATION;
}
@@ -286,10 +286,10 @@ int32_t CBC_HighLevelEncoder::lookAheadTest(CFX_WideString msg,
}
}
}
-bool CBC_HighLevelEncoder::isDigit(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isDigit(wchar_t ch) {
return ch >= '0' && ch <= '9';
}
-bool CBC_HighLevelEncoder::isExtendedASCII(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isExtendedASCII(wchar_t ch) {
return ch >= 128 && ch <= 255;
}
int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg,
@@ -298,7 +298,7 @@ int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg,
int32_t len = msg.GetLength();
int32_t idx = startpos;
if (idx < len) {
- FX_WCHAR ch = msg.GetAt(idx);
+ wchar_t ch = msg.GetAt(idx);
while (isDigit(ch) && idx < len) {
count++;
idx++;
@@ -309,15 +309,15 @@ int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg,
}
return count;
}
-void CBC_HighLevelEncoder::illegalCharacter(FX_WCHAR c, int32_t& e) {
+void CBC_HighLevelEncoder::illegalCharacter(wchar_t c, int32_t& e) {
e = BCExceptionIllegalArgument;
}
-FX_WCHAR CBC_HighLevelEncoder::randomize253State(FX_WCHAR ch,
- int32_t codewordPosition) {
+wchar_t CBC_HighLevelEncoder::randomize253State(wchar_t ch,
+ int32_t codewordPosition) {
int32_t pseudoRandom = ((149 * codewordPosition) % 253) + 1;
int32_t tempVariable = ch + pseudoRandom;
- return tempVariable <= 254 ? (FX_WCHAR)tempVariable
- : (FX_WCHAR)(tempVariable - 254);
+ return tempVariable <= 254 ? (wchar_t)tempVariable
+ : (wchar_t)(tempVariable - 254);
}
int32_t CBC_HighLevelEncoder::findMinimums(
std::vector<FX_FLOAT>& charCounts,
@@ -350,22 +350,22 @@ int32_t CBC_HighLevelEncoder::getMinimumCount(
}
return minCount;
}
-bool CBC_HighLevelEncoder::isNativeC40(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeC40(wchar_t ch) {
return (ch == ' ') || (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z');
}
-bool CBC_HighLevelEncoder::isNativeText(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeText(wchar_t ch) {
return (ch == ' ') || (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'z');
}
-bool CBC_HighLevelEncoder::isNativeX12(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeX12(wchar_t ch) {
return isX12TermSep(ch) || (ch == ' ') || (ch >= '0' && ch <= '9') ||
(ch >= 'A' && ch <= 'Z');
}
-bool CBC_HighLevelEncoder::isX12TermSep(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isX12TermSep(wchar_t ch) {
return (ch == '\r') || (ch == '*') || (ch == '>');
}
-bool CBC_HighLevelEncoder::isNativeEDIFACT(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isNativeEDIFACT(wchar_t ch) {
return ch >= ' ' && ch <= '^';
}
-bool CBC_HighLevelEncoder::isSpecialB256(FX_WCHAR ch) {
+bool CBC_HighLevelEncoder::isSpecialB256(wchar_t ch) {
return false;
}
diff --git a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h
index 5d72f1074e..cfd16ed676 100644
--- a/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_HighLevelEncoder.h
@@ -36,44 +36,44 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint {
static int32_t lookAheadTest(CFX_WideString msg,
int32_t startpos,
int32_t currentMode);
- static bool isDigit(FX_WCHAR ch);
- static bool isExtendedASCII(FX_WCHAR ch);
+ static bool isDigit(wchar_t ch);
+ static bool isExtendedASCII(wchar_t ch);
static int32_t determineConsecutiveDigitCount(CFX_WideString msg,
int32_t startpos);
- static void illegalCharacter(FX_WCHAR c, int32_t& e);
+ static void illegalCharacter(wchar_t c, int32_t& e);
public:
- static FX_WCHAR LATCH_TO_C40;
- static FX_WCHAR LATCH_TO_BASE256;
- static FX_WCHAR UPPER_SHIFT;
- static FX_WCHAR LATCH_TO_ANSIX12;
- static FX_WCHAR LATCH_TO_TEXT;
- static FX_WCHAR LATCH_TO_EDIFACT;
- static FX_WCHAR C40_UNLATCH;
- static FX_WCHAR X12_UNLATCH;
+ static wchar_t LATCH_TO_C40;
+ static wchar_t LATCH_TO_BASE256;
+ static wchar_t UPPER_SHIFT;
+ static wchar_t LATCH_TO_ANSIX12;
+ static wchar_t LATCH_TO_TEXT;
+ static wchar_t LATCH_TO_EDIFACT;
+ static wchar_t C40_UNLATCH;
+ static wchar_t X12_UNLATCH;
private:
- static FX_WCHAR PAD;
- static FX_WCHAR MACRO_05;
- static FX_WCHAR MACRO_06;
+ static wchar_t PAD;
+ static wchar_t MACRO_05;
+ static wchar_t MACRO_06;
static const wchar_t* MACRO_05_HEADER;
static const wchar_t* MACRO_06_HEADER;
static const wchar_t MACRO_TRAILER;
CFX_ArrayTemplate<uint8_t> m_bytearray;
private:
- static FX_WCHAR randomize253State(FX_WCHAR ch, int32_t codewordPosition);
+ static wchar_t randomize253State(wchar_t ch, int32_t codewordPosition);
static int32_t findMinimums(std::vector<FX_FLOAT>& charCounts,
CFX_ArrayTemplate<int32_t>& intCharCounts,
int32_t min,
CFX_ArrayTemplate<uint8_t>& mins);
static int32_t getMinimumCount(CFX_ArrayTemplate<uint8_t>& mins);
- static bool isNativeC40(FX_WCHAR ch);
- static bool isNativeText(FX_WCHAR ch);
- static bool isNativeX12(FX_WCHAR ch);
- static bool isX12TermSep(FX_WCHAR ch);
- static bool isNativeEDIFACT(FX_WCHAR ch);
- static bool isSpecialB256(FX_WCHAR ch);
+ static bool isNativeC40(wchar_t ch);
+ static bool isNativeText(wchar_t ch);
+ static bool isNativeX12(wchar_t ch);
+ static bool isX12TermSep(wchar_t ch);
+ static bool isNativeEDIFACT(wchar_t ch);
+ static bool isSpecialB256(wchar_t ch);
};
#endif // XFA_FXBARCODE_DATAMATRIX_BC_HIGHLEVELENCODER_H_
diff --git a/xfa/fxbarcode/datamatrix/BC_TextEncoder.cpp b/xfa/fxbarcode/datamatrix/BC_TextEncoder.cpp
index e3eb4a8c4e..cc02661c26 100644
--- a/xfa/fxbarcode/datamatrix/BC_TextEncoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_TextEncoder.cpp
@@ -35,61 +35,59 @@ CBC_TextEncoder::~CBC_TextEncoder() {}
int32_t CBC_TextEncoder::getEncodingMode() {
return TEXT_ENCODATION;
}
-int32_t CBC_TextEncoder::encodeChar(FX_WCHAR c,
- CFX_WideString& sb,
- int32_t& e) {
+int32_t CBC_TextEncoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) {
if (c == ' ') {
- sb += (FX_WCHAR)'\3';
+ sb += (wchar_t)'\3';
return 1;
}
if (c >= '0' && c <= '9') {
- sb += (FX_WCHAR)(c - 48 + 4);
+ sb += (wchar_t)(c - 48 + 4);
return 1;
}
if (c >= 'a' && c <= 'z') {
- sb += (FX_WCHAR)(c - 97 + 14);
+ sb += (wchar_t)(c - 97 + 14);
return 1;
}
if (c <= 0x1f) {
- sb += (FX_WCHAR)'\0';
+ sb += (wchar_t)'\0';
sb += c;
return 2;
}
if (c >= '!' && c <= '/') {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)(c - 33);
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)(c - 33);
return 2;
}
if (c >= ':' && c <= '@') {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)(c - 58 + 15);
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)(c - 58 + 15);
return 2;
}
if (c >= '[' && c <= '_') {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)(c - 91 + 22);
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)(c - 91 + 22);
return 2;
}
if (c == 0x0060) {
- sb += (FX_WCHAR)'\2';
- sb += (FX_WCHAR)(c - 96);
+ sb += (wchar_t)'\2';
+ sb += (wchar_t)(c - 96);
return 2;
}
if (c >= 'A' && c <= 'Z') {
- sb += (FX_WCHAR)'\2';
- sb += (FX_WCHAR)(c - 65 + 1);
+ sb += (wchar_t)'\2';
+ sb += (wchar_t)(c - 65 + 1);
return 2;
}
if (c >= '{' && c <= 0x007f) {
- sb += (FX_WCHAR)'\2';
- sb += (FX_WCHAR)(c - 123 + 27);
+ sb += (wchar_t)'\2';
+ sb += (wchar_t)(c - 123 + 27);
return 2;
}
if (c >= 0x0080) {
- sb += (FX_WCHAR)'\1';
- sb += (FX_WCHAR)0x001e;
+ sb += (wchar_t)'\1';
+ sb += (wchar_t)0x001e;
int32_t len = 2;
- len += encodeChar((FX_WCHAR)(c - 128), sb, e);
+ len += encodeChar((wchar_t)(c - 128), sb, e);
if (e != BCExceptionNO)
return -1;
return len;
diff --git a/xfa/fxbarcode/datamatrix/BC_TextEncoder.h b/xfa/fxbarcode/datamatrix/BC_TextEncoder.h
index e6013b9508..71092023da 100644
--- a/xfa/fxbarcode/datamatrix/BC_TextEncoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_TextEncoder.h
@@ -16,7 +16,7 @@ class CBC_TextEncoder : public CBC_C40Encoder {
// CBC_C40Encoder
int32_t getEncodingMode() override;
- int32_t encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e) override;
+ int32_t encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) override;
};
#endif // XFA_FXBARCODE_DATAMATRIX_BC_TEXTENCODER_H_
diff --git a/xfa/fxbarcode/datamatrix/BC_X12Encoder.cpp b/xfa/fxbarcode/datamatrix/BC_X12Encoder.cpp
index d77af9318a..570076b348 100644
--- a/xfa/fxbarcode/datamatrix/BC_X12Encoder.cpp
+++ b/xfa/fxbarcode/datamatrix/BC_X12Encoder.cpp
@@ -38,7 +38,7 @@ int32_t CBC_X12Encoder::getEncodingMode() {
void CBC_X12Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
CFX_WideString buffer;
while (context.hasMoreCharacters()) {
- FX_WCHAR c = context.getCurrentChar();
+ wchar_t c = context.getCurrentChar();
context.m_pos++;
encodeChar(c, buffer, e);
if (e != BCExceptionNO) {
@@ -79,19 +79,19 @@ void CBC_X12Encoder::handleEOD(CBC_EncoderContext& context,
context.signalEncoderChange(ASCII_ENCODATION);
}
}
-int32_t CBC_X12Encoder::encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e) {
+int32_t CBC_X12Encoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) {
if (c == '\r') {
- sb += (FX_WCHAR)'\0';
+ sb += (wchar_t)'\0';
} else if (c == '*') {
- sb += (FX_WCHAR)'\1';
+ sb += (wchar_t)'\1';
} else if (c == '>') {
- sb += (FX_WCHAR)'\2';
+ sb += (wchar_t)'\2';
} else if (c == ' ') {
- sb += (FX_WCHAR)'\3';
+ sb += (wchar_t)'\3';
} else if (c >= '0' && c <= '9') {
- sb += (FX_WCHAR)(c - 48 + 4);
+ sb += (wchar_t)(c - 48 + 4);
} else if (c >= 'A' && c <= 'Z') {
- sb += (FX_WCHAR)(c - 65 + 14);
+ sb += (wchar_t)(c - 65 + 14);
} else {
CBC_HighLevelEncoder::illegalCharacter(c, e);
if (e != BCExceptionNO)
diff --git a/xfa/fxbarcode/datamatrix/BC_X12Encoder.h b/xfa/fxbarcode/datamatrix/BC_X12Encoder.h
index 52239ce529..693b9bba6c 100644
--- a/xfa/fxbarcode/datamatrix/BC_X12Encoder.h
+++ b/xfa/fxbarcode/datamatrix/BC_X12Encoder.h
@@ -20,7 +20,7 @@ class CBC_X12Encoder : public CBC_C40Encoder {
void handleEOD(CBC_EncoderContext& context,
CFX_WideString& buffer,
int32_t& e) override;
- int32_t encodeChar(FX_WCHAR c, CFX_WideString& sb, int32_t& e) override;
+ int32_t encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) override;
};
#endif // XFA_FXBARCODE_DATAMATRIX_BC_X12ENCODER_H_
diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
index bc0d61fd25..dd7fcaa864 100644
--- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -83,7 +83,7 @@ void CBC_OneDimWriter::SetFontColor(FX_ARGB color) {
m_fontColor = color;
}
-FX_WCHAR CBC_OneDimWriter::Upper(FX_WCHAR ch) {
+wchar_t CBC_OneDimWriter::Upper(wchar_t ch) {
if (ch >= 'a' && ch <= 'z') {
ch = ch - ('a' - 'A');
}
diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.h b/xfa/fxbarcode/oned/BC_OneDimWriter.h
index e37d774341..b7c5cebe06 100644
--- a/xfa/fxbarcode/oned/BC_OneDimWriter.h
+++ b/xfa/fxbarcode/oned/BC_OneDimWriter.h
@@ -96,7 +96,7 @@ class CBC_OneDimWriter : public CBC_Writer {
int32_t startColor,
int32_t& e);
- FX_WCHAR Upper(FX_WCHAR ch);
+ wchar_t Upper(wchar_t ch);
bool m_bPrintChecksum;
int32_t m_iDataLenth;
diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
index 399e5e7d40..7d51fa8f94 100644
--- a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
@@ -28,17 +28,17 @@
namespace {
-const FX_CHAR ALPHABET_STRING[] = "0123456789-$:/.+ABCDTN";
+const char ALPHABET_STRING[] = "0123456789-$:/.+ABCDTN";
const int32_t CHARACTER_ENCODINGS[22] = {
0x003, 0x006, 0x009, 0x060, 0x012, 0x042, 0x021, 0x024,
0x030, 0x048, 0x00c, 0x018, 0x045, 0x051, 0x054, 0x015,
0x01A, 0x029, 0x00B, 0x00E, 0x01A, 0x029};
-const FX_CHAR START_END_CHARS[] = {'A', 'B', 'C', 'D', 'T', 'N', '*', 'E',
- 'a', 'b', 'c', 'd', 't', 'n', 'e'};
-const FX_CHAR CONTENT_CHARS[] = {'0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', '-', '$', '/', ':', '+', '.'};
+const char START_END_CHARS[] = {'A', 'B', 'C', 'D', 'T', 'N', '*', 'E',
+ 'a', 'b', 'c', 'd', 't', 'n', 'e'};
+const char CONTENT_CHARS[] = {'0', '1', '2', '3', '4', '5', '6', '7',
+ '8', '9', '-', '$', '/', ':', '+', '.'};
} // namespace
@@ -48,7 +48,7 @@ CBC_OnedCodaBarWriter::CBC_OnedCodaBarWriter() {
m_iWideNarrRatio = 2;
}
CBC_OnedCodaBarWriter::~CBC_OnedCodaBarWriter() {}
-bool CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start) {
+bool CBC_OnedCodaBarWriter::SetStartChar(char start) {
for (size_t i = 0; i < FX_ArraySize(START_END_CHARS); ++i) {
if (START_END_CHARS[i] == start) {
m_chStart = start;
@@ -58,7 +58,7 @@ bool CBC_OnedCodaBarWriter::SetStartChar(FX_CHAR start) {
return false;
}
-bool CBC_OnedCodaBarWriter::SetEndChar(FX_CHAR end) {
+bool CBC_OnedCodaBarWriter::SetEndChar(char end) {
for (size_t i = 0; i < FX_ArraySize(START_END_CHARS); ++i) {
if (START_END_CHARS[i] == end) {
m_chEnd = end;
@@ -84,22 +84,22 @@ bool CBC_OnedCodaBarWriter::SetWideNarrowRatio(int32_t ratio) {
m_iWideNarrRatio = ratio;
return true;
}
-bool CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, bool isContent) {
+bool CBC_OnedCodaBarWriter::FindChar(wchar_t ch, bool isContent) {
if (isContent) {
for (size_t i = 0; i < FX_ArraySize(CONTENT_CHARS); ++i) {
- if (ch == (FX_WCHAR)CONTENT_CHARS[i]) {
+ if (ch == (wchar_t)CONTENT_CHARS[i]) {
return true;
}
}
for (size_t j = 0; j < FX_ArraySize(START_END_CHARS); ++j) {
- if (ch == (FX_WCHAR)START_END_CHARS[j]) {
+ if (ch == (wchar_t)START_END_CHARS[j]) {
return true;
}
}
return false;
} else {
for (size_t i = 0; i < FX_ArraySize(CONTENT_CHARS); ++i) {
- if (ch == (FX_WCHAR)CONTENT_CHARS[i]) {
+ if (ch == (wchar_t)CONTENT_CHARS[i]) {
return true;
}
}
@@ -108,7 +108,7 @@ bool CBC_OnedCodaBarWriter::FindChar(FX_WCHAR ch, bool isContent) {
}
bool CBC_OnedCodaBarWriter::CheckContentValidity(
const CFX_WideStringC& contents) {
- FX_WCHAR ch;
+ wchar_t ch;
int32_t index = 0;
for (index = 0; index < contents.GetLength(); index++) {
ch = contents.GetAt(index);
@@ -123,7 +123,7 @@ bool CBC_OnedCodaBarWriter::CheckContentValidity(
CFX_WideString CBC_OnedCodaBarWriter::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filtercontents;
- FX_WCHAR ch;
+ wchar_t ch;
for (int32_t index = 0; index < contents.GetLength(); index++) {
ch = contents.GetAt(index);
if (ch > 175) {
@@ -170,7 +170,7 @@ uint8_t* CBC_OnedCodaBarWriter::Encode(const CFX_ByteString& contents,
CFX_ByteString data = m_chStart + contents + m_chEnd;
m_iContentLen = data.GetLength();
uint8_t* result = FX_Alloc2D(uint8_t, m_iWideNarrRatio * 7, data.GetLength());
- FX_CHAR ch;
+ char ch;
int32_t position = 0;
for (int32_t index = 0; index < data.GetLength(); index++) {
ch = data.GetAt(index);
diff --git a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h
index 301c34a751..0d01ad9242 100644
--- a/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h
+++ b/xfa/fxbarcode/oned/BC_OnedCodaBarWriter.h
@@ -37,11 +37,11 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter {
void SetDataLength(int32_t length) override;
virtual CFX_WideString encodedContents(const CFX_WideStringC& contents);
- virtual bool SetStartChar(FX_CHAR start);
- virtual bool SetEndChar(FX_CHAR end);
+ virtual bool SetStartChar(char start);
+ virtual bool SetEndChar(char end);
virtual bool SetTextLocation(BC_TEXT_LOC location);
virtual bool SetWideNarrowRatio(int32_t ratio);
- virtual bool FindChar(FX_WCHAR ch, bool isContent);
+ virtual bool FindChar(wchar_t ch, bool isContent);
private:
void RenderResult(const CFX_WideStringC& contents,
@@ -50,8 +50,8 @@ class CBC_OnedCodaBarWriter : public CBC_OneDimWriter {
bool isDevice,
int32_t& e) override;
- FX_CHAR m_chStart;
- FX_CHAR m_chEnd;
+ char m_chStart;
+ char m_chEnd;
int32_t m_iWideNarrRatio;
};
diff --git a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
index f163b18663..c1e28a50c1 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCode128Writer.cpp
@@ -102,7 +102,7 @@ bool CBC_OnedCode128Writer::CheckContentValidity(
CFX_WideString CBC_OnedCode128Writer::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filterChineseChar;
- FX_WCHAR ch;
+ wchar_t ch;
for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if (ch > 175) {
@@ -253,7 +253,7 @@ int32_t CBC_OnedCode128Writer::Encode128C(
checkSum += CODE_START_C * checkWeight;
while (position < contents.GetLength()) {
int32_t patternIndex = 0;
- FX_CHAR ch = contents.GetAt(position);
+ char ch = contents.GetAt(position);
if (ch < '0' || ch > '9') {
patternIndex = (int32_t)ch;
position++;
diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
index a1ba5c8086..bd0607d3cd 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.cpp
@@ -27,10 +27,9 @@
namespace {
-const FX_CHAR ALPHABET_STRING[] =
- "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
+const char ALPHABET_STRING[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
-const FX_CHAR CHECKSUM_STRING[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
+const char CHECKSUM_STRING[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%";
const int32_t CHARACTER_ENCODINGS[44] = {
0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124,
@@ -48,12 +47,12 @@ CBC_OnedCode39Writer::~CBC_OnedCode39Writer() {}
bool CBC_OnedCode39Writer::CheckContentValidity(
const CFX_WideStringC& contents) {
for (int32_t i = 0; i < contents.GetLength(); i++) {
- FX_WCHAR ch = contents.GetAt(i);
- if ((ch >= (FX_WCHAR)'0' && ch <= (FX_WCHAR)'9') ||
- (ch >= (FX_WCHAR)'A' && ch <= (FX_WCHAR)'Z') || ch == (FX_WCHAR)'-' ||
- ch == (FX_WCHAR)'.' || ch == (FX_WCHAR)' ' || ch == (FX_WCHAR)'*' ||
- ch == (FX_WCHAR)'$' || ch == (FX_WCHAR)'/' || ch == (FX_WCHAR)'+' ||
- ch == (FX_WCHAR)'%') {
+ wchar_t ch = contents.GetAt(i);
+ if ((ch >= (wchar_t)'0' && ch <= (wchar_t)'9') ||
+ (ch >= (wchar_t)'A' && ch <= (wchar_t)'Z') || ch == (wchar_t)'-' ||
+ ch == (wchar_t)'.' || ch == (wchar_t)' ' || ch == (wchar_t)'*' ||
+ ch == (wchar_t)'$' || ch == (wchar_t)'/' || ch == (wchar_t)'+' ||
+ ch == (wchar_t)'%') {
continue;
}
return false;
@@ -65,8 +64,8 @@ CFX_WideString CBC_OnedCode39Writer::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filtercontents;
for (int32_t i = 0; i < contents.GetLength(); i++) {
- FX_WCHAR ch = contents.GetAt(i);
- if (ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1)) {
+ wchar_t ch = contents.GetAt(i);
+ if (ch == (wchar_t)'*' && (i == 0 || i == contents.GetLength() - 1)) {
continue;
}
if (ch > 175) {
@@ -75,11 +74,11 @@ CFX_WideString CBC_OnedCode39Writer::FilterContents(
} else {
ch = Upper(ch);
}
- if ((ch >= (FX_WCHAR)'0' && ch <= (FX_WCHAR)'9') ||
- (ch >= (FX_WCHAR)'A' && ch <= (FX_WCHAR)'Z') || ch == (FX_WCHAR)'-' ||
- ch == (FX_WCHAR)'.' || ch == (FX_WCHAR)' ' || ch == (FX_WCHAR)'*' ||
- ch == (FX_WCHAR)'$' || ch == (FX_WCHAR)'/' || ch == (FX_WCHAR)'+' ||
- ch == (FX_WCHAR)'%') {
+ if ((ch >= (wchar_t)'0' && ch <= (wchar_t)'9') ||
+ (ch >= (wchar_t)'A' && ch <= (wchar_t)'Z') || ch == (wchar_t)'-' ||
+ ch == (wchar_t)'.' || ch == (wchar_t)' ' || ch == (wchar_t)'*' ||
+ ch == (wchar_t)'$' || ch == (wchar_t)'/' || ch == (wchar_t)'+' ||
+ ch == (wchar_t)'%') {
filtercontents += ch;
}
}
@@ -90,20 +89,20 @@ CFX_WideString CBC_OnedCode39Writer::RenderTextContents(
const CFX_WideStringC& contents) {
CFX_WideString renderContents;
for (int32_t i = 0; i < contents.GetLength(); i++) {
- FX_WCHAR ch = contents.GetAt(i);
- if (ch == (FX_WCHAR)'*' && (i == 0 || i == contents.GetLength() - 1)) {
+ wchar_t ch = contents.GetAt(i);
+ if (ch == (wchar_t)'*' && (i == 0 || i == contents.GetLength() - 1)) {
continue;
}
if (ch > 175) {
i++;
continue;
}
- if ((ch >= (FX_WCHAR)'0' && ch <= (FX_WCHAR)'9') ||
- (ch >= (FX_WCHAR)'A' && ch <= (FX_WCHAR)'Z') ||
- (ch >= (FX_WCHAR)'a' && ch <= (FX_WCHAR)'z') || ch == (FX_WCHAR)'-' ||
- ch == (FX_WCHAR)'.' || ch == (FX_WCHAR)' ' || ch == (FX_WCHAR)'*' ||
- ch == (FX_WCHAR)'$' || ch == (FX_WCHAR)'/' || ch == (FX_WCHAR)'+' ||
- ch == (FX_WCHAR)'%') {
+ if ((ch >= (wchar_t)'0' && ch <= (wchar_t)'9') ||
+ (ch >= (wchar_t)'A' && ch <= (wchar_t)'Z') ||
+ (ch >= (wchar_t)'a' && ch <= (wchar_t)'z') || ch == (wchar_t)'-' ||
+ ch == (wchar_t)'.' || ch == (wchar_t)' ' || ch == (wchar_t)'*' ||
+ ch == (wchar_t)'$' || ch == (wchar_t)'/' || ch == (wchar_t)'+' ||
+ ch == (wchar_t)'%') {
renderContents += ch;
}
}
@@ -155,8 +154,8 @@ void CBC_OnedCode39Writer::ToIntArray(int32_t a, int32_t* toReturn) {
toReturn[i] = (a & (1 << i)) == 0 ? 1 : m_iWideNarrRatio;
}
}
-FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString& contents,
- int32_t& e) {
+char CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString& contents,
+ int32_t& e) {
int32_t length = contents.GetLength();
if (length > 80) {
e = BCExceptionContentsLengthShouldBetween1and80;
@@ -187,7 +186,7 @@ FX_CHAR CBC_OnedCode39Writer::CalcCheckSum(const CFX_ByteString& contents,
uint8_t* CBC_OnedCode39Writer::Encode(const CFX_ByteString& contents,
int32_t& outlength,
int32_t& e) {
- FX_CHAR checksum = CalcCheckSum(contents, e);
+ char checksum = CalcCheckSum(contents, e);
if (checksum == '*') {
return nullptr;
}
@@ -263,7 +262,7 @@ CFX_WideString CBC_OnedCode39Writer::encodedContents(
if (m_bCalcChecksum && m_bPrintChecksum) {
CFX_WideString checksumContent = FilterContents(contents);
CFX_ByteString str = checksumContent.UTF8Encode();
- FX_CHAR checksum;
+ char checksum;
checksum = CalcCheckSum(str, e);
if (e != BCExceptionNO)
return CFX_WideString();
diff --git a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h
index c8755a3e69..5f7c294c2b 100644
--- a/xfa/fxbarcode/oned/BC_OnedCode39Writer.h
+++ b/xfa/fxbarcode/oned/BC_OnedCode39Writer.h
@@ -46,7 +46,7 @@ class CBC_OnedCode39Writer : public CBC_OneDimWriter {
private:
void ToIntArray(int32_t a, int32_t* toReturn);
- FX_CHAR CalcCheckSum(const CFX_ByteString& contents, int32_t& e);
+ char CalcCheckSum(const CFX_ByteString& contents, int32_t& e);
int32_t m_iWideNarrRatio;
};
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index bcbc80a61d..47e47eaddb 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -62,7 +62,7 @@ bool CBC_OnedEAN13Writer::CheckContentValidity(
CFX_WideString CBC_OnedEAN13Writer::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filtercontents;
- FX_WCHAR ch;
+ wchar_t ch;
for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if (ch > 175) {
diff --git a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
index c40223818f..cd21759a19 100644
--- a/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -65,7 +65,7 @@ bool CBC_OnedEAN8Writer::CheckContentValidity(const CFX_WideStringC& contents) {
CFX_WideString CBC_OnedEAN8Writer::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filtercontents;
- FX_WCHAR ch;
+ wchar_t ch;
for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if (ch > 175) {
diff --git a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index 6d6e79637c..3cb72f204a 100644
--- a/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -50,7 +50,7 @@ bool CBC_OnedUPCAWriter::CheckContentValidity(const CFX_WideStringC& contents) {
CFX_WideString CBC_OnedUPCAWriter::FilterContents(
const CFX_WideStringC& contents) {
CFX_WideString filtercontents;
- FX_WCHAR ch;
+ wchar_t ch;
for (int32_t i = 0; i < contents.GetLength(); i++) {
ch = contents.GetAt(i);
if (ch > 175) {
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417.cpp b/xfa/fxbarcode/pdf417/BC_PDF417.cpp
index 2f01564b11..94c65b8538 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417.cpp
@@ -427,10 +427,10 @@ void CBC_PDF417::generateBarcodeLogic(CFX_WideString msg,
}
int32_t n = sourceCodeWords + pad + 1;
CFX_WideString sb;
- sb += (FX_WCHAR)n;
+ sb += (wchar_t)n;
sb += highLevel;
for (int32_t i = 0; i < pad; i++) {
- sb += (FX_WCHAR)900;
+ sb += (wchar_t)900;
}
CFX_WideString dataCodewords(sb);
CFX_WideString ec = CBC_PDF417ErrorCorrection::generateErrorCorrection(
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp b/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp
index bdec403970..71cdc351db 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417ErrorCorrection.cpp
@@ -163,8 +163,8 @@ CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(
int32_t k = getErrorCorrectionCodewordCount(errorCorrectionLevel, e);
if (e != BCExceptionNO)
return L" ";
- FX_WCHAR* ech = FX_Alloc(FX_WCHAR, k);
- FXSYS_memset(ech, 0, k * sizeof(FX_WCHAR));
+ wchar_t* ech = FX_Alloc(wchar_t, k);
+ FXSYS_memset(ech, 0, k * sizeof(wchar_t));
int32_t sld = dataCodewords.GetLength();
for (int32_t i = 0; i < sld; i++) {
int32_t t1 = (dataCodewords.GetAt(i) + ech[k - 1]) % 929;
@@ -173,18 +173,18 @@ CFX_WideString CBC_PDF417ErrorCorrection::generateErrorCorrection(
for (int32_t j = k - 1; j >= 1; j--) {
t2 = (t1 * EC_COEFFICIENTS[errorCorrectionLevel][j]) % 929;
t3 = 929 - t2;
- ech[j] = (FX_WCHAR)((ech[j - 1] + t3) % 929);
+ ech[j] = (wchar_t)((ech[j - 1] + t3) % 929);
}
t2 = (t1 * EC_COEFFICIENTS[errorCorrectionLevel][0]) % 929;
t3 = 929 - t2;
- ech[0] = (FX_WCHAR)(t3 % 929);
+ ech[0] = (wchar_t)(t3 % 929);
}
CFX_WideString sb;
for (int32_t j = k - 1; j >= 0; j--) {
if (ech[j] != 0) {
- ech[j] = (FX_WCHAR)(929 - ech[j]);
+ ech[j] = (wchar_t)(929 - ech[j]);
}
- sb += (FX_WCHAR)ech[j];
+ sb += (wchar_t)ech[j];
}
FX_Free(ech);
return sb;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
index 08a40c51b3..0d9c7cfbd0 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
+++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
@@ -64,7 +64,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(
CFX_WideString msg;
int32_t len = bytes.GetLength();
for (int32_t i = 0; i < len; i++) {
- FX_WCHAR ch = (FX_WCHAR)(bytes.GetAt(i) & 0xff);
+ wchar_t ch = (wchar_t)(bytes.GetAt(i) & 0xff);
if (ch == '?' && bytes.GetAt(i) != '?') {
e = BCExceptionCharactersOutsideISO88591Encoding;
return CFX_WideString();
@@ -84,14 +84,14 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(
} else if (compaction == BYTES) {
encodeBinary(&byteArr, p, byteArr.GetSize(), BYTE_COMPACTION, sb);
} else if (compaction == NUMERIC) {
- sb += (FX_WCHAR)LATCH_TO_NUMERIC;
+ sb += (wchar_t)LATCH_TO_NUMERIC;
encodeNumeric(msg, p, len, sb);
} else {
int32_t encodingMode = LATCH_TO_TEXT;
while (p < len) {
int32_t n = determineConsecutiveDigitCount(msg, p);
if (n >= 13) {
- sb += (FX_WCHAR)LATCH_TO_NUMERIC;
+ sb += (wchar_t)LATCH_TO_NUMERIC;
encodingMode = NUMERIC_COMPACTION;
textSubMode = SUBMODE_ALPHA;
encodeNumeric(msg, p, n, sb);
@@ -100,7 +100,7 @@ CFX_WideString CBC_PDF417HighLevelEncoder::encodeHighLevel(
int32_t t = determineConsecutiveTextCount(msg, p);
if (t >= 5 || n == len) {
if (encodingMode != TEXT_COMPACTION) {
- sb += (FX_WCHAR)LATCH_TO_TEXT;
+ sb += (wchar_t)LATCH_TO_TEXT;
encodingMode = TEXT_COMPACTION;
textSubMode = SUBMODE_ALPHA;
}
@@ -157,26 +157,26 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
int32_t submode = initialSubmode;
int32_t idx = 0;
while (true) {
- FX_WCHAR ch = msg.GetAt(startpos + idx);
+ wchar_t ch = msg.GetAt(startpos + idx);
switch (submode) {
case SUBMODE_ALPHA:
if (isAlphaUpper(ch)) {
if (ch == ' ') {
- tmp += (FX_WCHAR)26;
+ tmp += (wchar_t)26;
} else {
- tmp += (FX_WCHAR)(ch - 65);
+ tmp += (wchar_t)(ch - 65);
}
} else {
if (isAlphaLower(ch)) {
submode = SUBMODE_LOWER;
- tmp += (FX_WCHAR)27;
+ tmp += (wchar_t)27;
continue;
} else if (isMixed(ch)) {
submode = SUBMODE_MIXED;
- tmp += (FX_WCHAR)28;
+ tmp += (wchar_t)28;
continue;
} else {
- tmp += (FX_WCHAR)29;
+ tmp += (wchar_t)29;
tmp += PUNCTUATION[ch];
break;
}
@@ -185,21 +185,21 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
case SUBMODE_LOWER:
if (isAlphaLower(ch)) {
if (ch == ' ') {
- tmp += (FX_WCHAR)26;
+ tmp += (wchar_t)26;
} else {
- tmp += (FX_WCHAR)(ch - 97);
+ tmp += (wchar_t)(ch - 97);
}
} else {
if (isAlphaUpper(ch)) {
- tmp += (FX_WCHAR)27;
- tmp += (FX_WCHAR)(ch - 65);
+ tmp += (wchar_t)27;
+ tmp += (wchar_t)(ch - 65);
break;
} else if (isMixed(ch)) {
submode = SUBMODE_MIXED;
- tmp += (FX_WCHAR)28;
+ tmp += (wchar_t)28;
continue;
} else {
- tmp += (FX_WCHAR)29;
+ tmp += (wchar_t)29;
tmp += PUNCTUATION[ch];
break;
}
@@ -211,22 +211,22 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
} else {
if (isAlphaUpper(ch)) {
submode = SUBMODE_ALPHA;
- tmp += (FX_WCHAR)28;
+ tmp += (wchar_t)28;
continue;
} else if (isAlphaLower(ch)) {
submode = SUBMODE_LOWER;
- tmp += (FX_WCHAR)27;
+ tmp += (wchar_t)27;
continue;
} else {
if (startpos + idx + 1 < count) {
- FX_WCHAR next = msg.GetAt(startpos + idx + 1);
+ wchar_t next = msg.GetAt(startpos + idx + 1);
if (isPunctuation(next)) {
submode = SUBMODE_PUNCTUATION;
- tmp += (FX_WCHAR)25;
+ tmp += (wchar_t)25;
continue;
}
}
- tmp += (FX_WCHAR)29;
+ tmp += (wchar_t)29;
tmp += PUNCTUATION[ch];
}
}
@@ -236,7 +236,7 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
tmp += PUNCTUATION[ch];
} else {
submode = SUBMODE_ALPHA;
- tmp += (FX_WCHAR)29;
+ tmp += (wchar_t)29;
continue;
}
}
@@ -245,19 +245,19 @@ int32_t CBC_PDF417HighLevelEncoder::encodeText(CFX_WideString msg,
break;
}
}
- FX_WCHAR h = 0;
+ wchar_t h = 0;
int32_t len = tmp.GetLength();
for (int32_t i = 0; i < len; i++) {
bool odd = (i % 2) != 0;
if (odd) {
- h = (FX_WCHAR)((h * 30) + tmp.GetAt(i));
+ h = (wchar_t)((h * 30) + tmp.GetAt(i));
sb += h;
} else {
h = tmp.GetAt(i);
}
}
if ((len % 2) != 0) {
- sb += (FX_WCHAR)((h * 30) + 29);
+ sb += (wchar_t)((h * 30) + 29);
}
return submode;
}
@@ -267,13 +267,13 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes,
int32_t startmode,
CFX_WideString& sb) {
if (count == 1 && startmode == TEXT_COMPACTION) {
- sb += (FX_WCHAR)SHIFT_TO_BYTE;
+ sb += (wchar_t)SHIFT_TO_BYTE;
}
int32_t idx = startpos;
int32_t i = 0;
if (count >= 6) {
- sb += (FX_WCHAR)LATCH_TO_BYTE;
- FX_WCHAR chars[5];
+ sb += (wchar_t)LATCH_TO_BYTE;
+ wchar_t chars[5];
while ((startpos + count - idx) >= 6) {
int64_t t = 0;
for (i = 0; i < 6; i++) {
@@ -281,7 +281,7 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes,
t += bytes->GetAt(idx + i) & 0xff;
}
for (i = 0; i < 5; i++) {
- chars[i] = (FX_WCHAR)(t % 900);
+ chars[i] = (wchar_t)(t % 900);
t /= 900;
}
for (i = 4; i >= 0; i--) {
@@ -291,11 +291,11 @@ void CBC_PDF417HighLevelEncoder::encodeBinary(CFX_ArrayTemplate<uint8_t>* bytes,
}
}
if (idx < startpos + count) {
- sb += (FX_WCHAR)LATCH_TO_BYTE_PADDED;
+ sb += (wchar_t)LATCH_TO_BYTE_PADDED;
}
for (i = idx; i < startpos + count; i++) {
int32_t ch = bytes->GetAt(i) & 0xff;
- sb += (FX_WCHAR)ch;
+ sb += (wchar_t)ch;
}
}
void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg,
@@ -308,11 +308,11 @@ void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg,
CFX_WideString tmp;
int32_t len = 44 < count - idx ? 44 : count - idx;
CFX_ByteString part =
- ((FX_WCHAR)'1' + msg.Mid(startpos + idx, len)).UTF8Encode();
+ ((wchar_t)'1' + msg.Mid(startpos + idx, len)).UTF8Encode();
BigInteger bigint = stringToBigInteger(part.c_str());
do {
int32_t c = (bigint % num900).toInt();
- tmp += (FX_WCHAR)(c);
+ tmp += (wchar_t)(c);
bigint = bigint / num900;
} while (!bigint.isZero());
for (int32_t i = tmp.GetLength() - 1; i >= 0; i--) {
@@ -321,22 +321,22 @@ void CBC_PDF417HighLevelEncoder::encodeNumeric(CFX_WideString msg,
idx += len;
}
}
-bool CBC_PDF417HighLevelEncoder::isDigit(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isDigit(wchar_t ch) {
return ch >= '0' && ch <= '9';
}
-bool CBC_PDF417HighLevelEncoder::isAlphaUpper(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isAlphaUpper(wchar_t ch) {
return ch == ' ' || (ch >= 'A' && ch <= 'Z');
}
-bool CBC_PDF417HighLevelEncoder::isAlphaLower(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isAlphaLower(wchar_t ch) {
return ch == ' ' || (ch >= 'a' && ch <= 'z');
}
-bool CBC_PDF417HighLevelEncoder::isMixed(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isMixed(wchar_t ch) {
return MIXED[ch] != -1;
}
-bool CBC_PDF417HighLevelEncoder::isPunctuation(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isPunctuation(wchar_t ch) {
return PUNCTUATION[ch] != -1;
}
-bool CBC_PDF417HighLevelEncoder::isText(FX_WCHAR ch) {
+bool CBC_PDF417HighLevelEncoder::isText(wchar_t ch) {
return ch == '\t' || ch == '\n' || ch == '\r' || (ch >= 32 && ch <= 126);
}
int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(
@@ -346,7 +346,7 @@ int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveDigitCount(
int32_t len = msg.GetLength();
int32_t idx = startpos;
if (idx < len) {
- FX_WCHAR ch = msg.GetAt(idx);
+ wchar_t ch = msg.GetAt(idx);
while (isDigit(ch) && idx < len) {
count++;
idx++;
@@ -363,7 +363,7 @@ int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveTextCount(
int32_t len = msg.GetLength();
int32_t idx = startpos;
while (idx < len) {
- FX_WCHAR ch = msg.GetAt(idx);
+ wchar_t ch = msg.GetAt(idx);
int32_t numericCount = 0;
while (numericCount < 13 && isDigit(ch) && idx < len) {
numericCount++;
@@ -394,7 +394,7 @@ int32_t CBC_PDF417HighLevelEncoder::determineConsecutiveBinaryCount(
int32_t len = msg.GetLength();
int32_t idx = startpos;
while (idx < len) {
- FX_WCHAR ch = msg.GetAt(idx);
+ wchar_t ch = msg.GetAt(idx);
int32_t numericCount = 0;
while (numericCount < 13 && isDigit(ch)) {
numericCount++;
diff --git a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
index 38382c891c..01c2be02f8 100644
--- a/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
+++ b/xfa/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
@@ -48,12 +48,12 @@ class CBC_PDF417HighLevelEncoder {
int32_t startpos,
int32_t count,
CFX_WideString& sb);
- static bool isDigit(FX_WCHAR ch);
- static bool isAlphaUpper(FX_WCHAR ch);
- static bool isAlphaLower(FX_WCHAR ch);
- static bool isMixed(FX_WCHAR ch);
- static bool isPunctuation(FX_WCHAR ch);
- static bool isText(FX_WCHAR ch);
+ static bool isDigit(wchar_t ch);
+ static bool isAlphaUpper(wchar_t ch);
+ static bool isAlphaLower(wchar_t ch);
+ static bool isMixed(wchar_t ch);
+ static bool isPunctuation(wchar_t ch);
+ static bool isText(wchar_t ch);
static int32_t determineConsecutiveDigitCount(CFX_WideString msg,
int32_t startpos);
static int32_t determineConsecutiveTextCount(CFX_WideString msg,
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp b/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp
index a5450cf085..2990d980fc 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.cpp
@@ -30,7 +30,7 @@ CBC_QRCoderErrorCorrectionLevel* CBC_QRCoderErrorCorrectionLevel::H = nullptr;
CBC_QRCoderErrorCorrectionLevel::CBC_QRCoderErrorCorrectionLevel(
int32_t ordinal,
int32_t bits,
- const FX_CHAR* name)
+ const char* name)
: m_ordinal(ordinal), m_bits(bits), m_name(name) {}
CBC_QRCoderErrorCorrectionLevel::~CBC_QRCoderErrorCorrectionLevel() {}
diff --git a/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h b/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h
index e433ee1127..2f0d22eb29 100644
--- a/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h
+++ b/xfa/fxbarcode/qrcode/BC_QRCoderErrorCorrectionLevel.h
@@ -30,7 +30,7 @@ class CBC_QRCoderErrorCorrectionLevel {
private:
CBC_QRCoderErrorCorrectionLevel(int32_t ordinal,
int32_t bits,
- const FX_CHAR* name);
+ const char* name);
CBC_QRCoderErrorCorrectionLevel();
int32_t m_ordinal;
diff --git a/xfa/fxbarcode/utils.h b/xfa/fxbarcode/utils.h
index 1cb8d85013..21ef3830ef 100644
--- a/xfa/fxbarcode/utils.h
+++ b/xfa/fxbarcode/utils.h
@@ -13,8 +13,8 @@ bool BC_FX_ByteString_Replace(CFX_ByteString& dst,
uint32_t first,
uint32_t last,
int32_t count,
- FX_CHAR c);
-void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, FX_CHAR c);
+ char c);
+void BC_FX_ByteString_Append(CFX_ByteString& dst, int32_t count, char c);
void BC_FX_ByteString_Append(CFX_ByteString& dst,
const CFX_ArrayTemplate<uint8_t>& ba);