Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: xfa/fwl/cfwl_widgetmgr.cpp

Issue 2570273003: Remove unused Group widget state (Closed)
Patch Set: Rebase to master Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fwl/cfwl_checkbox.cpp ('k') | xfa/fwl/fwl_widgetdef.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fwl/cfwl_widgetmgr.h" 7 #include "xfa/fwl/cfwl_widgetmgr.h"
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 int32_t CFWL_WidgetMgr::CountRadioButtonGroup(CFWL_Widget* pFirst) const { 305 int32_t CFWL_WidgetMgr::CountRadioButtonGroup(CFWL_Widget* pFirst) const {
306 int32_t iRet = 0; 306 int32_t iRet = 0;
307 CFWL_Widget* pChild = pFirst; 307 CFWL_Widget* pChild = pFirst;
308 while (pChild) { 308 while (pChild) {
309 pChild = GetNextSiblingWidget(pChild); 309 pChild = GetNextSiblingWidget(pChild);
310 ++iRet; 310 ++iRet;
311 } 311 }
312 return iRet; 312 return iRet;
313 } 313 }
314 314
315 CFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader(
316 CFWL_Widget* pRadioButton) const {
317 CFWL_Widget* pNext = pRadioButton;
318 if (pNext && (pNext->GetStyles() & FWL_WGTSTYLE_Group))
319 return pNext;
320 return nullptr;
321 }
322
323 void CFWL_WidgetMgr::GetSameGroupRadioButton( 315 void CFWL_WidgetMgr::GetSameGroupRadioButton(
324 CFWL_Widget* pRadioButton, 316 CFWL_Widget* pRadioButton,
325 CFX_ArrayTemplate<CFWL_Widget*>& group) const { 317 CFX_ArrayTemplate<CFWL_Widget*>& group) const {
326 CFWL_Widget* pFirst = GetFirstSiblingWidget(pRadioButton); 318 CFWL_Widget* pFirst = GetFirstSiblingWidget(pRadioButton);
327 if (!pFirst) 319 if (!pFirst)
328 pFirst = pRadioButton; 320 pFirst = pRadioButton;
329 321
330 int32_t iGroup = CountRadioButtonGroup(pFirst); 322 int32_t iGroup = CountRadioButtonGroup(pFirst);
331 if (iGroup < 2) 323 if (iGroup < 2)
332 return; 324 return;
333 group.Add(GetRadioButtonGroupHeader(pRadioButton)); 325 group.Add(nullptr);
334 } 326 }
335 327
336 CFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(CFWL_Widget* pParent) const { 328 CFWL_Widget* CFWL_WidgetMgr::GetDefaultButton(CFWL_Widget* pParent) const {
337 if ((pParent->GetClassID() == FWL_Type::PushButton) && 329 if ((pParent->GetClassID() == FWL_Type::PushButton) &&
338 (pParent->GetStates() & (1 << (FWL_WGTSTATE_MAX + 2)))) { 330 (pParent->GetStates() & (1 << (FWL_WGTSTATE_MAX + 2)))) {
339 return pParent; 331 return pParent;
340 } 332 }
341 333
342 CFWL_Widget* child = 334 CFWL_Widget* child =
343 pParent->GetOwnerApp()->GetWidgetMgr()->GetFirstChildWidget(pParent); 335 pParent->GetOwnerApp()->GetWidgetMgr()->GetFirstChildWidget(pParent);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 pWidget(widget), 610 pWidget(widget),
619 iRedrawCounter(0) 611 iRedrawCounter(0)
620 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_) 612 #if (_FX_OS_ == _FX_WIN32_DESKTOP_) || (_FX_OS_ == _FX_WIN64_)
621 , 613 ,
622 bOutsideChanged(false) 614 bOutsideChanged(false)
623 #endif 615 #endif
624 { 616 {
625 } 617 }
626 618
627 CFWL_WidgetMgr::Item::~Item() {} 619 CFWL_WidgetMgr::Item::~Item() {}
OLDNEW
« no previous file with comments | « xfa/fwl/cfwl_checkbox.cpp ('k') | xfa/fwl/fwl_widgetdef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698