Commit 33b00e21 authored by Volker Krause's avatar Volker Krause Committed by David Faure
Browse files

Merge adjacent single weekday and time range selectors

BUG: 445784
parent ca23f165
Pipeline #105450 passed with stage
in 58 seconds
......@@ -205,6 +205,7 @@ private Q_SLOTS:
T2("week 1-3 Mo[2], Tu-Fr, Sa [-1] 09:00-14:00", "week 01-03 Mo[2],Tu-Fr,Sa[-1] 09:00-14:00");
T2("Mo Fr 09:30-12:30 13:30-18:30", "Mo,Fr 09:30-12:30,13:30-18:30");
T2("Mo, We, Fr 06:30-21:30; Tu, Th 09:00-21:30; Sa 09:00-17:00; Su 09:00-14:00", "Mo,We,Fr 06:30-21:30; Tu,Th 09:00-21:30; Sa 09:00-17:00; Su 09:00-14:00");
T2("Lunes a sábado, 9:30 AM-5:30 PM", "Mo-Sa 09:30-17:30"); // bug 445784
// technically wrong but often found content in OSM for which we have error recovery
T2("So", "Su");
......
......@@ -84,6 +84,12 @@ void OpeningHoursPrivate::autocorrect()
it = std::prev(m_rules.erase(it));
}
// previous is a single weekday selector and current is a single time selector
else if (curRuleSingleSelector && prevRuleSingleSelector && rule->m_timeSelector && prevRule->m_weekdaySelector) {
prevRule->m_timeSelector = std::move(rule->m_timeSelector);
it = std::prev(m_rules.erase(it));
}
// previous is a single monthday selector
else if (rule->m_monthdaySelector && prevRuleSingleSelector && prevRule->m_monthdaySelector && !isWiderThan(prevRule, rule)) {
auto tmp = std::move(rule->m_monthdaySelector);
......
Markdown is supported
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