Skip to content

Commit

Permalink
Some minor cleaning up (#1473).
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Nov 29, 2017
1 parent 8ad7816 commit 835a1a6
Showing 1 changed file with 29 additions and 11 deletions.
40 changes: 29 additions & 11 deletions src/plugins/support/SEDMLSupport/src/sedmlfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,9 +843,6 @@ bool SedmlFile::isSupported()
tr("the '%1' property value must be an integer greater than zero").arg(plot2dPropertyNodeName));

return false;
} else if ( !plot2dPropertyNodeName.compare(ForegroundColor)
&& !validColorPropertyValue(plot2dPropertyNode, plot2dPropertyNodeValue, ForegroundColor)) {
return false;
} else if ( !plot2dPropertyNodeName.compare(Height)
&& !IntegerGt0RegEx.match(plot2dPropertyNodeValue).hasMatch()) {
mIssues << SedmlFileIssue(SedmlFileIssue::Error,
Expand All @@ -854,15 +851,9 @@ bool SedmlFile::isSupported()
tr("the '%1' property value must be an integer greater than zero").arg(plot2dPropertyNodeName));

return false;
} else if ( !plot2dPropertyNodeName.compare(Legend)
&& plot2dPropertyNodeValue.compare(TrueValue)
&& plot2dPropertyNodeValue.compare(FalseValue)) {
mIssues << SedmlFileIssue(SedmlFileIssue::Error,
plot2dPropertyNode.getLine(),
plot2dPropertyNode.getColumn(),
tr("the '%1' property must have a value of 'true' or 'false'").arg(Legend));

return false;
// Grid lines

} else if ( !QString::fromStdString(plot2dPropertyNode.getURI()).compare(OpencorNamespace)
&& !QString::fromStdString(plot2dPropertyNode.getName()).compare(GridLines)) {
for (uint k = 0, kMax = plot2dPropertyNode.getNumChildren(); k < kMax; ++k) {
Expand All @@ -886,6 +877,21 @@ bool SedmlFile::isSupported()
return false;
}
}

// Legend

} else if ( !plot2dPropertyNodeName.compare(Legend)
&& plot2dPropertyNodeValue.compare(TrueValue)
&& plot2dPropertyNodeValue.compare(FalseValue)) {
mIssues << SedmlFileIssue(SedmlFileIssue::Error,
plot2dPropertyNode.getLine(),
plot2dPropertyNode.getColumn(),
tr("the '%1' property must have a value of 'true' or 'false'").arg(Legend));

return false;

// Point coordinates

} else if ( !QString::fromStdString(plot2dPropertyNode.getURI()).compare(OpencorNamespace)
&& !QString::fromStdString(plot2dPropertyNode.getName()).compare(PointCoordinates)) {
for (uint k = 0, kMax = plot2dPropertyNode.getNumChildren(); k < kMax; ++k) {
Expand All @@ -912,6 +918,9 @@ bool SedmlFile::isSupported()
return false;
}
}

// Surrounding area

} else if ( !QString::fromStdString(plot2dPropertyNode.getURI()).compare(OpencorNamespace)
&& !QString::fromStdString(plot2dPropertyNode.getName()).compare(SurroundingArea)) {
for (uint k = 0, kMax = plot2dPropertyNode.getNumChildren(); k < kMax; ++k) {
Expand All @@ -927,6 +936,9 @@ bool SedmlFile::isSupported()
return false;
}
}

// X axis

} else if ( !QString::fromStdString(plot2dPropertyNode.getURI()).compare(OpencorNamespace)
&& !QString::fromStdString(plot2dPropertyNode.getName()).compare(XAxis)) {
for (uint k = 0, kMax = plot2dPropertyNode.getNumChildren(); k < kMax; ++k) {
Expand All @@ -949,6 +961,9 @@ bool SedmlFile::isSupported()
return false;
}
}

// Y axis

} else if ( !QString::fromStdString(plot2dPropertyNode.getURI()).compare(OpencorNamespace)
&& !QString::fromStdString(plot2dPropertyNode.getName()).compare(YAxis)) {
for (uint k = 0, kMax = plot2dPropertyNode.getNumChildren(); k < kMax; ++k) {
Expand All @@ -971,6 +986,9 @@ bool SedmlFile::isSupported()
return false;
}
}

// Zoom region

} else if ( !QString::fromStdString(plot2dPropertyNode.getURI()).compare(OpencorNamespace)
&& !QString::fromStdString(plot2dPropertyNode.getName()).compare(ZoomRegion)) {
for (uint k = 0, kMax = plot2dPropertyNode.getNumChildren(); k < kMax; ++k) {
Expand Down

0 comments on commit 835a1a6

Please sign in to comment.