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 <hnakashima@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/fxbarcode/cbc_pdf417i.cpp b/fxbarcode/cbc_pdf417i.cpp
index 0bb632e..b011979 100644
--- a/fxbarcode/cbc_pdf417i.cpp
+++ b/fxbarcode/cbc_pdf417i.cpp
@@ -36,10 +36,6 @@
   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 5bd7a26..3cb73e3 100644
--- a/fxbarcode/cbc_pdf417i.h
+++ b/fxbarcode/cbc_pdf417i.h
@@ -26,7 +26,6 @@
   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 5cf9037..129d59c 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 @@
   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 1bb3a27..05e85c7 100644
--- a/fxbarcode/pdf417/BC_PDF417Writer.h
+++ b/fxbarcode/pdf417/BC_PDF417Writer.h
@@ -25,13 +25,10 @@
   // 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 649dea0..edd3512 100644
--- a/xfa/fwl/cfwl_barcode.cpp
+++ b/xfa/fwl/cfwl_barcode.cpp
@@ -150,11 +150,6 @@
   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 @@
     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 58484df..a4991d4 100644
--- a/xfa/fwl/cfwl_barcode.h
+++ b/xfa/fwl/cfwl_barcode.h
@@ -34,7 +34,6 @@
   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 @@
   void SetStartChar(char startChar);
   void SetEndChar(char endChar);
   void SetErrorCorrectionLevel(int32_t ecLevel);
-  void SetTruncated(bool truncated);
 
  private:
   void GenerateBarcodeImageCache();
@@ -88,7 +86,6 @@
   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 2d12536..583fa9c 100644
--- a/xfa/fwl/cfx_barcode.cpp
+++ b/xfa/fwl/cfx_barcode.cpp
@@ -282,20 +282,6 @@
   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 a5f0513..488af04 100644
--- a/xfa/fwl/cfx_barcode.h
+++ b/xfa/fwl/cfx_barcode.h
@@ -52,7 +52,6 @@
   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 e35f6c8..e89fc9f 100644
--- a/xfa/fxfa/cxfa_ffbarcode.cpp
+++ b/xfa/fxfa/cxfa_ffbarcode.cpp
@@ -206,9 +206,7 @@
   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)