summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-06-02 00:32:53 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2011-06-02 16:41:47 +0200
commit4e27937924766948d7ff9200f04a37fe4d59018c (patch)
treec1f5c255192c85a82c77c2f8f916984e2b863c44 /src/gui/widgets
parentc2eab288ecc7d7c5e26d02ccecf285cbc0c218ed (diff)
downloadMana-4e27937924766948d7ff9200f04a37fe4d59018c.tar.gz
Mana-4e27937924766948d7ff9200f04a37fe4d59018c.tar.bz2
Mana-4e27937924766948d7ff9200f04a37fe4d59018c.tar.xz
Mana-4e27937924766948d7ff9200f04a37fe4d59018c.zip
Arbitrary code cleanups
Just some stuff that piles up while "looking" at the code, which eventually gets annoying to ignore while staging real changes. * Replaced a few NULL occurrences with 0 * Rely on default parameter for std::vector::resize. * Replaced a few "" with std::string() * Prefer .empty() to == "" * Removed a few comparisons with NULL * Don't check pointers before deleting them * Removed a bunch of redundant semicolons * Made some global variables static (local to their compilation unit) * Prefer prefix ++/-- operators to postfix versions when possible * Corrected location of a comment
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/listbox.cpp4
-rw-r--r--src/gui/widgets/tablemodel.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 570983ca..239f4784 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -118,8 +118,6 @@ void ListBox::keyPressed(gcn::KeyEvent& keyEvent)
}
}
-// Don't do anything on scrollwheel. ScrollArea will deal with that.
-
void ListBox::mousePressed(gcn::MouseEvent &mouseEvent)
{
if (mouseEvent.getButton() != gcn::MouseEvent::LEFT)
@@ -134,10 +132,12 @@ void ListBox::mousePressed(gcn::MouseEvent &mouseEvent)
void ListBox::mouseWheelMovedUp(gcn::MouseEvent &mouseEvent)
{
+ // Don't do anything on scrollwheel. ScrollArea will deal with that.
}
void ListBox::mouseWheelMovedDown(gcn::MouseEvent &mouseEvent)
{
+ // Don't do anything on scrollwheel. ScrollArea will deal with that.
}
void ListBox::mouseDragged(gcn::MouseEvent &event)
diff --git a/src/gui/widgets/tablemodel.cpp b/src/gui/widgets/tablemodel.cpp
index b4bbb409..477b35c0 100644
--- a/src/gui/widgets/tablemodel.cpp
+++ b/src/gui/widgets/tablemodel.cpp
@@ -56,7 +56,7 @@ StaticTableModel::StaticTableModel(int row, int column) :
mColumns(column),
mHeight(1)
{
- mTableModel.resize(row * column, NULL);
+ mTableModel.resize(row * column);
mWidths.resize(column, 1);
}
@@ -69,7 +69,7 @@ void StaticTableModel::resize()
{
mRows = getRows();
mColumns = getColumns();
- mTableModel.resize(mRows * mColumns, NULL);
+ mTableModel.resize(mRows * mColumns);
}
void StaticTableModel::set(int row, int column, gcn::Widget *widget)