Commit ec4829f2 authored by twanvl's avatar twanvl

minor cleanup of '\n' to ' ' code

parent d3be78e1
...@@ -165,25 +165,29 @@ bool KeywordList::compareItems(void* a, void* b) const { ...@@ -165,25 +165,29 @@ bool KeywordList::compareItems(void* a, void* b) const {
String KeywordList::OnGetItemText (long pos, long col) const { String KeywordList::OnGetItemText (long pos, long col) const {
const Keyword& kw = *getKeyword(pos); const Keyword& kw = *getKeyword(pos);
String formatted;
wxChar c;
switch(col) { switch(col) {
case 0: return kw.keyword; case 0: return kw.keyword;
case 1: return match_string(kw); case 1: return match_string(kw);
case 2: return kw.mode; case 2: return kw.mode;
case 3: return _("?"); case 3: return _("?");
case 4: case 4: {
formatted.Clear(); // convert all whitespace to ' '
for (size_t i = 0; i < kw.reminder.getUnparsed().Len(); ++i) { String formatted;
c = kw.reminder.getUnparsed().GetChar(i); bool seen_space = false;
for (size_t i = 0; i < kw.reminder.getUnparsed().size(); ++i) {
Char c = kw.reminder.getUnparsed().GetChar(i);
if (isSpace(c)) { if (isSpace(c)) {
formatted.Trim(); seen_space = true;
formatted += ' '; } else {
if (seen_space) {
formatted += _(' ');
seen_space = false;
} }
else
formatted += c; formatted += c;
}
} }
return formatted; return formatted;
}
default: return wxEmptyString; default: return wxEmptyString;
} }
} }
......
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