summaryrefslogtreecommitdiff
path: root/xfa/src/fwl/src/lightwidget/barcode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'xfa/src/fwl/src/lightwidget/barcode.cpp')
-rw-r--r--xfa/src/fwl/src/lightwidget/barcode.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/xfa/src/fwl/src/lightwidget/barcode.cpp b/xfa/src/fwl/src/lightwidget/barcode.cpp
index d0f3be46f3..15b0a40d91 100644
--- a/xfa/src/fwl/src/lightwidget/barcode.cpp
+++ b/xfa/src/fwl/src/lightwidget/barcode.cpp
@@ -14,15 +14,15 @@ FWL_ERR CFWL_Barcode::Initialize(const CFWL_WidgetProperties* pProperties) {
if (pProperties) {
*m_pProperties = *pProperties;
}
- m_pIface = new IFWL_Barcode;
- FWL_ERR ret =
- ((IFWL_Barcode*)m_pIface)
- ->Initialize(m_pProperties->MakeWidgetImpProperties(&m_barcodeData),
- nullptr);
- if (ret == FWL_ERR_Succeeded) {
- CFWL_Widget::Initialize();
+ nonstd::unique_ptr<IFWL_Barcode> pBarcode(IFWL_Barcode::Create(
+ m_pProperties->MakeWidgetImpProperties(&m_barcodeData)));
+ FWL_ERR ret = pBarcode->Initialize();
+ if (ret != FWL_ERR_Succeeded) {
+ return ret;
}
- return ret;
+ m_pIface = pBarcode.release();
+ CFWL_Widget::Initialize();
+ return FWL_ERR_Succeeded;
}
CFWL_Barcode::CFWL_Barcode() {}
CFWL_Barcode::~CFWL_Barcode() {}