summaryrefslogtreecommitdiff
path: root/fxbarcode/datamatrix/BC_EncoderContext.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-05-25 18:43:44 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-26 01:56:52 +0000
commit1bbcb35e4e5593998837c832eabf16a91a695387 (patch)
tree0e60ccf75924489907237e55fcd59c90d3be50e1 /fxbarcode/datamatrix/BC_EncoderContext.cpp
parent1c26a6e477c5eaebf8aaca0c65a3a06c22e9c527 (diff)
downloadpdfium-1bbcb35e4e5593998837c832eabf16a91a695387.tar.xz
Replace SymbolShapeHint with a boolean.
Delete BC_SymbolShapeHint.h since there is nothing left in it. Change-Id: Ic991064cd396f224966e5f3e8537fc62b5a9908a Reviewed-on: https://pdfium-review.googlesource.com/5835 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fxbarcode/datamatrix/BC_EncoderContext.cpp')
-rw-r--r--fxbarcode/datamatrix/BC_EncoderContext.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/fxbarcode/datamatrix/BC_EncoderContext.cpp b/fxbarcode/datamatrix/BC_EncoderContext.cpp
index 1c39be1aec..40855fcbd8 100644
--- a/fxbarcode/datamatrix/BC_EncoderContext.cpp
+++ b/fxbarcode/datamatrix/BC_EncoderContext.cpp
@@ -26,7 +26,6 @@
#include "fxbarcode/common/BC_CommonBitMatrix.h"
#include "fxbarcode/datamatrix/BC_Encoder.h"
#include "fxbarcode/datamatrix/BC_SymbolInfo.h"
-#include "fxbarcode/datamatrix/BC_SymbolShapeHint.h"
#include "fxbarcode/utils.h"
CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString& msg,
@@ -44,16 +43,19 @@ CBC_EncoderContext::CBC_EncoderContext(const CFX_WideString& msg,
sb += ch;
}
m_msg = sb;
- m_shape = FORCE_NONE;
+ m_allowRectangular = true;
m_newEncoding = -1;
m_pos = 0;
m_symbolInfo = nullptr;
m_skipAtEnd = 0;
}
+
CBC_EncoderContext::~CBC_EncoderContext() {}
-void CBC_EncoderContext::setSymbolShape(SymbolShapeHint shape) {
- m_shape = shape;
+
+void CBC_EncoderContext::setAllowRectangular(bool allow) {
+ m_allowRectangular = allow;
}
+
void CBC_EncoderContext::setSkipAtEnd(int32_t count) {
m_skipAtEnd = count;
}
@@ -91,14 +93,16 @@ void CBC_EncoderContext::updateSymbolInfo(int32_t& e) {
}
void CBC_EncoderContext::updateSymbolInfo(int32_t len, int32_t& e) {
if (!m_symbolInfo || len > m_symbolInfo->dataCapacity()) {
- m_symbolInfo = CBC_SymbolInfo::lookup(len, m_shape, e);
+ m_symbolInfo = CBC_SymbolInfo::lookup(len, m_allowRectangular, e);
if (e != BCExceptionNO)
return;
}
}
+
void CBC_EncoderContext::resetSymbolInfo() {
- m_shape = FORCE_NONE;
+ m_allowRectangular = true;
}
+
int32_t CBC_EncoderContext::getTotalMessageCharCount() {
return m_msg.GetLength() - m_skipAtEnd;
}