From 308e352fbf2fd4f96d797e596fc41083e53e6106 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 13 Feb 2013 01:11:50 +0300 Subject: Fix code style. --- src/gui/charselectdialog.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'src/gui/charselectdialog.cpp') diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index c127f9bf8..ffa88cb75 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -139,8 +139,8 @@ class CharacterScroller final : public Container, public gcn::ActionListener { public: - CharacterScroller(CharSelectDialog *widget, - std::vector *entries) : + CharacterScroller(CharSelectDialog *const widget, + std::vector *const entries) : Container(widget), gcn::ActionListener(), mSelectedEntry(nullptr), @@ -168,7 +168,7 @@ class CharacterScroller final : public Container, void show(const int i) { - const int sz = (signed)mCharacterEntries->size(); + const int sz = static_cast(mCharacterEntries->size()); if (mSelectedEntry) mSelectedEntry->setVisible(false); if (i >= sz) @@ -185,14 +185,13 @@ class CharacterScroller final : public Container, void resize() { - CharacterDisplay *firtChar = (*mCharacterEntries)[0]; + const CharacterDisplay *const firtChar = (*mCharacterEntries)[0]; const int x = (getWidth() - firtChar->getWidth()) / 2; const int y = (getHeight() - firtChar->getHeight()) / 2; FOR_EACHP (std::vector::iterator, it, mCharacterEntries) { - CharacterDisplay *character = *it; - character->setPosition(x, y); + (*it)->setPosition(x, y); } const int y2 = (getHeight() - mPrevious->getHeight()) / 2; const int y3 = y2 - 55; @@ -216,7 +215,7 @@ class CharacterScroller final : public Container, } } - int getSelected() + int getSelected() const { return mSelected; } @@ -297,23 +296,20 @@ CharSelectDialog::CharSelectDialog(LoginData *const data): { for (int i = 0; i < static_cast(mLoginData->characterSlots); i++) { - CharacterDisplay *character = new CharacterDisplay(this, this); + CharacterDisplay *const character + = new CharacterDisplay(this, this); character->setVisible(false); mCharacterEntries.push_back(character); -// placer(i % SLOTS_PER_ROW, static_cast(i) / SLOTS_PER_ROW, -// mCharacterEntries[i]); } mCharacterScroller = new CharacterScroller(this, &mCharacterEntries); - mCharacterScroller->setWidth(mainGraphics->getWidth() - 2 * getPadding()); + mCharacterScroller->setWidth(mainGraphics->getWidth() + - 2 * getPadding()); mCharacterScroller->setHeight(200); placer(0, 0, mCharacterScroller); -// placer(0, 0, mCharacterEntries[0]); } reflowLayout(); - addKeyListener(this); - center(); setVisible(true); @@ -673,7 +669,7 @@ bool CharSelectDialog::selectByName(const std::string &name, { if (character->dummy && character->dummy->getName() == name) { - focusCharacter(i); + focusCharacter(static_cast(i)); if (selAction == Choose) attemptCharacterSelect(static_cast(i)); return true; -- cgit v1.2.3-70-g09d2