summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textfield.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-02-08 00:49:41 +0300
committerAndrei Karas <akaras@inbox.ru>2012-02-08 00:49:41 +0300
commitff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9 (patch)
tree51a99a43eba0b09ca9e5f554b3676d0308685797 /src/gui/widgets/textfield.cpp
parent538261b13990ee02bbc62d9704233885b15cee04 (diff)
downloadplus-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.tar.gz
plus-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.tar.bz2
plus-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.tar.xz
plus-ff5e17ff14a78af31d9d23cd1dfdb5404f9a8fa9.zip
Fix code style with new tool.
Diffstat (limited to 'src/gui/widgets/textfield.cpp')
-rw-r--r--src/gui/widgets/textfield.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 4dba2eb57..e207b0613 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -208,29 +208,29 @@ void TextField::keyPressed(gcn::KeyEvent &keyEvent)
}
else if (!mMaximum || mText.size() < mMaximum)
{
- int l;
+ int len;
if (val < 128)
- l = 1; // 0xxxxxxx
+ len = 1; // 0xxxxxxx
else if (val < 0x800)
- l = 2; // 110xxxxx 10xxxxxx
+ len = 2; // 110xxxxx 10xxxxxx
else if (val < 0x10000)
- l = 3; // 1110xxxx 10xxxxxx 10xxxxxx
+ len = 3; // 1110xxxx 10xxxxxx 10xxxxxx
else
- l = 4; // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ len = 4; // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
char buf[4];
- for (int i = 0; i < l; ++i)
+ for (int i = 0; i < len; ++ i)
{
- buf[i] = static_cast<char>(val >> (6 * (l - i - 1)));
+ buf[i] = static_cast<char>(val >> (6 * (len - i - 1)));
if (i > 0)
buf[i] = static_cast<char>((buf[i] & 63) | 128);
}
- if (l > 1)
- buf[0] |= static_cast<char>(255 << (8 - l));
+ if (len > 1)
+ buf[0] |= static_cast<char>(255 << (8 - len));
- mText.insert(mCaretPosition, std::string(buf, buf + l));
- mCaretPosition += l;
+ mText.insert(mCaretPosition, std::string(buf, buf + len));
+ mCaretPosition += len;
}
}