From 03d58937248fa244cbf02a3d38d430a513500311 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 3 Apr 2017 16:40:51 -0700 Subject: Clean up QRCoderEncoder and friends. Remove a bunch of unused code, including gotos. Fix some potential memory leaks. Change-Id: Ia2775e2ab176f4741b765e259a24a293a5717394 Reviewed-on: https://pdfium-review.googlesource.com/3560 Commit-Queue: Lei Zhang Reviewed-by: Tom Sepez --- xfa/fwl/cfwl_barcode.cpp | 2 -- xfa/fwl/cfwl_barcode.h | 5 ++--- xfa/fwl/cfx_barcode.cpp | 13 ------------- xfa/fwl/cfx_barcode.h | 1 - 4 files changed, 2 insertions(+), 19 deletions(-) (limited to 'xfa') diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index bed8921e0e..87ecee13b5 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -201,8 +201,6 @@ void CFWL_Barcode::GenerateBarcodeImageCache() { m_pBarcodeEngine->SetStartChar(m_cStartChar); if (m_dwAttributeMask & FWL_BCDATTRIBUTE_ENDCHAR) m_pBarcodeEngine->SetEndChar(m_cEndChar); - if (m_dwAttributeMask & FWL_BCDATTRIBUTE_VERSION) - m_pBarcodeEngine->SetVersion(0); if (m_dwAttributeMask & FWL_BCDATTRIBUTE_ECLEVEL) m_pBarcodeEngine->SetErrorCorrectionLevel(m_nECLevel); if (m_dwAttributeMask & FWL_BCDATTRIBUTE_TRUNCATED) diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h index 463c0a2e18..ce62d73dde 100644 --- a/xfa/fwl/cfwl_barcode.h +++ b/xfa/fwl/cfwl_barcode.h @@ -33,9 +33,8 @@ enum FWL_BCDAttribute { FWL_BCDATTRIBUTE_WIDENARROWRATIO = 1 << 7, FWL_BCDATTRIBUTE_STARTCHAR = 1 << 8, FWL_BCDATTRIBUTE_ENDCHAR = 1 << 9, - FWL_BCDATTRIBUTE_VERSION = 1 << 10, - FWL_BCDATTRIBUTE_ECLEVEL = 1 << 11, - FWL_BCDATTRIBUTE_TRUNCATED = 1 << 12 + FWL_BCDATTRIBUTE_ECLEVEL = 1 << 10, + FWL_BCDATTRIBUTE_TRUNCATED = 1 << 11, }; class CFWL_Barcode : public CFWL_Edit { diff --git a/xfa/fwl/cfx_barcode.cpp b/xfa/fwl/cfx_barcode.cpp index 1c16143de5..9d01ae26ef 100644 --- a/xfa/fwl/cfx_barcode.cpp +++ b/xfa/fwl/cfx_barcode.cpp @@ -261,19 +261,6 @@ bool CFX_Barcode::SetEndChar(char end) { return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(end) : false; } -bool CFX_Barcode::SetVersion(int32_t version) { - typedef bool (CBC_CodeBase::*memptrtype)(int32_t); - memptrtype memptr = nullptr; - switch (GetType()) { - case BC_QR_CODE: - memptr = (memptrtype)&CBC_QRCode::SetVersion; - break; - default: - break; - } - return m_pBCEngine && memptr ? (m_pBCEngine.get()->*memptr)(version) : false; -} - bool CFX_Barcode::SetErrorCorrectionLevel(int32_t level) { typedef bool (CBC_CodeBase::*memptrtype)(int32_t); memptrtype memptr = nullptr; diff --git a/xfa/fwl/cfx_barcode.h b/xfa/fwl/cfx_barcode.h index f2445c2f08..20155ca0a2 100644 --- a/xfa/fwl/cfx_barcode.h +++ b/xfa/fwl/cfx_barcode.h @@ -54,7 +54,6 @@ class CFX_Barcode { bool SetWideNarrowRatio(int32_t ratio); bool SetStartChar(char start); bool SetEndChar(char end); - bool SetVersion(int32_t version); bool SetErrorCorrectionLevel(int32_t level); bool SetTruncated(bool truncated); -- cgit v1.2.3