[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [marble] src/plugins/runner/osm: no else statement after an if statement with return
From: Bernhard Beschow <bbeschow () cs ! tu-berlin ! de>
Date: 2016-08-20 12:20:17
Message-ID: E1bb5G5-0003nd-ST () code ! kde ! org
[Download RAW message or body]
Git commit 88ed905c59bec5c587336725489bca2a662b37ee by Bernhard Beschow.
Committed on 20/08/2016 at 12:22.
Pushed by beschow into branch 'master'.
no else statement after an if statement with return
M +10 -2 src/plugins/runner/osm/OsmRelation.cpp
http://commits.kde.org/marble/88ed905c59bec5c587336725489bca2a662b37ee
diff --git a/src/plugins/runner/osm/OsmRelation.cpp \
b/src/plugins/runner/osm/OsmRelation.cpp index b205981..89be54d 100644
--- a/src/plugins/runner/osm/OsmRelation.cpp
+++ b/src/plugins/runner/osm/OsmRelation.cpp
@@ -58,20 +58,25 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays \
&ways, const OsmNode QSet<qint64> outerWays;
QSet<qint64> outerNodes;
const QList<GeoDataLinearRing> outer = rings(outerRoles, ways, nodes, \
outerNodes, outerWays); +
if (outer.isEmpty()) {
return;
- } else if (outer.size() > 1) {
+ }
+
+ if (outer.size() > 1) {
/** @todo: Merge ways with common start/end, create multipolygon geometries \
for ones with multiple outer rings */
mDebug() << "Polygons with " << outer.size() << " ways are not yet \
supported"; return;
}
+
GeoDataFeature::GeoDataVisualCategory outerCategory = \
OsmPresetLibrary::determineVisualCategory(m_osmData); if (outerCategory == \
GeoDataFeature::None) { // Try to determine the visual category from the relation \
members
- bool categoriesAreSame = true;
auto iterator = outerWays.begin();
GeoDataFeature::GeoDataVisualCategory const firstCategory =
OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData());
+
+ bool categoriesAreSame = true;
for( ; iterator != outerWays.end(); ++iterator ) {
GeoDataFeature::GeoDataVisualCategory const category =
\
OsmPresetLibrary::determineVisualCategory(ways[*iterator].osmData()); @@ -80,10 \
+85,12 @@ void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, const \
OsmNode break;
}
}
+
if( categoriesAreSame ) {
outerCategory = firstCategory;
}
}
+
foreach(qint64 wayId, outerWays) {
Q_ASSERT(ways.contains(wayId));
GeoDataFeature::GeoDataVisualCategory const category = \
OsmPresetLibrary::determineVisualCategory(ways[wayId].osmData()); @@ -91,6 +98,7 @@ \
void OsmRelation::create(GeoDataDocument *document, OsmWays &ways, \
const OsmNode
// Schedule way for removal: It's a non-styled way only used to create \
the outer boundary in this polygon usedWays << wayId;
} // else we keep it
+
foreach(qint64 nodeId, ways[wayId].references()) {
ways[wayId].osmData().addNodeReference(nodes[nodeId].coordinates(), \
nodes[nodeId].osmData()); }
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic