summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fsdk_baseform.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-20 16:33:30 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-20 16:33:30 -0700
commitced4c2bf1d0d1bab14a6145b35b3baecb175a691 (patch)
tree864cc9992284424365607b330ac218bfb840bf73 /fpdfsdk/src/fsdk_baseform.cpp
parent7a8387e670a2f879b9b2f1fc7bb67064f73fb249 (diff)
downloadpdfium-ced4c2bf1d0d1bab14a6145b35b3baecb175a691.tar.xz
Merge to XFA: Remove Release() combo patch.
Includes: Original Review URL: https://codereview.chromium.org/1098043002 Original Review URL: https://codereview.chromium.org/1097843003 Original Review URL: https://codereview.chromium.org/1093213002 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1092033004
Diffstat (limited to 'fpdfsdk/src/fsdk_baseform.cpp')
-rw-r--r--fpdfsdk/src/fsdk_baseform.cpp22
1 files changed, 7 insertions, 15 deletions
diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp
index 86c43f1aa4..723a25ba7e 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/fpdfxfa/fpdfxfa_doc.h"
#include "../include/fpdfxfa/fpdfxfa_util.h"
@@ -2459,22 +2460,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", "");//XfA?
- 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) {
+ return (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget);
+ }
+ return (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget);
}
CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const