summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xfa/src/fgas/src/crt/fx_stream.cpp31
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp5
-rw-r--r--xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp27
-rw-r--r--xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp4
4 files changed, 16 insertions, 51 deletions
diff --git a/xfa/src/fgas/src/crt/fx_stream.cpp b/xfa/src/fgas/src/crt/fx_stream.cpp
index e5bf3ef8ba..bb9097ccd7 100644
--- a/xfa/src/fgas/src/crt/fx_stream.cpp
+++ b/xfa/src/fgas/src/crt/fx_stream.cpp
@@ -101,35 +101,20 @@ FX_BOOL CFX_FileStreamImp::LoadFile(const FX_WCHAR* pszSrcFileName,
} else {
wsMode = L"rb";
}
-#ifdef _FX_WINAPI_PARTITION_APP_
- CFX_WideString wsSrcFileName(pszSrcFileName);
- _wfopen_s(&m_hFile, wsSrcFileName, wsMode);
-#else
m_hFile = FXSYS_wfopen(pszSrcFileName, wsMode);
-#endif
- if (m_hFile == NULL) {
+
+ if (!m_hFile) {
if (dwAccess & FX_STREAMACCESS_Write) {
- if (dwAccess & FX_STREAMACCESS_Create) {
-#ifdef _FX_WINAPI_PARTITION_APP_
- CFX_WideString wsSrcFileName(pszSrcFileName);
- _wfopen_s(&m_hFile, wsSrcFileName, L"w+b");
-#else
+ if (dwAccess & FX_STREAMACCESS_Create)
m_hFile = FXSYS_wfopen(pszSrcFileName, L"w+b");
-#endif
- }
- if (m_hFile == NULL) {
-#ifdef _FX_WINAPI_PARTITION_APP_
- CFX_WideString wsSrcFileName(pszSrcFileName);
- _wfopen_s(&m_hFile, wsSrcFileName, L"r+b");
-#else
+
+ if (!m_hFile) {
m_hFile = FXSYS_wfopen(pszSrcFileName, L"r+b");
-#endif
- if (m_hFile == NULL) {
+ if (!m_hFile)
return FALSE;
- }
- if (dwAccess & FX_STREAMACCESS_Truncate) {
+
+ if (dwAccess & FX_STREAMACCESS_Truncate)
FX_fsetsize(m_hFile, 0);
- }
}
} else {
return FALSE;
diff --git a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp
index 61cacc1612..c719fb9e4f 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_Base256Encoder.cpp
@@ -49,12 +49,7 @@ void CBC_Base256Encoder::Encode(CBC_EncoderContext& context, int32_t& e) {
}
int32_t dataCount = buffer.GetLength() - 1;
FX_CHAR buf[128];
-#if defined(_FX_WINAPI_PARTITION_APP_)
- memset(buf, 0, sizeof(FX_CHAR) * 128);
- _itoa_s(dataCount, buf, 128, 10);
-#else
FXSYS_itoa(dataCount, buf, 10);
-#endif
buffer.SetAt(0, FX_WCHAR(*buf) - '0');
int32_t lengthFieldSize = 1;
int32_t currentSize =
diff --git a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp
index 79e47177a6..f378fff05d 100644
--- a/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp
+++ b/xfa/src/fxbarcode/datamatrix/BC_DataMatrixDecodedBitStreamParser.cpp
@@ -121,12 +121,7 @@ int32_t CBC_DataMatrixDecodedBitStreamParser::DecodeAsciiSegment(
return PAD_ENCODE;
} else if (oneByte <= 229) {
int32_t value = oneByte - 130;
-#if defined(_FX_WINAPI_PARTITION_APP_)
- memset(buffer, 0, sizeof(FX_CHAR) * 128);
- _itoa_s(value, buffer, 128, 10);
-#else
FXSYS_itoa(value, buffer, 10);
-#endif
if (value < 10) {
result += '0';
buffer[1] = '\0';
@@ -401,6 +396,7 @@ void CBC_DataMatrixDecodedBitStreamParser::ParseTwoBytes(
result[1] = temp;
result[2] = fullBitValue - temp * 40;
}
+
void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(
CBC_CommonBitSource* bits,
CFX_ByteString& result,
@@ -408,31 +404,24 @@ void CBC_DataMatrixDecodedBitStreamParser::DecodeEdifactSegment(
FX_CHAR buffer[128];
FX_BOOL unlatch = FALSE;
do {
- if (bits->Available() <= 16) {
+ if (bits->Available() <= 16)
return;
- }
- int32_t i;
- for (i = 0; i < 4; i++) {
+
+ for (int32_t i = 0; i < 4; i++) {
int32_t edifactValue = bits->ReadBits(6, e);
BC_EXCEPTION_CHECK_ReturnVoid(e);
- if (edifactValue == 0x1F) {
+ if (edifactValue == 0x1F)
unlatch = TRUE;
- }
+
if (!unlatch) {
- if ((edifactValue & 32) == 0) {
+ if ((edifactValue & 32) == 0)
edifactValue |= 64;
- }
-#if defined(_FX_WINAPI_PARTITION_APP_)
- memset(buffer, 0, sizeof(FX_CHAR) * 128);
- _itoa_s(edifactValue, buffer, 128, 10);
- result += buffer;
-#else
result += FXSYS_itoa(edifactValue, buffer, 10);
-#endif
}
}
} while (!unlatch && bits->Available() > 0);
}
+
void CBC_DataMatrixDecodedBitStreamParser::DecodeBase256Segment(
CBC_CommonBitSource* bits,
CFX_ByteString& result,
diff --git a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp
index 582f93bc15..33be8c57d7 100644
--- a/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp
+++ b/xfa/src/fxbarcode/oned/BC_OnedCode128Reader.cpp
@@ -306,11 +306,7 @@ CFX_ByteString CBC_OnedCode128Reader::DecodeRow(int32_t rowNumber,
result += '0';
}
FX_CHAR temp[128];
-#if defined(_FX_WINAPI_PARTITION_APP_)
- sprintf_s(temp, 128, "%d", code);
-#else
sprintf(temp, "%d", code);
-#endif
result += temp;
} else {
if (code != CODE_STOP) {