diff options
author | Andrew Kurushin | 2004-12-16 20:49:17 +0000 |
---|---|---|
committer | Andrew Kurushin | 2004-12-16 20:49:17 +0000 |
commit | c1810c8de24cfb05b825f45f24ca7a880dc0a375 (patch) | |
tree | 4689ad71f3de40e4b875f9391f08b89b1e756547 /saga | |
parent | ea80946978cf6406e0bf10f475788269e5ab4400 (diff) | |
download | scummvm-rg350-c1810c8de24cfb05b825f45f24ca7a880dc0a375.tar.gz scummvm-rg350-c1810c8de24cfb05b825f45f24ca7a880dc0a375.tar.bz2 scummvm-rg350-c1810c8de24cfb05b825f45f24ca7a880dc0a375.zip |
reorderUp and reorderDown should return new item position
svn-id: r16087
Diffstat (limited to 'saga')
-rw-r--r-- | saga/list.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/saga/list.h b/saga/list.h index 619060cf2f..397717c55c 100644 --- a/saga/list.h +++ b/saga/list.h @@ -34,7 +34,7 @@ public: typedef typename Common::List<T>::iterator iterator; typedef typename Common::List<T>::const_iterator const_iterator; - + public: iterator pushFront(const T& element) { @@ -83,7 +83,7 @@ public: return pushBack(element); } - void reorderUp(iterator pos, CompareFunction* compareFunction) { + iterator reorderUp(iterator pos, CompareFunction* compareFunction) { iterator i(pos); int res; @@ -94,15 +94,15 @@ public: T temp(*pos); erase(pos); - ++i; - Common::List<T>::insert(i, temp); - return; + ++i; + return insert(i, temp); } --i; } + return pos; } - void reorderDown(iterator pos, CompareFunction* compareFunction) { + iterator reorderDown(iterator pos, CompareFunction* compareFunction) { iterator i(pos); int res; @@ -113,11 +113,11 @@ public: T temp(*pos); erase(pos); - Common::List<T>::insert(i, temp); - return; + return insert(i, temp); } ++i; } + return pos; } iterator eraseAndPrev(iterator pos) { @@ -151,4 +151,4 @@ public: }; } // End of namespace Saga -#endif +#endif
\ No newline at end of file |