Commit 1a115208 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Avoid creating multiple string copies of new styleurls

parent 690fcf38
......@@ -239,6 +239,8 @@ void FileLoaderPrivate::documentParsed( GeoDataDocument* doc, const QString& err
void FileLoaderPrivate::createFilterProperties( GeoDataContainer *container )
{
const QString styleUrl = QLatin1Char('#') + m_styleMap->id();
QVector<GeoDataFeature*>::Iterator i = container->begin();
QVector<GeoDataFeature*>::Iterator const end = container->end();
for (; i != end; ++i ) {
......@@ -264,7 +266,7 @@ void FileLoaderPrivate::createFilterProperties( GeoDataContainer *container )
placemark->geometry()->nodeType() != GeoDataTypes::GeoDataPointType
&& m_documentRole == MapDocument
&& m_style ) {
placemark->setStyleUrl(QLatin1Char('#') + m_styleMap->id());
placemark->setStyleUrl(styleUrl);
}
// Mountain (H), Volcano (V), Shipwreck (W)
......
......@@ -480,6 +480,7 @@ void MarbleModelPrivate::assignNewStyle( const QString &filePath, const GeoDataS
addHighlightStyle( doc );
const QString styleUrl = QLatin1Char('#') + styleMap.id();
QVector<GeoDataFeature*>::iterator iter = doc->begin();
QVector<GeoDataFeature*>::iterator const end = doc->end();
......@@ -490,7 +491,7 @@ void MarbleModelPrivate::assignNewStyle( const QString &filePath, const GeoDataS
if ( placemark->geometry()->nodeType() != GeoDataTypes::GeoDataTrackType &&
placemark->geometry()->nodeType() != GeoDataTypes::GeoDataPointType )
{
placemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
placemark->setStyleUrl(styleUrl);
}
}
}
......@@ -871,6 +872,7 @@ void MarbleModelPrivate::assignFillColors( const QString &filePath ) {
doc->addStyle( style );
doc->addStyleMap( styleMap );
const QString styleUrl = QLatin1Char('#') + styleMap.id();
QVector<GeoDataFeature*>::iterator iter = doc->begin();
QVector<GeoDataFeature*>::iterator const end = doc->end();
......@@ -881,7 +883,7 @@ void MarbleModelPrivate::assignFillColors( const QString &filePath ) {
if ( placemark->geometry()->nodeType() != GeoDataTypes::GeoDataTrackType &&
placemark->geometry()->nodeType() != GeoDataTypes::GeoDataPointType )
{
placemark->setStyleUrl(QLatin1Char('#') + styleMap.id());
placemark->setStyleUrl(styleUrl);
}
}
}
......
Supports Markdown
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