diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-08-18 15:16:08 +0000 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2017-08-18 15:16:08 +0000 |
| commit | 2828cbde2c2a3dda5b2a4cc550dbf5f5ad12d8a5 (patch) | |
| tree | 70d994a89590ca741755e2a6444bcfabb125642a /FL/Fl_Table_Row.H | |
| parent | 638fba602018fe815321e33fa1cd26f1395b3cca (diff) | |
Avoid #include's of unrelated system headers in Fl_Table*.H.
Possible side effect: programs that relied upon inclusion of unrelated
system headers by FL/Fl_Table.H or FL/Fl_Table_Row.H may fail to compile.
Removed include files (some only on certain platforms, list may be incomplete):
#include <FL/Fl.H> // moved to implementation (.cxx)
#include <FL/Fl_Box.H> // moved to implementation (.cxx)
#include <FL/Fl_Scrollbar.H> // moved to implementation (.cxx)
#include <sys/types.h>
#include <string.h> // memcpy
#include <malloc.h> // WINDOWS only: malloc/realloc
#include <stdlib.h> // UNIX: malloc/realloc
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12390 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/Fl_Table_Row.H')
| -rw-r--r-- | FL/Fl_Table_Row.H | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/FL/Fl_Table_Row.H b/FL/Fl_Table_Row.H index 891c58526..0a8fcca8f 100644 --- a/FL/Fl_Table_Row.H +++ b/FL/Fl_Table_Row.H @@ -22,7 +22,7 @@ // Please report all bugs and problems to "erco at seriss dot com". // -#include "Fl_Table.H" +#include <FL/Fl_Table.H> /** A table with row selection capabilities. @@ -54,21 +54,15 @@ private: char *arr; int _size; void init() { - arr = NULL; + arr = 0; _size = 0; } - void copy(char *newarr, int newsize) { - size(newsize); - memcpy(arr, newarr, newsize * sizeof(char)); - } + void copy(char *newarr, int newsize); public: CharVector() { // CTOR init(); } - ~CharVector() { // DTOR - if ( arr ) free(arr); - arr = NULL; - } + ~CharVector(); // DTOR CharVector(CharVector&o) { // COPY CTOR init(); copy(o.arr, o._size); @@ -87,12 +81,7 @@ private: int size() { return(_size); } - void size(int count) { - if ( count != _size ) { - arr = (char*)realloc(arr, count * sizeof(char)); - _size = count; - } - } + void size(int count); char pop_back() { char tmp = arr[_size-1]; _size--; @@ -107,6 +96,7 @@ private: return(arr[_size-1]); } }; + CharVector _rowselect; // selection flag for each row // handle() state variables. |
