diff options
| author | Manolo Gouy <Manolo> | 2016-04-13 19:18:56 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-13 19:18:56 +0000 |
| commit | 7a580fd4216824a8fe4babf7295188d6112b3ab5 (patch) | |
| tree | a219cd37daed25b1baa5b5179e26a448d691e51c /src/Fl_Tree_Item_Array.cxx | |
| parent | 70f7738c920fac5ff84c40a673bb7b87245d4d0c (diff) | |
Remove FL_ABI_VERSION clauses from the Fl_Tree class source code
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11602 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Tree_Item_Array.cxx')
| -rw-r--r-- | src/Fl_Tree_Item_Array.cxx | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/Fl_Tree_Item_Array.cxx b/src/Fl_Tree_Item_Array.cxx index 7f7476569..1da368c9a 100644 --- a/src/Fl_Tree_Item_Array.cxx +++ b/src/Fl_Tree_Item_Array.cxx @@ -36,9 +36,7 @@ Fl_Tree_Item_Array::Fl_Tree_Item_Array(int new_chunksize) { _items = 0; _total = 0; _size = 0; -#if FLTK_ABI_VERSION >= 10303 _flags = 0; -#endif _chunksize = new_chunksize; } @@ -53,11 +51,8 @@ Fl_Tree_Item_Array::Fl_Tree_Item_Array(const Fl_Tree_Item_Array* o) { _total = 0; _size = o->_size; _chunksize = o->_chunksize; -#if FLTK_ABI_VERSION >= 10303 _flags = o->_flags; -#endif for ( int t=0; t<o->_total; t++ ) { -#if FLTK_ABI_VERSION >= 10303 if ( _flags & MANAGE_ITEM ) { _items[t] = new Fl_Tree_Item(o->_items[t]); // make new copy of item ++_total; @@ -66,11 +61,6 @@ Fl_Tree_Item_Array::Fl_Tree_Item_Array(const Fl_Tree_Item_Array* o) { _items[t] = o->_items[t]; // copy ptr only ++_total; } -#else - _items[t] = new Fl_Tree_Item(o->_items[t]); // make new copy of item - ++_total; - _items[t]->update_prev_next(t); // update uses _total's current value -#endif } } @@ -82,9 +72,7 @@ Fl_Tree_Item_Array::Fl_Tree_Item_Array(const Fl_Tree_Item_Array* o) { void Fl_Tree_Item_Array::clear() { if ( _items ) { for ( int t=0; t<_total; t++ ) { -#if FLTK_ABI_VERSION >= 10303 if ( _flags & MANAGE_ITEM ) -#endif { delete _items[t]; _items[t] = 0; @@ -132,9 +120,7 @@ void Fl_Tree_Item_Array::insert(int pos, Fl_Tree_Item *new_item) { } _items[pos] = new_item; _total++; -#if FLTK_ABI_VERSION >= 10303 if ( _flags & MANAGE_ITEM ) -#endif { _items[pos]->update_prev_next(pos); // adjust item's prev/next and its neighbors } @@ -157,16 +143,12 @@ void Fl_Tree_Item_Array::add(Fl_Tree_Item *val) { /// void Fl_Tree_Item_Array::replace(int index, Fl_Tree_Item *newitem) { if ( _items[index] ) { // delete if non-zero -#if FLTK_ABI_VERSION >= 10303 if ( _flags & MANAGE_ITEM ) -#endif // Destroy old item delete _items[index]; } _items[index] = newitem; // install new item -#if FLTK_ABI_VERSION >= 10303 - if ( _flags & MANAGE_ITEM ) -#endif + if ( _flags & MANAGE_ITEM ) { // Restitch into linked list _items[index]->update_prev_next(index); @@ -179,9 +161,7 @@ void Fl_Tree_Item_Array::replace(int index, Fl_Tree_Item *newitem) { /// void Fl_Tree_Item_Array::remove(int index) { if ( _items[index] ) { // delete if non-zero -#if FLTK_ABI_VERSION >= 10303 if ( _flags & MANAGE_ITEM ) -#endif delete _items[index]; } _items[index] = 0; @@ -189,9 +169,7 @@ void Fl_Tree_Item_Array::remove(int index) { for ( int i=index; i<_total; i++ ) { // reshuffle the array _items[i] = _items[i+1]; } -#if FLTK_ABI_VERSION >= 10303 - if ( _flags & MANAGE_ITEM ) -#endif + if ( _flags & MANAGE_ITEM ) { if ( index < _total ) { // removed item not last? _items[index]->update_prev_next(index); // update next item's prev/next and neighbors @@ -216,22 +194,18 @@ int Fl_Tree_Item_Array::remove(Fl_Tree_Item *item) { return(-1); } -#if FLTK_ABI_VERSION >= 10301 /// Swap the two items at index positions \p ax and \p bx. void Fl_Tree_Item_Array::swap(int ax, int bx) { Fl_Tree_Item *asave = _items[ax]; _items[ax] = _items[bx]; _items[bx] = asave; -#if FLTK_ABI_VERSION >= 10303 if ( _flags & MANAGE_ITEM ) -#endif { // Adjust prev/next ptrs _items[ax]->update_prev_next(ax); _items[bx]->update_prev_next(bx); } } -#endif /* FLTK_ABI_VERSION */ /// Move item at 'from' to new position 'to' in the array. /// Due to how the moving an item shuffles the array around, |
