From fe91c6c8211cec39f871d9202556e1957bf81983 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 16 May 2017 15:33:20 -0700 Subject: Be skeptical of bare |new|s. In particular, prefer an explicit .release() call when handing ownership of an object to a caller across a C-API. Change-Id: Ic3784e9d0b2d378a08d388989eaea7c9166bacd1 Reviewed-on: https://pdfium-review.googlesource.com/5470 Commit-Queue: Tom Sepez Reviewed-by: Lei Zhang --- xfa/fxfa/cxfa_ffwidget.cpp | 7 ++++--- xfa/fxfa/cxfa_ffwidget.h | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'xfa') diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 69aabe38be..7bbb8c8265 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -333,10 +333,11 @@ void CXFA_FFWidget::Delete() {} void CXFA_FFWidget::DeSelect() {} -bool CXFA_FFWidget::GetSuggestWords(CFX_PointF pointf, - std::vector& sSuggest) { - return false; +void CXFA_FFWidget::GetSuggestWords(CFX_PointF pointf, + std::vector* pWords) { + pWords->clear(); } + bool CXFA_FFWidget::ReplaceSpellCheckWord(CFX_PointF pointf, const CFX_ByteStringC& bsReplace) { return false; diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h index 35a36002c7..2ca27c1303 100644 --- a/xfa/fxfa/cxfa_ffwidget.h +++ b/xfa/fxfa/cxfa_ffwidget.h @@ -136,10 +136,11 @@ class CXFA_FFWidget : public CXFA_ContentLayoutItem { virtual void SelectAll(); virtual void Delete(); virtual void DeSelect(); - virtual bool GetSuggestWords(CFX_PointF pointf, - std::vector& sSuggest); - virtual bool ReplaceSpellCheckWord(CFX_PointF pointf, - const CFX_ByteStringC& bsReplace); + + // TODO(tsepez): Implement or remove. + void GetSuggestWords(CFX_PointF pointf, std::vector* pWords); + bool ReplaceSpellCheckWord(CFX_PointF pointf, + const CFX_ByteStringC& bsReplace); CXFA_FFPageView* GetPageView() const { return m_pPageView; } void SetPageView(CXFA_FFPageView* pPageView) { m_pPageView = pPageView; } -- cgit v1.2.3