Changeset 343 for cpp/frams/util


Ignore:
Timestamp:
04/04/15 20:40:02 (9 years ago)
Author:
Maciej Komosinski
Message:

Code formatting

Location:
cpp/frams/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/util/advlist.cpp

    r286 r343  
    1010void AdvList::remove(int i)
    1111{
    12 l_del.action(i);
    13 SList::remove(i);
    14 l_postdel.action(i);
     12        l_del.action(i);
     13        SList::remove(i);
     14        l_postdel.action(i);
    1515}
    1616
    1717void AdvList::clear()
    1818{
    19 int i;
    20 for (i=size()-1;i>=0;i--) remove(i);
    21 resize(0);
    22 used=0;
     19        int i;
     20        for (i = size() - 1; i >= 0; i--) remove(i);
     21        resize(0);
     22        used = 0;
    2323}
    2424
    2525void AdvList::operator-=(void* e)
    2626{
    27 int i=find(e);
    28 if (i>=0) remove(i);
     27        int i = find(e);
     28        if (i >= 0) remove(i);
    2929}
    3030
    3131int AdvList::operator+=(void* e)
    3232{
    33 int p=size();
    34 SList::operator+=(e);
    35 l_add.action(p);
    36 return p;
     33        int p = size();
     34        SList::operator+=(e);
     35        l_add.action(p);
     36        return p;
    3737}
    3838
    3939void AdvList::mod(int x)
    4040{
    41 if (x<-1) x=-1;
    42 l_mod.action(x);
     41        if (x < -1) x = -1;
     42        l_mod.action(x);
    4343}
  • cpp/frams/util/advlist.h

    r286 r343  
    1919/// sorting functions moved to SortView class
    2020
    21 class AdvList: public SList
     21class AdvList : public SList
    2222{
    2323public:
    24 Callback l_add, l_del, l_mod, l_postdel;
    25 void remove(int);
    26 virtual void mod(int=-1); ///< call this when you change one or more elements in list (-1 means all elements)
    27 void clear();
    28 AdvList() {}
    29 ~AdvList() {clear();}
    30 int operator+=(void*);
    31 void operator-=(void*);
    32 void operator-=(int i) {remove(i);}
     24        Callback l_add, l_del, l_mod, l_postdel;
     25        void remove(int);
     26        virtual void mod(int = -1); ///< call this when you change one or more elements in list (-1 means all elements)
     27        void clear();
     28        AdvList() {}
     29        ~AdvList() { clear(); }
     30        int operator+=(void*);
     31        void operator-=(void*);
     32        void operator-=(int i) { remove(i); }
    3333};
    3434
Note: See TracChangeset for help on using the changeset viewer.