From 333745260338c876989744468a5f9c707e9bcc66 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 Apr 2012 02:15:28 +0300 Subject: Fix code style. --- src/gui/buydialog.cpp | 5 ++--- src/gui/gui.cpp | 4 ++-- src/gui/minimap.cpp | 4 ++-- src/gui/npcdialog.cpp | 2 +- src/gui/widgets/chattab.cpp | 3 +-- src/gui/widgets/label.cpp | 2 +- 6 files changed, 9 insertions(+), 11 deletions(-) (limited to 'src/gui') diff --git a/src/gui/buydialog.cpp b/src/gui/buydialog.cpp index c41f22de7..83207b3d8 100644 --- a/src/gui/buydialog.cpp +++ b/src/gui/buydialog.cpp @@ -91,8 +91,7 @@ void BuyDialog::init() mSlider = new Slider(1.0); mQuantityLabel = new Label(strprintf("%d / %d", mAmountItems, mMaxItems)); mQuantityLabel->setAlignment(gcn::Graphics::CENTER); - mMoneyLabel = new Label(strprintf(_("Price: %s / Total: %s"), - "", "")); + mMoneyLabel = new Label(strprintf(_("Price: %s / Total: %s"), "", "")); mAmountField = new IntTextField(1, 1, 123); mAmountField->setActionEventId("amount"); @@ -196,7 +195,7 @@ void BuyDialog::action(const gcn::ActionEvent &event) // The following actions require a valid selection if (selectedItem < 0 || - selectedItem >= static_cast(mShopItems->getNumberOfElements())) + selectedItem >= mShopItems->getNumberOfElements()) { return; } diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 19361cf2d..e45bc71c0 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -492,7 +492,7 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button, if (!gcn::Widget::widgetExists(widget)) break; - parent = static_cast(widget->getParent()); + parent = widget->getParent(); if (widget->isEnabled() || force) { @@ -551,7 +551,7 @@ void Gui::distributeMouseEvent(gcn::Widget* source, int type, int button, gcn::Widget* swap = widget; widget = parent; - parent = static_cast(swap->getParent()); + parent = swap->getParent(); // If a non modal focused widget has been reach // and we have modal focus cancel the distribution. diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 8089a2feb..9c7ab76cb 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -229,10 +229,10 @@ void Minimap::draw(gcn::Graphics *graphics) mMapImage->mBounds.h > a.height) { const Vector &p = player_node->getPosition(); - mMapOriginX = ((a.width) / 2) - (static_cast(p.x + mMapOriginX = (a.width / 2) - (static_cast(p.x + viewport->getCameraRelativeX()) * mWidthProportion) / 32; - mMapOriginY = ((a.height) / 2) - (static_cast(p.y + mMapOriginY = (a.height / 2) - (static_cast(p.y + viewport->getCameraRelativeY()) * mHeightProportion) / 32; const int minOriginX = a.width - mMapImage->mBounds.w; diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index 5e0e9d56f..24d94dc3f 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -84,7 +84,7 @@ NpcDialog::NpcDialog(int npcId) : // Setup output text box mTextBox = new BrowserBox(BrowserBox::AUTO_WRAP); mTextBox->setOpaque(false); - mTextBox->setMaxRow(static_cast(config.getIntValue("ChatLogLength"))); + mTextBox->setMaxRow(config.getIntValue("ChatLogLength")); mTextBox->setLinkHandler(mItemLinkHandler); mScrollArea = new ScrollArea(mTextBox); diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp index 9b3a00963..5f97cd613 100644 --- a/src/gui/widgets/chattab.cpp +++ b/src/gui/widgets/chattab.cpp @@ -60,8 +60,7 @@ ChatTab::ChatTab(const std::string &name) : mTextOutput = new BrowserBox(BrowserBox::AUTO_WRAP); mTextOutput->setOpaque(false); - mTextOutput->setMaxRow(static_cast( - config.getIntValue("ChatLogLength"))); + mTextOutput->setMaxRow(config.getIntValue("ChatLogLength")); if (chatWindow) mTextOutput->setLinkHandler(chatWindow->mItemLinkHandler); mTextOutput->setAlwaysUpdate(false); diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp index 640010c62..dde7ddca3 100644 --- a/src/gui/widgets/label.cpp +++ b/src/gui/widgets/label.cpp @@ -38,5 +38,5 @@ Label::Label(const std::string &caption) : void Label::draw(gcn::Graphics *graphics) { - gcn::Label::draw(static_cast(graphics)); + gcn::Label::draw(graphics); } -- cgit v1.2.3-60-g2f50