Corretto memory leak in assoc
Terminata la gestione del bottone (unico!) negli sheet git-svn-id: svn://10.65.10.50/trunk@756 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
34ee6381f7
commit
ee2b6f15df
@ -44,7 +44,12 @@ bool TAssoc_array::add(const char* key, TObject* obj,
|
||||
|
||||
if (!isnew)
|
||||
{
|
||||
if (force) { o->_obj = obj; }
|
||||
if (force)
|
||||
{
|
||||
if (o->_obj != NULL)
|
||||
delete o->_obj;
|
||||
o->_obj = obj;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
o->_obj = obj;
|
||||
|
1410
include/btrbase.c
1410
include/btrbase.c
File diff suppressed because it is too large
Load Diff
@ -64,7 +64,7 @@ void TConfig::_write_file()
|
||||
{
|
||||
ifstream in(_file);
|
||||
TFilename temp;
|
||||
temp.temp("__tmp__.cnf");
|
||||
temp.temp("cnf");
|
||||
ofstream out(temp);
|
||||
|
||||
TFixed_string l(__tmp_string, sizeof(__tmp_string));
|
||||
@ -95,7 +95,8 @@ void TConfig::_write_file()
|
||||
out.close(); in.close();
|
||||
TFilename bak(_file); bak.ext("bak");
|
||||
rename(_file, bak);
|
||||
rename(temp, _file);
|
||||
fcopy(temp, _file); // Copia dalla tempdir al nuovo .ini
|
||||
remove(temp); // Cancella file temporaneo
|
||||
}
|
||||
|
||||
|
||||
|
@ -53,9 +53,9 @@ ACCEL MENU_FILE "f" ALT
|
||||
BMP_SELECT bitmap DISCARDABLE f:\p.due\bmp\select.bmp
|
||||
// BMP_FIRSTREC bitmap DISCARDABLE f:\p.due\bmp\firstrec.bmp
|
||||
// BMP_PREVREC bitmap DISCARDABLE f:\p.due\bmp\prevrec.bmp
|
||||
// BMP_STOPREC bitmap DISCARDABLE f:\p.due\bmp\stoprec.bmp
|
||||
// BMP_NEXTREC bitmap DISCARDABLE f:\p.due\bmp\nextrec.bmp
|
||||
// BMP_LASTREC bitmap DISCARDABLE f:\p.due\bmp\lastrec.bmp
|
||||
BMP_STOPREC bitmap DISCARDABLE f:\p.due\bmp\stoprec.bmp
|
||||
BMP_SAVEREC bitmap DISCARDABLE f:\p.due\bmp\saverec.bmp
|
||||
BMP_SAVERECDN bitmap DISCARDABLE f:\p.due\bmp\saverecd.bmp
|
||||
BMP_NEWREC bitmap DISCARDABLE f:\p.due\bmp\newrec.bmp
|
||||
|
@ -47,7 +47,7 @@ class TSpreadsheet : public TWindow
|
||||
bool _row_dirty; // Current row changed
|
||||
bool _check_enabled; // Perform OFF_ROW checks
|
||||
|
||||
short _icon;
|
||||
TString16 _button;
|
||||
|
||||
static void xiev_handler(XI_OBJ *itf, XI_EVENT *xiev);
|
||||
void init();
|
||||
@ -129,7 +129,7 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
||||
TSheet_field* o)
|
||||
: _mask(maskname, maskno), _notify(NULL), _edit_field(NULL),
|
||||
_owner(o), _cur_row(0), _cur_col(0), _active(TRUE),
|
||||
_row_dirty(FALSE), _check_enabled(TRUE), _firstfocus(TRUE), _icon(0)
|
||||
_row_dirty(FALSE), _check_enabled(TRUE), _firstfocus(TRUE)
|
||||
{
|
||||
const int NUMBER_WIDTH = 3;
|
||||
const int MAX_COL = 32;
|
||||
@ -230,7 +230,8 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
||||
coldef->v.column->center_heading = TRUE;
|
||||
|
||||
for (h = new_header.get(0), i = 0; h; h = new_header.get(), i++)
|
||||
{
|
||||
{
|
||||
const TString80 testo(h);
|
||||
const int cid = FIRST_FIELD+i; // Column & Field ID
|
||||
const TMask_field* f = field(cid); // Field on mask
|
||||
const int acqua = f->class_id();
|
||||
@ -248,20 +249,22 @@ TSpreadsheet::TSpreadsheet(short x, short y, short dx, short dy,
|
||||
if (f->active()) flags |= XI_ATR_ENABLED | XI_ATR_FOCUSBORDER | XI_ATR_AUTOSELECT;
|
||||
else _column_disabled.set(i);
|
||||
|
||||
coldef = xi_add_column_def(listdef, cid, flags, cid, v_width[i], m_width[i], (char*)h);
|
||||
coldef = xi_add_column_def(listdef, cid, flags, cid, v_width[i], m_width[i],
|
||||
(char*)(const char*)testo);
|
||||
coldef->v.column->heading_platform = TRUE;
|
||||
coldef->v.column->center_heading = TRUE;
|
||||
if (acqua == CLASS_BUTTON_FIELD)
|
||||
{
|
||||
const TString80 testa(header.get(i));
|
||||
const TFixed_string testa(header.get(i));
|
||||
const int diesis = testa.find('#');
|
||||
if (diesis > 0)
|
||||
{
|
||||
_icon = atoi(testa.mid(diesis+1));
|
||||
_button = testa.mid(diesis+1);
|
||||
coldef->v.column->icon_x = (v_width[i]*CHARX-16) >> 1;
|
||||
coldef->v.column->icon_y = (CHARY-16) >> 1;
|
||||
coldef->v.column->column_platform = TRUE;
|
||||
}
|
||||
else _button = testo;
|
||||
}
|
||||
}
|
||||
|
||||
@ -481,9 +484,11 @@ break;
|
||||
const int acqua = f->class_id();
|
||||
|
||||
if (acqua == CLASS_BUTTON_FIELD)
|
||||
{
|
||||
xiev->v.cell_request.icon_rid = _icon;
|
||||
src = NULL;
|
||||
{
|
||||
if (isdigit(_button[0]))
|
||||
xiev->v.cell_request.icon_rid = atoi(_button);
|
||||
else
|
||||
src = _button;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -82,8 +82,8 @@ const char* cmd2name(const char* argv0, const char* argv1)
|
||||
const int par = app.find(" -");
|
||||
if (par > 0)
|
||||
{
|
||||
int num = atoi(app.mid(par+2)) + 1;
|
||||
char c = (num > 9) ? ('a'+num-10) : ('0'+num);
|
||||
const int num = atoi(app.mid(par+2)) + 1;
|
||||
const char c = (num > 9) ? ('a'+num-10) : ('0'+num);
|
||||
app.cut(par);
|
||||
app << c << "00";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user