From 7aa4bc461a171cc2b5a27490a55f0baedd6623fb Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Thu, 23 Aug 2018 17:38:26 +0000 Subject: Remove m_bTruncated flag from CBC_PDF417Writer. The flag is unused. Change-Id: I15eb3e20e6a632ae2aa2afc19cb09d2402e607e0 Reviewed-on: https://pdfium-review.googlesource.com/41031 Commit-Queue: Henrique Nakashima Reviewed-by: Lei Zhang --- xfa/fwl/cfwl_barcode.cpp | 7 ------- xfa/fwl/cfwl_barcode.h | 3 --- xfa/fwl/cfx_barcode.cpp | 14 -------------- xfa/fwl/cfx_barcode.h | 1 - xfa/fxfa/cxfa_ffbarcode.cpp | 4 +--- 5 files changed, 1 insertion(+), 28 deletions(-) (limited to 'xfa') 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 truncate = barcode_->GetTruncate(); - if (truncate) - pBarCodeWidget->SetTruncated(*truncate); + // Truncated is currently not a supported flag. Optional ratio = barcode_->GetWideNarrowRatio(); if (ratio) -- cgit v1.2.3