Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zverev <zverik@textual.ru>2017-07-11 18:22:38 +0300
committerRoman Kuznetsov <r.kuznetsow@gmail.com>2017-07-27 12:24:46 +0300
commit6c595e4682a2ae8f2e9c4910cc1e2778ac0f3810 (patch)
tree81cc909b097343f3eb68b8ed561f8f7b647fdeeb /indexer/road_shields_parser.cpp
parent7d24e99922df4d32785ffdf67b0b35bd192551ed (diff)
[shields] Remove duplicate shields of default style
Diffstat (limited to 'indexer/road_shields_parser.cpp')
-rw-r--r--indexer/road_shields_parser.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/indexer/road_shields_parser.cpp b/indexer/road_shields_parser.cpp
index 9bd0571db9..718ba17f99 100644
--- a/indexer/road_shields_parser.cpp
+++ b/indexer/road_shields_parser.cpp
@@ -108,6 +108,7 @@ public:
std::set<RoadShield> GetRoadShields() const
{
std::set<RoadShield> result;
+ std::set<RoadShield> defaultShields;
std::vector<std::string> shieldsRawTests = strings::Tokenize(m_baseRoadNumber, ";");
for (std::string const & rawText : shieldsRawTests)
{
@@ -123,8 +124,17 @@ public:
shield.m_type = FindNetworkShield(rawText.substr(0, slashPos));
}
if (!shield.m_name.empty() && shield.m_type != RoadShieldType::Hidden)
+ {
+ if (shield.m_type != RoadShieldType::Default)
+ {
+ // Schedule deletion of a shield with the same text and default style, if present.
+ defaultShields.insert({RoadShieldType::Default, shield.m_name, shield.m_additionalText});
+ }
result.insert(std::move(shield));
+ }
}
+ for (RoadShield const & shield : defaultShields)
+ result.erase(shield);
return result;
}