summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fxbarcode/datamatrix/BC_EdifactEncoder.cpp7
-rw-r--r--fxbarcode/datamatrix/BC_HighLevelEncoder.cpp4
-rw-r--r--fxbarcode/datamatrix/BC_HighLevelEncoder.h1
-rw-r--r--fxbarcode/datamatrix/BC_TextEncoder.cpp5
-rw-r--r--fxbarcode/datamatrix/BC_TextEncoder.h2
-rw-r--r--fxbarcode/datamatrix/BC_X12Encoder.cpp8
-rw-r--r--fxbarcode/datamatrix/BC_X12Encoder.h4
7 files changed, 16 insertions, 15 deletions
diff --git a/fxbarcode/datamatrix/BC_EdifactEncoder.cpp b/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
index 61eea93d33..954dcbcba6 100644
--- a/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
+++ b/fxbarcode/datamatrix/BC_EdifactEncoder.cpp
@@ -20,9 +20,10 @@
* limitations under the License.
*/
+#include "fxbarcode/datamatrix/BC_EdifactEncoder.h"
+
#include "fxbarcode/BC_Dimension.h"
#include "fxbarcode/common/BC_CommonBitMatrix.h"
-#include "fxbarcode/datamatrix/BC_EdifactEncoder.h"
#include "fxbarcode/datamatrix/BC_Encoder.h"
#include "fxbarcode/datamatrix/BC_EncoderContext.h"
#include "fxbarcode/datamatrix/BC_HighLevelEncoder.h"
@@ -115,15 +116,17 @@ void CBC_EdifactEncoder::handleEOD(CBC_EncoderContext& context,
}
context.signalEncoderChange(ASCII_ENCODATION);
}
+
void CBC_EdifactEncoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) {
if (c >= ' ' && c <= '?') {
sb += c;
} else if (c >= '@' && c <= '^') {
sb += (wchar_t)(c - 64);
} else {
- CBC_HighLevelEncoder::illegalCharacter(c, e);
+ e = BCExceptionIllegalArgument;
}
}
+
CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb,
int32_t startPos,
int32_t& e) {
diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
index cce9749749..f9fb080be3 100644
--- a/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
+++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.cpp
@@ -302,9 +302,7 @@ int32_t CBC_HighLevelEncoder::determineConsecutiveDigitCount(CFX_WideString msg,
}
return count;
}
-void CBC_HighLevelEncoder::illegalCharacter(wchar_t c, int32_t& e) {
- e = BCExceptionIllegalArgument;
-}
+
wchar_t CBC_HighLevelEncoder::randomize253State(wchar_t ch,
int32_t codewordPosition) {
int32_t pseudoRandom = ((149 * codewordPosition) % 253) + 1;
diff --git a/fxbarcode/datamatrix/BC_HighLevelEncoder.h b/fxbarcode/datamatrix/BC_HighLevelEncoder.h
index 83136be2f4..12b8cab35a 100644
--- a/fxbarcode/datamatrix/BC_HighLevelEncoder.h
+++ b/fxbarcode/datamatrix/BC_HighLevelEncoder.h
@@ -40,7 +40,6 @@ class CBC_HighLevelEncoder : public CBC_SymbolShapeHint {
static bool isExtendedASCII(wchar_t ch);
static int32_t determineConsecutiveDigitCount(CFX_WideString msg,
int32_t startpos);
- static void illegalCharacter(wchar_t c, int32_t& e);
public:
static wchar_t LATCH_TO_C40;
diff --git a/fxbarcode/datamatrix/BC_TextEncoder.cpp b/fxbarcode/datamatrix/BC_TextEncoder.cpp
index a521acb6c3..53f92c3d28 100644
--- a/fxbarcode/datamatrix/BC_TextEncoder.cpp
+++ b/fxbarcode/datamatrix/BC_TextEncoder.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include "fxbarcode/datamatrix/BC_TextEncoder.h"
+
#include "fxbarcode/BC_Dimension.h"
#include "fxbarcode/common/BC_CommonBitMatrix.h"
#include "fxbarcode/datamatrix/BC_C40Encoder.h"
@@ -28,7 +30,6 @@
#include "fxbarcode/datamatrix/BC_HighLevelEncoder.h"
#include "fxbarcode/datamatrix/BC_SymbolInfo.h"
#include "fxbarcode/datamatrix/BC_SymbolShapeHint.h"
-#include "fxbarcode/datamatrix/BC_TextEncoder.h"
CBC_TextEncoder::CBC_TextEncoder() {}
CBC_TextEncoder::~CBC_TextEncoder() {}
@@ -92,6 +93,6 @@ int32_t CBC_TextEncoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) {
return -1;
return len;
}
- CBC_HighLevelEncoder::illegalCharacter(c, e);
+ e = BCExceptionIllegalArgument;
return -1;
}
diff --git a/fxbarcode/datamatrix/BC_TextEncoder.h b/fxbarcode/datamatrix/BC_TextEncoder.h
index dde1a7f46e..c4ba3c3e09 100644
--- a/fxbarcode/datamatrix/BC_TextEncoder.h
+++ b/fxbarcode/datamatrix/BC_TextEncoder.h
@@ -7,7 +7,7 @@
#ifndef FXBARCODE_DATAMATRIX_BC_TEXTENCODER_H_
#define FXBARCODE_DATAMATRIX_BC_TEXTENCODER_H_
-class CBC_TextEncoder;
+#include "fxbarcode/datamatrix/BC_C40Encoder.h"
class CBC_TextEncoder : public CBC_C40Encoder {
public:
diff --git a/fxbarcode/datamatrix/BC_X12Encoder.cpp b/fxbarcode/datamatrix/BC_X12Encoder.cpp
index dd8254bff7..9103908b1a 100644
--- a/fxbarcode/datamatrix/BC_X12Encoder.cpp
+++ b/fxbarcode/datamatrix/BC_X12Encoder.cpp
@@ -20,6 +20,8 @@
* limitations under the License.
*/
+#include "fxbarcode/datamatrix/BC_X12Encoder.h"
+
#include "fxbarcode/BC_Dimension.h"
#include "fxbarcode/common/BC_CommonBitMatrix.h"
#include "fxbarcode/datamatrix/BC_C40Encoder.h"
@@ -28,7 +30,6 @@
#include "fxbarcode/datamatrix/BC_HighLevelEncoder.h"
#include "fxbarcode/datamatrix/BC_SymbolInfo.h"
#include "fxbarcode/datamatrix/BC_SymbolShapeHint.h"
-#include "fxbarcode/datamatrix/BC_X12Encoder.h"
CBC_X12Encoder::CBC_X12Encoder() {}
CBC_X12Encoder::~CBC_X12Encoder() {}
@@ -93,9 +94,8 @@ int32_t CBC_X12Encoder::encodeChar(wchar_t c, CFX_WideString& sb, int32_t& e) {
} else if (c >= 'A' && c <= 'Z') {
sb += (wchar_t)(c - 65 + 14);
} else {
- CBC_HighLevelEncoder::illegalCharacter(c, e);
- if (e != BCExceptionNO)
- return -1;
+ e = BCExceptionIllegalArgument;
+ return -1;
}
return 1;
}
diff --git a/fxbarcode/datamatrix/BC_X12Encoder.h b/fxbarcode/datamatrix/BC_X12Encoder.h
index a90dd8c7ba..146f739f84 100644
--- a/fxbarcode/datamatrix/BC_X12Encoder.h
+++ b/fxbarcode/datamatrix/BC_X12Encoder.h
@@ -7,8 +7,8 @@
#ifndef FXBARCODE_DATAMATRIX_BC_X12ENCODER_H_
#define FXBARCODE_DATAMATRIX_BC_X12ENCODER_H_
-class CBC_C40Encoder;
-class CBC_X12Encoder;
+#include "fxbarcode/datamatrix/BC_C40Encoder.h"
+
class CBC_X12Encoder : public CBC_C40Encoder {
public:
CBC_X12Encoder();