diff options
-rw-r--r-- | fxbarcode/cbc_pdf417i.cpp | 4 | ||||
-rw-r--r-- | fxbarcode/cbc_pdf417i.h | 1 | ||||
-rw-r--r-- | fxbarcode/pdf417/BC_PDF417Writer.cpp | 9 | ||||
-rw-r--r-- | fxbarcode/pdf417/BC_PDF417Writer.h | 3 | ||||
-rw-r--r-- | xfa/fwl/cfwl_barcode.cpp | 7 | ||||
-rw-r--r-- | xfa/fwl/cfwl_barcode.h | 3 | ||||
-rw-r--r-- | xfa/fwl/cfx_barcode.cpp | 14 | ||||
-rw-r--r-- | xfa/fwl/cfx_barcode.h | 1 | ||||
-rw-r--r-- | xfa/fxfa/cxfa_ffbarcode.cpp | 4 |
9 files changed, 4 insertions, 42 deletions
diff --git a/fxbarcode/cbc_pdf417i.cpp b/fxbarcode/cbc_pdf417i.cpp index 0bb632ee2f..b01197954c 100644 --- a/fxbarcode/cbc_pdf417i.cpp +++ b/fxbarcode/cbc_pdf417i.cpp @@ -36,10 +36,6 @@ bool CBC_PDF417I::SetErrorCorrectionLevel(int32_t level) { return true; } -void CBC_PDF417I::SetTruncated(bool truncated) { - GetPDF417Writer()->SetTruncated(truncated); -} - bool CBC_PDF417I::Encode(const WideStringView& contents) { int32_t outWidth; int32_t outHeight; diff --git a/fxbarcode/cbc_pdf417i.h b/fxbarcode/cbc_pdf417i.h index 5bd7a26eeb..3cb73e3f0f 100644 --- a/fxbarcode/cbc_pdf417i.h +++ b/fxbarcode/cbc_pdf417i.h @@ -26,7 +26,6 @@ class CBC_PDF417I : public CBC_CodeBase { BC_TYPE GetType() override; bool SetErrorCorrectionLevel(int32_t level); - void SetTruncated(bool truncated); private: CBC_PDF417Writer* GetPDF417Writer(); diff --git a/fxbarcode/pdf417/BC_PDF417Writer.cpp b/fxbarcode/pdf417/BC_PDF417Writer.cpp index 5cf9037601..129d59c393 100644 --- a/fxbarcode/pdf417/BC_PDF417Writer.cpp +++ b/fxbarcode/pdf417/BC_PDF417Writer.cpp @@ -35,9 +35,9 @@ CBC_PDF417Writer::CBC_PDF417Writer() { m_bFixedSize = false; } -CBC_PDF417Writer::~CBC_PDF417Writer() { - m_bTruncated = true; -} + +CBC_PDF417Writer::~CBC_PDF417Writer() {} + bool CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) { if (level < 0 || level > 8) { return false; @@ -45,9 +45,6 @@ bool CBC_PDF417Writer::SetErrorCorrectionLevel(int32_t level) { m_iCorrectLevel = level; return true; } -void CBC_PDF417Writer::SetTruncated(bool truncated) { - m_bTruncated = truncated; -} uint8_t* CBC_PDF417Writer::Encode(const WideString& contents, int32_t* outWidth, diff --git a/fxbarcode/pdf417/BC_PDF417Writer.h b/fxbarcode/pdf417/BC_PDF417Writer.h index 1bb3a27d06..05e85c77a9 100644 --- a/fxbarcode/pdf417/BC_PDF417Writer.h +++ b/fxbarcode/pdf417/BC_PDF417Writer.h @@ -25,13 +25,10 @@ class CBC_PDF417Writer : public CBC_TwoDimWriter { // CBC_TwoDimWriter bool SetErrorCorrectionLevel(int32_t level) override; - void SetTruncated(bool truncated); - private: void rotateArray(std::vector<uint8_t>& bitarray, int32_t width, int32_t height); - bool m_bTruncated; }; #endif // FXBARCODE_PDF417_BC_PDF417WRITER_H_ diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index 649dea0c8e..edd3512773 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -150,11 +150,6 @@ void CFWL_Barcode::SetErrorCorrectionLevel(int32_t ecLevel) { m_nECLevel = ecLevel; } -void CFWL_Barcode::SetTruncated(bool truncated) { - m_dwAttributeMask |= FWL_BCDATTRIBUTE_TRUNCATED; - m_bTruncated = truncated; -} - void CFWL_Barcode::GenerateBarcodeImageCache() { if ((m_dwStatus & XFA_BCS_NeedUpdate) == 0) return; @@ -202,8 +197,6 @@ void CFWL_Barcode::GenerateBarcodeImageCache() { m_pBarcodeEngine->SetEndChar(m_cEndChar); if (m_dwAttributeMask & FWL_BCDATTRIBUTE_ECLEVEL) m_pBarcodeEngine->SetErrorCorrectionLevel(m_nECLevel); - if (m_dwAttributeMask & FWL_BCDATTRIBUTE_TRUNCATED) - m_pBarcodeEngine->SetTruncated(m_bTruncated); m_dwStatus = m_pBarcodeEngine->Encode(GetText().AsStringView()) ? XFA_BCS_EncodeSuccess diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h index 58484dfba1..a4991d4cf7 100644 --- a/xfa/fwl/cfwl_barcode.h +++ b/xfa/fwl/cfwl_barcode.h @@ -34,7 +34,6 @@ enum FWL_BCDAttribute { FWL_BCDATTRIBUTE_STARTCHAR = 1 << 8, FWL_BCDATTRIBUTE_ENDCHAR = 1 << 9, FWL_BCDATTRIBUTE_ECLEVEL = 1 << 10, - FWL_BCDATTRIBUTE_TRUNCATED = 1 << 11, }; class CFWL_Barcode : public CFWL_Edit { @@ -68,7 +67,6 @@ class CFWL_Barcode : public CFWL_Edit { void SetStartChar(char startChar); void SetEndChar(char endChar); void SetErrorCorrectionLevel(int32_t ecLevel); - void SetTruncated(bool truncated); private: void GenerateBarcodeImageCache(); @@ -88,7 +86,6 @@ class CFWL_Barcode : public CFWL_Edit { char m_cStartChar; char m_cEndChar; int32_t m_nECLevel; - bool m_bTruncated; uint32_t m_dwAttributeMask; }; diff --git a/xfa/fwl/cfx_barcode.cpp b/xfa/fwl/cfx_barcode.cpp index 2d1253630e..583fa9ce56 100644 --- a/xfa/fwl/cfx_barcode.cpp +++ b/xfa/fwl/cfx_barcode.cpp @@ -282,20 +282,6 @@ bool CFX_Barcode::SetErrorCorrectionLevel(int32_t level) { return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(level) : false; } -bool CFX_Barcode::SetTruncated(bool truncated) { - typedef void (CBC_CodeBase::*memptrtype)(bool); - memptrtype memptr = nullptr; - switch (GetType()) { - case BC_PDF417: - memptr = (memptrtype)&CBC_PDF417I::SetTruncated; - break; - default: - break; - } - return m_pBCEngine && memptr ? ((m_pBCEngine.get()->*memptr)(truncated), true) - : false; -} - bool CFX_Barcode::Encode(const WideStringView& contents) { return m_pBCEngine && m_pBCEngine->Encode(contents); } diff --git a/xfa/fwl/cfx_barcode.h b/xfa/fwl/cfx_barcode.h index a5f0513241..488af04bc8 100644 --- a/xfa/fwl/cfx_barcode.h +++ b/xfa/fwl/cfx_barcode.h @@ -52,7 +52,6 @@ class CFX_Barcode { bool SetStartChar(char start); bool SetEndChar(char end); bool SetErrorCorrectionLevel(int32_t level); - bool SetTruncated(bool truncated); private: CFX_Barcode(); diff --git a/xfa/fxfa/cxfa_ffbarcode.cpp b/xfa/fxfa/cxfa_ffbarcode.cpp index e35f6c8696..e89fc9f01d 100644 --- a/xfa/fxfa/cxfa_ffbarcode.cpp +++ b/xfa/fxfa/cxfa_ffbarcode.cpp @@ -206,9 +206,7 @@ void CXFA_FFBarcode::UpdateWidgetProperty() { if (textLoc) pBarCodeWidget->SetTextLocation(*textLoc); - Optional<bool> truncate = barcode_->GetTruncate(); - if (truncate) - pBarCodeWidget->SetTruncated(*truncate); + // Truncated is currently not a supported flag. Optional<int8_t> ratio = barcode_->GetWideNarrowRatio(); if (ratio) |