From 038aa531bcf1a76764d3cef46fd9b8e08b166dae Mon Sep 17 00:00:00 2001 From: weili Date: Fri, 20 May 2016 15:38:29 -0700 Subject: Clean up XFA code which causes warnings This is part of efforts to bring XFA to chromium_code standard. The warnings are from unreachable code, or using potentially uninitialized variables, or using assignment within a condition. This change list only contains easy to fix cases. More cleanups will follow. BUG=pdfium:29 Review-Url: https://codereview.chromium.org/1998873002 --- xfa/fwl/core/fwl_widgetmgrimp.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'xfa/fwl/core') diff --git a/xfa/fwl/core/fwl_widgetmgrimp.cpp b/xfa/fwl/core/fwl_widgetmgrimp.cpp index ff379722e7..93f39a98e5 100644 --- a/xfa/fwl/core/fwl_widgetmgrimp.cpp +++ b/xfa/fwl/core/fwl_widgetmgrimp.cpp @@ -447,21 +447,17 @@ IFWL_Widget* CFWL_WidgetMgr::GetSiblingRadioButton(IFWL_Widget* pWidget, } IFWL_Widget* CFWL_WidgetMgr::GetRadioButtonGroupHeader( IFWL_Widget* pRadioButton) { - if (pRadioButton->GetStyles() & FWL_WGTSTYLE_Group) { - return pRadioButton; - } IFWL_Widget* pNext = pRadioButton; - while ((pNext = GetSiblingRadioButton(pNext, FALSE)) != NULL) { - if (pNext->GetStyles() & FWL_WGTSTYLE_Group) { + while (pNext) { + if (pNext->GetStyles() & FWL_WGTSTYLE_Group) return pNext; - } + pNext = GetSiblingRadioButton(pNext, FALSE); } pNext = GetWidget(pRadioButton, FWL_WGTRELATION_LastSibling); - while ((pNext = GetSiblingRadioButton(pNext, FALSE)) && pNext && + while ((pNext = GetSiblingRadioButton(pNext, FALSE)) != nullptr && pNext != pRadioButton) { - if (pNext->GetStyles() & FWL_WGTSTYLE_Group) { + if (pNext->GetStyles() & FWL_WGTSTYLE_Group) return pNext; - } } pNext = GetWidget(pRadioButton, FWL_WGTRELATION_FirstSibling); return GetSiblingRadioButton(pNext, TRUE); -- cgit v1.2.3