Chromium Code Reviews| Index: fpdfsdk/src/fsdk_baseform.cpp |
| diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp |
| index 6c8069b92ab64bf0362c2b1404c2085a68d692de..68b71c3f9d15dbc74851492ba256d6af3ff22fc0 100644 |
| --- a/fpdfsdk/src/fsdk_baseform.cpp |
| +++ b/fpdfsdk/src/fsdk_baseform.cpp |
| @@ -4,6 +4,7 @@ |
| // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| +#include "../../third_party/base/nonstd_unique_ptr.h" |
| #include "../include/fsdk_define.h" |
| #include "../include/fsdk_mgr.h" |
| #include "../include/fsdk_baseannot.h" |
| @@ -1727,22 +1728,13 @@ FX_BOOL CPDFSDK_InterForm::HighlightWidgets() |
| CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const |
| { |
| - ASSERT(pWidget != NULL); |
| - |
| - CBA_AnnotIterator* pIterator = new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", ""); |
| - ASSERT(pIterator != NULL); |
| - |
| - CPDFSDK_Widget* pRet = NULL; |
| - |
| - if (bNext) |
| - pRet = (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget); |
| - else |
| - pRet = (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget); |
| - |
| - pIterator->Release(); |
| - |
| - return pRet; |
| + nonstd::unique_ptr<CBA_AnnotIterator> pIterator( |
| + new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", "")); |
| + if (bNext) { |
|
Lei Zhang
2015/04/20 20:32:49
nit: Can we get rid of the tabs. It's hard to read
Tom Sepez
2015/04/20 20:36:54
Done.
|
| + return (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget); |
| + } |
| + return (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget); |
| } |
| CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const |