From 3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 20 Feb 2016 21:19:35 +0300 Subject: Add missing const in gui directory. --- src/gui/widgets/textbox.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/textbox.cpp') diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index 8478e767e..d1c10be67 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -437,7 +437,7 @@ void TextBox::keyPressed(KeyEvent& event) event.consume(); } -void TextBox::draw(Graphics* graphics) +void TextBox::draw(Graphics *const graphics) { BLOCK_START("TextBox::draw") if (mOpaque) @@ -468,7 +468,7 @@ void TextBox::draw(Graphics* graphics) BLOCK_END("TextBox::draw") } -void TextBox::safeDraw(Graphics* graphics) +void TextBox::safeDraw(Graphics *const graphics) { TextBox::draw(graphics); } @@ -514,8 +514,9 @@ void TextBox::setTextRow(const int row, const std::string& text) void TextBox::setCaretPosition(unsigned int position) { - for (int row = 0, sz = CAST_S32(mTextRows.size()); - row < sz; row ++) + for (int row = 0, fsz = CAST_S32(mTextRows.size()); + row < fsz; + row ++) { if (position <= mTextRows[row].size()) { @@ -619,7 +620,9 @@ void TextBox::mouseDragged(MouseEvent& event) event.consume(); } -void TextBox::drawCaret(Graphics *const graphics, const int x, const int y) +void TextBox::drawCaret(Graphics *const graphics, + const int x, + const int y) const { graphics->setColor(mForegroundColor); graphics->drawLine(x, getFont()->getHeight() + y, x, y); -- cgit v1.2.3-70-g09d2