summaryrefslogtreecommitdiff
path: root/xfa/fwl
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-05-20 15:38:29 -0700
committerCommit bot <commit-bot@chromium.org>2016-05-20 15:38:30 -0700
commit038aa531bcf1a76764d3cef46fd9b8e08b166dae (patch)
treed1ef7d15ff37e4c98d1d7522b225755ba99bc330 /xfa/fwl
parentdc3ccdfb49c4d533d524d2084a7ebe5117f35934 (diff)
downloadpdfium-038aa531bcf1a76764d3cef46fd9b8e08b166dae.tar.xz
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
Diffstat (limited to 'xfa/fwl')
-rw-r--r--xfa/fwl/core/fwl_widgetmgrimp.cpp14
-rw-r--r--xfa/fwl/lightwidget/cfwl_theme.cpp2
2 files changed, 6 insertions, 10 deletions
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);
diff --git a/xfa/fwl/lightwidget/cfwl_theme.cpp b/xfa/fwl/lightwidget/cfwl_theme.cpp
index a070e046c1..4824667080 100644
--- a/xfa/fwl/lightwidget/cfwl_theme.cpp
+++ b/xfa/fwl/lightwidget/cfwl_theme.cpp
@@ -56,7 +56,7 @@ uint32_t CFWL_Theme::GetThemeID(IFWL_Widget* pWidget) {
uint32_t CFWL_Theme::SetThemeID(IFWL_Widget* pWidget,
uint32_t dwThemeID,
FX_BOOL bChildren) {
- uint32_t dwID;
+ uint32_t dwID = 0;
for (const auto& pTheme : m_ThemesArray) {
dwID = pTheme->GetThemeID(pWidget);
pTheme->SetThemeID(pWidget, dwThemeID, FALSE);