Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Chuck Atkins
ParaView
Commits
36052330
Commit
36052330
authored
Jan 18, 2017
by
Chuck Atkins
Browse files
PVSC: Let Switch statements in PVSC XML have a default Case
parent
c34720f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Qt/Components/pqServerLauncher.cxx
View file @
36052330
...
...
@@ -474,11 +474,16 @@ void handleSwitchCases(const pqServerConfiguration& configuration, QProcessEnvir
qWarning
()
<<
"'<Switch/> element can only contain <Case/> elements"
;
continue
;
}
const
char
*
case_value
=
caseXML
->
GetAttribute
(
"value"
);
if
(
!
case_value
||
value
!=
case_value
)
// Case: Explicitly does not match
if
(
case_value
&&
value
!=
case_value
)
{
continue
;
}
// Case: Either matches or is default, i.e. no value
handled
=
true
;
for
(
unsigned
int
i
=
0
;
i
<
caseXML
->
GetNumberOfNestedElements
();
i
++
)
{
...
...
@@ -495,6 +500,17 @@ void handleSwitchCases(const pqServerConfiguration& configuration, QProcessEnvir
<<
setXML
->
GetName
()
<<
"'"
;
}
}
// Case: Default needs early exit; warn if not the last case
if
(
!
case_value
)
{
if
(
kk
+
1
<
switchXML
->
GetNumberOfNestedElements
())
{
qWarning
()
<<
"Default 'Case' possibly overshadows explicit 'Case' "
<<
"statements for variable '"
<<
variable
<<
"'"
;
}
break
;
}
}
if
(
!
handled
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment