summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-01-15 01:07:47 +0200
committerAndrei Karas <akaras@inbox.ru>2011-01-15 02:05:50 +0200
commite2150d04662a4ba8b5304dabcc74be0bacded5b7 (patch)
treecbeb05c2f056a7d5ac4a08e7b80799b5cfd4785b /src/gui/widgets
parentedda37acb9d66f2751ef712c83dced62428fa685 (diff)
downloadmanaplus-e2150d04662a4ba8b5304dabcc74be0bacded5b7.tar.gz
manaplus-e2150d04662a4ba8b5304dabcc74be0bacded5b7.tar.bz2
manaplus-e2150d04662a4ba8b5304dabcc74be0bacded5b7.tar.xz
manaplus-e2150d04662a4ba8b5304dabcc74be0bacded5b7.zip
Fix code style, apply some fixes after checking with cppcheck from git.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/browserbox.cpp6
-rw-r--r--src/gui/widgets/flowcontainer.cpp2
-rw-r--r--src/gui/widgets/itemcontainer.cpp5
-rw-r--r--src/gui/widgets/shortcutcontainer.cpp8
-rw-r--r--src/gui/widgets/shortcutcontainer.h1
-rw-r--r--src/gui/widgets/tabbedarea.cpp4
-rw-r--r--src/gui/widgets/tablemodel.cpp4
-rw-r--r--src/gui/widgets/textfield.cpp4
-rw-r--r--src/gui/widgets/textpreview.cpp4
9 files changed, 25 insertions, 13 deletions
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index acb182c3c..3e3b9f07f 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -178,7 +178,7 @@ void BrowserBox::addRow(const std::string &row, bool atTop)
int hyphenWidth = font->getWidth(hyphen);
int x = 0;
- for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); i++)
+ for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); ++i)
{
std::string row = *i;
for (unsigned int j = 0; j < row.size(); j++)
@@ -316,7 +316,7 @@ void BrowserBox::draw(gcn::Graphics *graphics)
for (LinePartIterator i = mLineParts.begin();
i != mLineParts.end();
- i ++)
+ ++i)
{
const LinePart &part = *i;
if (part.mY + 50 < mYStart)
@@ -347,7 +347,7 @@ int BrowserBox::calcHeight()
mLineParts.clear();
- for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); i++)
+ for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); ++i)
{
const std::string row = *(i);
bool wrapped = false;
diff --git a/src/gui/widgets/flowcontainer.cpp b/src/gui/widgets/flowcontainer.cpp
index a93818abc..2154c0958 100644
--- a/src/gui/widgets/flowcontainer.cpp
+++ b/src/gui/widgets/flowcontainer.cpp
@@ -65,7 +65,7 @@ void FlowContainer::widgetResized(const gcn::Event &event _UNUSED_)
int i = 0;
height = 0;
for (WidgetList::iterator it = mWidgets.begin();
- it != mWidgets.end(); it++)
+ it != mWidgets.end(); ++it)
{
int x = i % mGridWidth * mBoxWidth;
(*it)->setPosition(x, height);
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index f4e2792ef..d85f57542 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -484,8 +484,11 @@ void ItemContainer::updateMatrix()
}
}
- for (int idx = j * mGridColumns + i; idx < mGridRows * mGridColumns; idx ++)
+ for (int idx = j * mGridColumns + i;
+ idx < mGridRows * mGridColumns; idx ++)
+ {
mShowMatrix[idx] = -1;
+ }
for (unsigned idx = 0; idx < sortedItems.size(); idx ++)
delete sortedItems[idx];
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp
index 167296410..8ce252150 100644
--- a/src/gui/widgets/shortcutcontainer.cpp
+++ b/src/gui/widgets/shortcutcontainer.cpp
@@ -31,7 +31,13 @@ float ShortcutContainer::mAlpha = 1.0;
ShortcutContainer::ShortcutContainer():
mGridWidth(1),
- mGridHeight(1)
+ mGridHeight(1),
+ mBackgroundImg(0),
+ mMaxItems(0),
+ mBoxWidth(1),
+ mBoxHeight(1),
+ mCursorPosX(0),
+ mCursorPosY(0)
{
}
diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h
index 85d08d0b4..11008b4ce 100644
--- a/src/gui/widgets/shortcutcontainer.h
+++ b/src/gui/widgets/shortcutcontainer.h
@@ -102,7 +102,6 @@ class ShortcutContainer : public gcn::Widget,
int getIndexFromGrid(int pointX, int pointY) const;
Image *mBackgroundImg;
-
static float mAlpha;
unsigned mMaxItems;
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 232664860..7061f54d6 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -121,7 +121,7 @@ void TabbedArea::removeTab(Tab *tab)
}
TabContainer::iterator iter;
- for (iter = mTabs.begin(); iter != mTabs.end(); iter++)
+ for (iter = mTabs.begin(); iter != mTabs.end(); ++iter)
{
if (iter->first == tab)
{
@@ -132,7 +132,7 @@ void TabbedArea::removeTab(Tab *tab)
}
std::vector<gcn::Tab*>::iterator iter2;
- for (iter2 = mTabsToDelete.begin(); iter2 != mTabsToDelete.end(); iter2++)
+ for (iter2 = mTabsToDelete.begin(); iter2 != mTabsToDelete.end(); ++iter2)
{
if (*iter2 == tab)
{
diff --git a/src/gui/widgets/tablemodel.cpp b/src/gui/widgets/tablemodel.cpp
index f1d583ef6..1b5ec5923 100644
--- a/src/gui/widgets/tablemodel.cpp
+++ b/src/gui/widgets/tablemodel.cpp
@@ -40,7 +40,7 @@ void TableModel::removeListener(TableModelListener *listener)
void TableModel::signalBeforeUpdate()
{
for (std::set<TableModelListener *>::const_iterator it = listeners.begin();
- it != listeners.end(); it++)
+ it != listeners.end(); ++it)
{
(*it)->modelUpdated(false);
}
@@ -49,7 +49,7 @@ void TableModel::signalBeforeUpdate()
void TableModel::signalAfterUpdate()
{
for (std::set<TableModelListener *>::const_iterator it = listeners.begin();
- it != listeners.end(); it++)
+ it != listeners.end(); ++it)
{
if (*it)
(*it)->modelUpdated(true);
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 9a5b2de33..e7c181de2 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -46,7 +46,9 @@ ImageRect TextField::skin;
TextField::TextField(const std::string &text, bool loseFocusOnTab,
gcn::ActionListener* listener, std::string eventId):
gcn::TextField(text),
- mNumeric(false)
+ mNumeric(false),
+ mMinimum(0),
+ mMaximum(0)
{
setFrameSize(2);
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp
index bd38d8a80..cf52c30ec 100644
--- a/src/gui/widgets/textpreview.cpp
+++ b/src/gui/widgets/textpreview.cpp
@@ -34,7 +34,9 @@
float TextPreview::mAlpha = 1.0;
TextPreview::TextPreview(const std::string &text):
- mText(text)
+ mText(text),
+ mShadow(false),
+ mOutline(false)
{
mTextAlpha = false;
mFont = gui->getFont();