Commit e41a094f authored by Bernhard Beschow's avatar Bernhard Beschow

use for loop

parent 1d0be408
...@@ -335,9 +335,8 @@ void GeoDataFeature::setStyleUrl( const QString &value ) ...@@ -335,9 +335,8 @@ void GeoDataFeature::setStyleUrl( const QString &value )
QString styleUrl = value; QString styleUrl = value;
styleUrl.remove(QLatin1Char('#')); styleUrl.remove(QLatin1Char('#'));
GeoDataObject *object = parent();
bool found = false; for (auto object = parent(); object != nullptr; object = object->parent()) {
while ( object && !found ) {
if (GeoDataDocument *doc = geodata_cast<GeoDataDocument>(object)) { if (GeoDataDocument *doc = geodata_cast<GeoDataDocument>(object)) {
GeoDataStyleMap &styleMap = doc->styleMap( styleUrl ); GeoDataStyleMap &styleMap = doc->styleMap( styleUrl );
const QString normalStyleUrl = styleMap.value(QStringLiteral("normal")); const QString normalStyleUrl = styleMap.value(QStringLiteral("normal"));
...@@ -348,9 +347,8 @@ void GeoDataFeature::setStyleUrl( const QString &value ) ...@@ -348,9 +347,8 @@ void GeoDataFeature::setStyleUrl( const QString &value )
// Not calling setStyle here because we don't want // Not calling setStyle here because we don't want
// re-parenting of the style // re-parenting of the style
d->m_style = doc->style( styleUrl ); d->m_style = doc->style( styleUrl );
found = true; break;
} }
object = object->parent();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment