Chromium Code Reviews| Index: fpdfsdk/fxedit/fxet_module.cpp |
| diff --git a/fpdfsdk/fxedit/fxet_module.cpp b/fpdfsdk/fxedit/fxet_module.cpp |
| index 889b0f81a6c5963a3d9b9f3ca4a712d3266bbc2a..330b72bc8b9f00166e93b8f1360f7ef9ebbeabf1 100644 |
| --- a/fpdfsdk/fxedit/fxet_module.cpp |
| +++ b/fpdfsdk/fxedit/fxet_module.cpp |
| @@ -4,21 +4,17 @@ |
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| +#include "core/fpdfdoc/include/cpdf_variabletext.h" |
| #include "fpdfsdk/include/fxedit/fxet_edit.h" |
| #include "fpdfsdk/include/fxedit/fxet_list.h" |
| IFX_Edit* IFX_Edit::NewEdit() { |
| - if (IPDF_VariableText* pVT = IPDF_VariableText::NewVariableText()) { |
| - return new CFX_Edit(pVT); |
| - } |
| - |
| - return NULL; |
| + return new CFX_Edit(new CPDF_VariableText()); |
| } |
| void IFX_Edit::DelEdit(IFX_Edit* pEdit) { |
| - IPDF_VariableText::DelVariableText(pEdit->GetVariableText()); |
| - |
| - delete (CFX_Edit*)pEdit; |
| + delete pEdit->GetVariableText(); |
| + delete static_cast<CFX_Edit*>(pEdit); |
|
Tom Sepez
2016/04/05 16:58:23
Do we need the cast, or does whatever pEdit points
dsinclair
2016/04/05 17:29:20
Yea, virtual destructor. We can remove IFX_Edit an
|
| } |
| IFX_List* IFX_List::NewList() { |