| Index: xfa/src/fwl/src/lightwidget/caret.cpp
|
| diff --git a/xfa/src/fwl/src/lightwidget/caret.cpp b/xfa/src/fwl/src/lightwidget/caret.cpp
|
| index cb318d9a58f22b523c8989f8c5365aeb3708c57f..96be7dabbf4a52544348ec4aab2695c3ea6491c4 100644
|
| --- a/xfa/src/fwl/src/lightwidget/caret.cpp
|
| +++ b/xfa/src/fwl/src/lightwidget/caret.cpp
|
| @@ -14,15 +14,15 @@ FWL_ERR CFWL_Caret::Initialize(const CFWL_WidgetProperties* pProperties) {
|
| if (pProperties) {
|
| *m_pProperties = *pProperties;
|
| }
|
| - m_pIface = new IFWL_Caret;
|
| - FWL_ERR ret =
|
| - ((IFWL_Caret*)m_pIface)
|
| - ->Initialize(m_pProperties->MakeWidgetImpProperties(nullptr),
|
| - nullptr);
|
| - if (ret == FWL_ERR_Succeeded) {
|
| - CFWL_Widget::Initialize();
|
| + nonstd::unique_ptr<IFWL_Caret> pCaret(IFWL_Caret::Create(
|
| + m_pProperties->MakeWidgetImpProperties(nullptr), nullptr));
|
| + FWL_ERR ret = pCaret->Initialize();
|
| + if (ret != FWL_ERR_Succeeded) {
|
| + return ret;
|
| }
|
| - return ret;
|
| + m_pIface = pCaret.release();
|
| + CFWL_Widget::Initialize();
|
| + return FWL_ERR_Succeeded;
|
| }
|
| FWL_ERR CFWL_Caret::ShowCaret(FX_BOOL bFlag) {
|
| return ((IFWL_Caret*)m_pIface)->ShowCaret(bFlag);
|
|
|