Corretto salvataggio MESSAGE dei TForm_item

Corretto errore di aggiornamento righe vuote dello sheet


git-svn-id: svn://10.65.10.50/trunk@1306 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 1995-04-26 08:06:43 +00:00
parent 7ee06bbdbb
commit 557329252b
3 changed files with 15 additions and 22 deletions

View File

@ -208,7 +208,11 @@ void TForm_item::print_body(ostream& out) const
out << _flag;
if (_message.items() == 1)
out << " MESSAGE " << (TToken_string&)_message[0] << endl;
{
const TToken_string& m = (TToken_string&)_message[0];
if (!m.empty_items())
out << " MESSAGE " << m << endl;
}
}
@ -229,7 +233,8 @@ bool TForm_item::parse_item(TScanner& scanner)
{
TFixed_string m(scanner.line());
m.strip_spaces();
message(0).add(m);
if (!m.blank())
message(0).add(m);
return TRUE;
}
@ -354,7 +359,7 @@ void TForm_item::send_message(const TString& cmd, TForm_item& des) const
bool TForm_item::do_message(int num)
{
TToken_string& messaggio = message(num);
if (messaggio.empty()) return FALSE;
if (messaggio.empty_items()) return FALSE;
TToken_string msg(16, ',');
for (const char* m = messaggio.get(0); m; m = messaggio.get())
@ -719,10 +724,9 @@ bool TForm_list::parse_item(TScanner& scanner)
_codes.add(s.get());
_values.add(s.get());
TString m(80);
while (scanner.popkey() == "ME")
{
m = scanner.line();
TFixed_string m(scanner.line());
m.strip_spaces();
message(_values.items()-1).add(m);
}

View File

@ -1,4 +1,4 @@
// $Id: mailbox.cpp,v 1.13 1995-03-27 14:45:05 alex Exp $
// $Id: mailbox.cpp,v 1.14 1995-04-26 08:06:41 guy Exp $
#include <stdlib.h>
#include <fstream.h>
@ -7,12 +7,6 @@
#include <mailbox.h>
#include <utility.h>
#if XVT_OS == XVT_OS_DOS || XVT_OS == XVT_OS_WIN
#include <io.h>
#else
#include <unistd.h>
#endif
#define DEF_MSGS_CAPACITY 50
#define MAX_TXT_LEN 200
@ -193,7 +187,7 @@ TMailbox::~TMailbox()
TMessage* m;
// scan all remaining messages and erase mailbox
reread();
if (access(_path,0) == 0)
if (fexist(_path))
remove(_path);
// send unread messages to myself
while((m = next()) != NULL)

View File

@ -1,5 +1,4 @@
#include <msksheet.h>
#include <real.h>
#include <urldefid.h>
#include <utility.h>
@ -1128,14 +1127,10 @@ void TSpreadsheet::str2mask(int riga)
const short id = f.dlg();
if (id >= FIRST_FIELD)
{
const char* v = r.get((id % 100)-1);
if (v)
{
val = v; // Save the value, f.set(v) could use TString methods
f.set(val);
const bool on = active() ? !cell_disabled(riga, id-FIRST_FIELD) : FALSE;
f.enable(on);
}
val = r.get((id % 100)-1);
f.set(val);
const bool on = active() ? !cell_disabled(riga, id-FIRST_FIELD) : FALSE;
f.enable(on);
}
}