diff --git a/include/isam.cpp b/include/isam.cpp index bf8f4adb1..6b5d30638 100755 --- a/include/isam.cpp +++ b/include/isam.cpp @@ -535,8 +535,23 @@ int TBaseisamfile::remove(TDate& atdate) { NOT_OPEN(); - // TBI rimozione campi memo + // rimozione campi memo + TMemo_file* memo = NULL; + for (int i = 0; i < curr().items(); i++) + { + if (curr().type(curr().fieldname(i)) == _memofld) + { + long val = curr().get_long(curr().fieldname(i)); + if (val > 0l) + { + if (memo == NULL) + memo = new TMemo_file(filename()); + memo->remove_field(val); + } + } + } + if (memo != NULL) delete memo; if ((!_historicfile) || (atdate == botime)) cisdelete(_isamfile, curr().string(), &_lasterr); @@ -1833,7 +1848,7 @@ void TRectype::put(const char* fieldname, long val) setempty(FALSE); } -void TRectype::put(const char* fieldname, const TTextfile& txt) +void TRectype::put(const char* fieldname, TTextfile& txt) { long val = get_long(fieldname); bool isnew = val == 0; diff --git a/include/isam.h b/include/isam.h index bfe34dd34..e0d26339f 100755 --- a/include/isam.h +++ b/include/isam.h @@ -115,7 +115,7 @@ public: void put(const char* fieldname, char val); void put(const char* fieldname, bool val); void put(const char* fieldname, const real& val); - void put(const char* fieldname, const TTextfile& txt); + void put(const char* fieldname, TTextfile& txt); #else #endif @@ -282,7 +282,7 @@ public: { curr().put(fieldname, val);} void put(const char* fieldname, const real& val) { curr().put(fieldname, val);} - void put(const char* fieldname, const TTextfile& txt) + void put(const char* fieldname, TTextfile& txt) { curr().put(fieldname, txt); } #else const char* get_str(const char* fieldname) const diff --git a/include/memo.cpp b/include/memo.cpp index 50c61fefb..459927c79 100755 --- a/include/memo.cpp +++ b/include/memo.cpp @@ -118,7 +118,7 @@ bool TMemo_file::get_field(TTextfile& t, long id) return ok; } -long TMemo_file::set_field(const TTextfile& t, long id) +long TMemo_file::set_field(TTextfile& t, long id) { bool ok = TRUE; long ret = 0; diff --git a/include/memo.h b/include/memo.h index 6e371ee82..544e07a87 100755 --- a/include/memo.h +++ b/include/memo.h @@ -28,7 +28,7 @@ public: bool get_field(TTextfile& t, long id = -1l); // sets field to specified text; if not present // returns new ID; if error returns -1, otherwise 0 - long set_field(const TTextfile& t, long id = -1l); + long set_field(TTextfile& t, long id = -1l); // removes field and pakkettates file bool remove_field(long id); // calls editor to edit text (specified as mem into config) diff --git a/include/printer.cpp b/include/printer.cpp index 401e21d53..7a62a4f92 100755 --- a/include/printer.cpp +++ b/include/printer.cpp @@ -567,6 +567,9 @@ TPrintrow & TPrintrow::put(const char *str, int position, int len) _attr[position++] = _currentstyle; } } + break; + case 'T': + _tab.set(position); break; case 'B': _currentstyle = boldstyle;