From 4b9d69806c30775f55563e72b0842daa06483f99 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Fri, 26 Jan 2018 17:11:51 +0000 Subject: 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 Commit-Queue: Ryan Harrison --- xfa/fwl/cfx_barcode_unittest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xfa/fwl/cfx_barcode_unittest.cpp') diff --git a/xfa/fwl/cfx_barcode_unittest.cpp b/xfa/fwl/cfx_barcode_unittest.cpp index fe8aee4709..585d92f2db 100644 --- a/xfa/fwl/cfx_barcode_unittest.cpp +++ b/xfa/fwl/cfx_barcode_unittest.cpp @@ -20,7 +20,6 @@ class BarcodeTest : public testing::Test { public: void SetUp() override { BC_Library_Init(); - barcode_ = pdfium::MakeUnique(); auto device = pdfium::MakeUnique(); auto bitmap = pdfium::MakeRetain(); @@ -41,7 +40,8 @@ class BarcodeTest : public testing::Test { CFX_Barcode* barcode() const { return barcode_.get(); } bool Create(BC_TYPE type) { - if (!barcode_->Create(type)) + barcode_ = CFX_Barcode::Create(type); + if (!barcode_) return false; barcode_->SetModuleHeight(300); -- cgit v1.2.3