From 3ddaec5f355ed1d231514cf0a863c4b9e35cf2a6 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sun, 19 Mar 2006 15:09:27 +0000 Subject: Reverted changeset r2269 (toString) as requested by ElvenProgrammer. --- src/gui/sell.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/gui/sell.cpp') diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index bde8906b..aa67adab 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -24,6 +24,7 @@ #include "sell.h" #include +#include #include @@ -42,7 +43,6 @@ #include "../net/messageout.h" #include "../net/protocol.h" -#include "../utils/tostring.h" SellDialog::SellDialog(Network *network): Window("Sell"), @@ -141,8 +141,11 @@ void SellDialog::addItem(Item *item, int price) return; ITEM_SHOP item_shop; + std::stringstream ss; - item_shop.name = item->getInfo()->getName() + " " + toString(price) + " GP"; + ss << item->getInfo()->getName() << " " << price << " GP"; + + item_shop.name = ss.str(); item_shop.price = price; item_shop.index = item->getInvIndex(); item_shop.id = item->getId(); @@ -237,12 +240,15 @@ void SellDialog::action(const std::string& eventId) // If anything changed, we need to update the buttons and labels if (updateButtonsAndLabels) { + std::stringstream oss; + // Update labels - mQuantityLabel->setCaption(toString(mAmountItems)); + oss << mAmountItems; + mQuantityLabel->setCaption(oss.str()); mQuantityLabel->adjustSize(); - - int price = mAmountItems * mShopItems->at(selectedItem).price; - mMoneyLabel->setCaption("Price: " + toString(price)); + oss.str(""); + oss << "Price: " << mAmountItems * mShopItems->at(selectedItem).price; + mMoneyLabel->setCaption(oss.str()); mMoneyLabel->adjustSize(); // Update Buttons -- cgit v1.2.3-70-g09d2