summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-10-03 18:56:01 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-10-03 18:56:01 (GMT)
commitb5672254104e974ab4fc8cb8e8bcff7116e3c709 (patch)
treec407701588480167a981a776ea6474b24912c4f8
parentc2e83a463664c370ff83b4d6632615c8b96d80c9 (diff)
simplify
-rw-r--r--src/lib/marble/StyleBuilder.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index 10a51ce..d8eabd6 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -1189,22 +1189,20 @@ void StyleBuilder::setDefaultLabelColor( const QColor& color )
GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &parameters) const
{
- if (!parameters.placemark) {
- Q_ASSERT(false && "Must not pass a null feature to StyleBuilder::createStyle");
+ const GeoDataPlacemark *const placemark = parameters.placemark;
+
+ if (!placemark) {
+ Q_ASSERT(false && "Must not pass a null placemark to StyleBuilder::createStyle");
return GeoDataStyle::Ptr();
}
- if (parameters.placemark->customStyle()) {
- return parameters.placemark->customStyle();
+ if (placemark->customStyle()) {
+ return placemark->customStyle();
}
- auto const visualCategory = parameters.placemark->visualCategory();
+ auto const visualCategory = placemark->visualCategory();
GeoDataStyle::ConstPtr style = presetStyle(visualCategory);
- if (parameters.placemark->nodeType() != GeoDataTypes::GeoDataPlacemarkType) {
- return style;
- }
- GeoDataPlacemark const * placemark = static_cast<GeoDataPlacemark const *>(parameters.placemark);
OsmPlacemarkData const & osmData = placemark->osmData();
if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataPointType) {
if (visualCategory == GeoDataPlacemark::NaturalTree) {