diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2015-12-23 17:10:09 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:04:06 +0300 |
commit | 0cd90b502238a889535400b9d8344aea9a95488a (patch) | |
tree | ce57b8f592b3c155d5d1cff43f12956c57dcb282 /editor/ui2oh.cpp | |
parent | e4f10f150243b954f844a84bca2608f5954d8f23 (diff) |
Implement type of a FeatureType serialization.
Diffstat (limited to 'editor/ui2oh.cpp')
-rw-r--r-- | editor/ui2oh.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/editor/ui2oh.cpp b/editor/ui2oh.cpp index de27826ab1..a77bfce3fc 100644 --- a/editor/ui2oh.cpp +++ b/editor/ui2oh.cpp @@ -1,7 +1,5 @@ #include "editor/ui2oh.hpp" -#include "base/enumerate.hpp" - #include "std/algorithm.hpp" #include "std/array.hpp" #include "std/string.hpp" @@ -74,9 +72,9 @@ bool ConvertOpeningHours(osmoh::OpeningHours const & oh, ui::TimeTableSet & tts) if (oh.IsTwentyFourHours()) return true; - for (auto const & p : my::Enumerate(oh.GetRule())) + bool first = true; + for (auto const & rulePart : oh.GetRule()) { - auto const & rulePart = p.item; ui::TimeTable tt; if (rulePart.HasWeekdays()) @@ -87,8 +85,13 @@ bool ConvertOpeningHours(osmoh::OpeningHours const & oh, ui::TimeTableSet & tts) tt.SetTwentyFourHours(false); SetUpTimeTable(rulePart.GetTimes(), tt); } + else + { + tt.SetTwentyFourHours(true); + } - bool const appended = p.index == 0 ? tts.Replace(tt, 0) : tts.Append(tt); + bool const appended = first ? tts.Replace(tt, 0) : tts.Append(tt); + first = false; if (!appended) return false; } |