summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textbox.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-30 22:53:27 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-30 22:53:27 +0300
commit5cbd0d2cb7086fda592c00dbc3b07d06af95f080 (patch)
treed36b4ac344f31f34311c7cb7a9a637ed48356e3e /src/gui/widgets/textbox.cpp
parent4210163dae7d6266923ab11f78b631173c9533e3 (diff)
downloadmanaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.gz
manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.bz2
manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.tar.xz
manaverse-5cbd0d2cb7086fda592c00dbc3b07d06af95f080.zip
Add const to more classes.
Diffstat (limited to 'src/gui/widgets/textbox.cpp')
-rw-r--r--src/gui/widgets/textbox.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 06a24c68f..5079b8bf2 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -41,7 +41,7 @@ TextBox::TextBox() :
mMinWidth = getWidth();
}
-void TextBox::setTextWrapped(const std::string &text, int minDimension)
+void TextBox::setTextWrapped(const std::string &text, const int minDimension)
{
// Make sure parent scroll area sets width of this widget
if (getParent())
@@ -91,7 +91,7 @@ void TextBox::setTextWrapped(const std::string &text, int minDimension)
std::string word =
line.substr(lastSpacePos, spacePos - lastSpacePos);
- int width = getFont()->getWidth(word);
+ const int width = getFont()->getWidth(word);
if (xpos == 0 && width > mMinWidth)
{
@@ -158,8 +158,8 @@ void TextBox::setTextWrapped(const std::string &text, int minDimension)
void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
{
- gcn::Key key = keyEvent.getKey();
- int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
+ const gcn::Key key = keyEvent.getKey();
+ const int action = static_cast<KeyEvent*>(&keyEvent)->getActionId();
switch (action)
{
@@ -282,11 +282,11 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
case Input::KEY_GUI_PAGE_UP:
{
- gcn::Widget* par = getParent();
+ gcn::Widget *const par = getParent();
if (par)
{
- int rowsPerPage = par->getChildrenArea().height
+ const int rowsPerPage = par->getChildrenArea().height
/ getFont()->getHeight();
mCaretRow -= rowsPerPage;
@@ -298,11 +298,11 @@ void TextBox::keyPressed(gcn::KeyEvent& keyEvent)
case Input::KEY_GUI_PAGE_DOWN:
{
- gcn::Widget* par = getParent();
+ gcn::Widget *const par = getParent();
if (par)
{
- int rowsPerPage = par->getChildrenArea().height
+ const int rowsPerPage = par->getChildrenArea().height
/ getFont()->getHeight();
mCaretRow += rowsPerPage;