forked from organicmaps/organicmaps
Fixed bug with very long house number (Try Colombia for example).
This commit is contained in:
parent
3c802db64e
commit
1f008f1b0e
2 changed files with 11 additions and 4 deletions
|
@ -42,9 +42,9 @@ public:
|
|||
|
||||
template <class TSink> void Write(TSink & sink) const
|
||||
{
|
||||
int n;
|
||||
if (strings::to_int(m_s, n) && n >= 0)
|
||||
WriteVarUint(sink, static_cast<uint32_t>((n << 1) | numeric_bit));
|
||||
uint64_t n;
|
||||
if (strings::to_uint64(m_s, n) && ((n << 1) >> 1) == n)
|
||||
WriteVarUint(sink, ((n << 1) | numeric_bit));
|
||||
else
|
||||
{
|
||||
size_t const sz = m_s.size();
|
||||
|
|
|
@ -71,8 +71,15 @@ void FeatureParamsBase::AddHouseName(string const & s)
|
|||
house.Set(house.IsEmpty() ? s : house.Get() + " \"" + s + "\"");
|
||||
}
|
||||
|
||||
void FeatureParamsBase::AddHouseNumber(string const & s)
|
||||
void FeatureParamsBase::AddHouseNumber(string const & ss)
|
||||
{
|
||||
// Remove trailing zero's from house numbers.
|
||||
// It's important for debug checks of serialized-deserialized feature.
|
||||
string s(ss);
|
||||
uint64_t n;
|
||||
if (strings::to_uint64(s, n))
|
||||
s = strings::to_string(n);
|
||||
|
||||
house.Set(house.IsEmpty() ? s : s + " \"" + house.Get() + "\"");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue