From 576e8151efab01166142ec697b66ce38b7bf6780 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 30 Jan 2017 14:26:24 -0800 Subject: Use std::vector and unique_ptr in xfa/fwl. Change-Id: I21aeb1df387b60330d87a6cc82c615878c1f5596 Reviewed-on: https://pdfium-review.googlesource.com/2457 Reviewed-by: dsinclair Commit-Queue: dsinclair --- xfa/fwl/cfwl_widgetmgr.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'xfa/fwl/cfwl_widgetmgr.cpp') diff --git a/xfa/fwl/cfwl_widgetmgr.cpp b/xfa/fwl/cfwl_widgetmgr.cpp index dc3b383466..ea78c1a444 100644 --- a/xfa/fwl/cfwl_widgetmgr.cpp +++ b/xfa/fwl/cfwl_widgetmgr.cpp @@ -320,17 +320,18 @@ CFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader( return nullptr; } -void CFWL_WidgetMgr::GetSameGroupRadioButton( - CFWL_Widget* pRadioButton, - CFX_ArrayTemplate& group) const { +std::vector CFWL_WidgetMgr::GetSameGroupRadioButton( + CFWL_Widget* pRadioButton) const { CFWL_Widget* pFirst = GetFirstSiblingWidget(pRadioButton); if (!pFirst) pFirst = pRadioButton; - int32_t iGroup = CountRadioButtonGroup(pFirst); - if (iGroup < 2) - return; - group.Add(GetRadioButtonGroupHeader(pRadioButton)); + if (CountRadioButtonGroup(pFirst) < 2) + return std::vector(); + + std::vector group; + group.push_back(GetRadioButtonGroupHeader(pRadioButton)); + return group; } CFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(CFWL_Widget* pParent) const { -- cgit v1.2.3