summaryrefslogtreecommitdiff
path: root/src/gui/widgets/textbox.cpp
diff options
context:
space:
mode:
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;