From 1bbcb35e4e5593998837c832eabf16a91a695387 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 25 May 2017 18:43:44 -0700 Subject: 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 Reviewed-by: Tom Sepez --- fxbarcode/datamatrix/BC_EncoderContext.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'fxbarcode/datamatrix/BC_EncoderContext.cpp') 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; } -- cgit v1.2.3