summaryrefslogtreecommitdiff
path: root/fpdfsdk/src
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-20 13:38:38 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-20 13:38:38 -0700
commit19ae17578f99621100a26dac3e2c7c3dbf7c7cd1 (patch)
tree0ac0a753395a88ae5f733a8fb465e8b50bfdc26c /fpdfsdk/src
parentbc580c69403169afa656aabb06a56b26d3b729cf (diff)
downloadpdfium-19ae17578f99621100a26dac3e2c7c3dbf7c7cd1.tar.xz
Remove release method from CBA_AnnotItetator.chromium/2377
Also remove virtual methods, since this is neither subclassed nor a subclass. BUG=https://code.google.com/p/pdfium/issues/detail?id=140 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1097843003
Diffstat (limited to 'fpdfsdk/src')
-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 6c8069b92a..0c0492d723 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) {
+ return (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget);
+ }
+ return (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget);
}
CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const