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
path: root/map
diff options
context:
space:
mode:
authorArsentiy Milchakov <milcars@mapswithme.com>2016-10-21 10:53:39 +0300
committerArsentiy Milchakov <milcars@mapswithme.com>2016-10-21 20:34:02 +0300
commit906a24775fbebfd54272c437c5c6c6248101eddc (patch)
tree1c7830a8b088651a75c4883a3983b9437ea48861 /map
parent0d5a084579ab2e1d9ad4340799148b6dc2f083bc (diff)
return empty string in case when empty rating
Diffstat (limited to 'map')
-rw-r--r--map/place_page_info.cpp11
-rw-r--r--map/place_page_info.hpp1
2 files changed, 6 insertions, 6 deletions
diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp
index 2d5e30b1bf..f1d2c4460b 100644
--- a/map/place_page_info.cpp
+++ b/map/place_page_info.cpp
@@ -10,7 +10,6 @@ namespace place_page
char const * const Info::kSubtitleSeparator = " • ";
char const * const Info::kStarSymbol = "★";
char const * const Info::kMountainSymbol = "▲";
-char const * const Info::kEmptyRatingSymbol = "-";
char const * const Info::kPricingSymbol = "$";
bool Info::IsFeature() const { return m_featureID.IsValid(); }
@@ -123,9 +122,11 @@ string Info::GetRatingFormatted() const
if (!IsSponsored())
return string();
- auto const r = GetMetadata().Get(feature::Metadata::FMD_RATING);
- char const * rating = r.empty() ? kEmptyRatingSymbol : r.c_str();
- int const size = snprintf(nullptr, 0, m_localizedRatingString.c_str(), rating);
+ auto const rating = GetMetadata().Get(feature::Metadata::FMD_RATING);
+ if (rating.empty())
+ return rating;
+
+ int const size = snprintf(nullptr, 0, m_localizedRatingString.c_str(), rating.c_str());
if (size < 0)
{
LOG(LERROR, ("Incorrect size for string:", m_localizedRatingString, ", rating:", rating));
@@ -133,7 +134,7 @@ string Info::GetRatingFormatted() const
}
vector<char> buf(size + 1);
- snprintf(buf.data(), buf.size(), m_localizedRatingString.c_str(), rating);
+ snprintf(buf.data(), buf.size(), m_localizedRatingString.c_str(), rating.c_str());
return string(buf.begin(), buf.end());
}
diff --git a/map/place_page_info.hpp b/map/place_page_info.hpp
index 29f9bc42be..db316b300b 100644
--- a/map/place_page_info.hpp
+++ b/map/place_page_info.hpp
@@ -30,7 +30,6 @@ public:
static char const * const kSubtitleSeparator;
static char const * const kStarSymbol;
static char const * const kMountainSymbol;
- static char const * const kEmptyRatingSymbol;
static char const * const kPricingSymbol;
bool IsFeature() const;