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/fxfa/app/xfa_ffnotify.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xfa/fxfa/app/xfa_ffnotify.cpp') diff --git a/xfa/fxfa/app/xfa_ffnotify.cpp b/xfa/fxfa/app/xfa_ffnotify.cpp index 4d7d4799f2..e8fb4dd1dc 100644 --- a/xfa/fxfa/app/xfa_ffnotify.cpp +++ b/xfa/fxfa/app/xfa_ffnotify.cpp @@ -56,7 +56,7 @@ void CXFA_FFNotify::OnWidgetListItemAdded(CXFA_WidgetData* pSender, return; CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { + while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { if (pWidget->IsLoaded()) { if (pWidgetAcc->IsListBox()) { static_cast(pWidget)->InsertItem(pLabel, iIndex); @@ -74,7 +74,7 @@ void CXFA_FFNotify::OnWidgetListItemRemoved(CXFA_WidgetData* pSender, return; CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { + while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { if (pWidget->IsLoaded()) { if (pWidgetAcc->IsListBox()) { static_cast(pWidget)->DeleteItem(iIndex); @@ -360,7 +360,7 @@ void CXFA_FFNotify::OnValueChanging(CXFA_Node* pSender, XFA_ATTRIBUTE eAttr) { return; CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { + while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { if (pWidget->IsLoaded()) pWidget->AddInvalidateRect(); } @@ -422,7 +422,7 @@ void CXFA_FFNotify::OnValueChanged(CXFA_Node* pSender, } } CXFA_FFWidget* pWidget = nullptr; - while ((pWidget = pWidgetAcc->GetNextWidget(pWidget))) { + while ((pWidget = pWidgetAcc->GetNextWidget(pWidget)) != nullptr) { if (!pWidget->IsLoaded()) continue; -- cgit v1.2.3