minor cleanup of '\n' to ' ' code

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@397 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
twanvl
2007-05-19 18:09:26 +00:00
parent 8aef0b244b
commit 7a66256ebd
+13 -9
View File
@@ -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;
} }
} }