diff options
author | Ryan Harrison <rharrison@chromium.org> | 2018-01-26 17:11:51 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-01-26 17:11:51 +0000 |
commit | 4b9d69806c30775f55563e72b0842daa06483f99 (patch) | |
tree | de54ec0133b6ad5ee625060adbfb02c45a0b9c83 /xfa/fwl/cfwl_barcode.cpp | |
parent | 49363202ce06ca9ff418b4df384cffadf924303c (diff) | |
download | pdfium-4b9d69806c30775f55563e72b0842daa06483f99.tar.xz |
Clean up construction of CFX_Barcode
Because certain enum values can cause the initialization of the class
to fail there is a seperate init method from the constructor. This CL
is converting the code to use a standard factory pattern for this,
instead of the existing implementation.
Change-Id: Ia2293ce94ad0db5862db9796aeb8a224fd2b45f9
Reviewed-on: https://pdfium-review.googlesource.com/24230
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'xfa/fwl/cfwl_barcode.cpp')
-rw-r--r-- | xfa/fwl/cfwl_barcode.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/xfa/fwl/cfwl_barcode.cpp b/xfa/fwl/cfwl_barcode.cpp index f5d6ea98b2..74ac7dd9c2 100644 --- a/xfa/fwl/cfwl_barcode.cpp +++ b/xfa/fwl/cfwl_barcode.cpp @@ -213,7 +213,5 @@ void CFWL_Barcode::CreateBarcodeEngine() { if (m_pBarcodeEngine || m_type == BC_UNKNOWN) return; - auto pBarcode = pdfium::MakeUnique<CFX_Barcode>(); - if (pBarcode->Create(m_type)) - m_pBarcodeEngine = std::move(pBarcode); + m_pBarcodeEngine = CFX_Barcode::Create(m_type); } |