diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-02-10 02:27:58 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-02-10 02:27:58 +0000 |
| commit | a4c8a839a3decc54e515fd110710195eca23fd2b (patch) | |
| tree | f1afa0982ddc6542ce00a36d7b6899d816a4914a /otk/label.cc | |
| parent | c26e5ea7519b02d7b83261faefeec657bb65c4a4 (diff) | |
layout fixes, give widgets a default texture, etc.
Diffstat (limited to 'otk/label.cc')
| -rw-r--r-- | otk/label.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/otk/label.cc b/otk/label.cc index 43d06f77..587e3212 100644 --- a/otk/label.cc +++ b/otk/label.cc @@ -55,7 +55,14 @@ void Label::setText(const ustring &text) std::string::size_type p = 0; while (p != std::string::npos) { std::string::size_type p2 = s.find('\n', p); - _parsedtext.push_back(s.substr(p, (p2==std::string::npos?p2:p2-p))); + std::string s(s.substr(p, (p2==std::string::npos?p2:p2-p))); + + // turn tabs into spaces (multiples of 8) + std::string::size_type t; + while ((t = s.find('\t')) != std::string::npos) + s.replace(t, 1, std::string(8 - t % 8, ' ')); + + _parsedtext.push_back(s); _parsedtext.back().setUtf8(utf); p = (p2==std::string::npos?p2:p2+1); } |
