Patch level : 2.2

Files correlati     :
Ricompilazione Demo : [ ]
Commento            :

Correzioni varie per analitica e dintorni


git-svn-id: svn://10.65.10.50/trunk@13211 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2005-06-21 11:47:01 +00:00
parent 845b53fc60
commit 2a7d4c3c40
10 changed files with 69 additions and 49 deletions

View File

@ -60,6 +60,8 @@
#define CLASS_EXTERNISAMFILE 304
#define CLASS_SORTEDFILE 310
#define CLASS_VARIANT 330
#define CLASS_RECTYPE 350
#define CLASS_VARIABLE_RECTYPE 351
#define CLASS_AUTO_VARIABLE_RECTYPE 352

View File

@ -106,11 +106,12 @@ public:
// @cmember Permette di mettere il focus su una cella
void set_focus_cell(int riga, int colonna);
// @cmember Gestisce la pressione del tasto (TRUE se la gestione ha avuto successo)
// @cmember Gestisce la pressione del tasto (true se la gestione ha avuto successo)
virtual bool on_key(KEY k);
// @cmember Si, sono uno spreadsheet
virtual bool is_sheet() const { return TRUE; }
virtual bool is_sheet() const { return true; }
virtual bool empty() const { return items() == 0; }
// @cmember Legge automaticamente la linea dal record array assegnato
virtual bool autoload_line(int i,const TRectype & rec);
@ -154,9 +155,9 @@ public:
// @cmember Ritorna il numero della riga corrente
int selected() const;
// @cmember Seleziona la riga <p r> come quella corrente
void select(int r, bool scrollto = FALSE);
void select(int r, bool scrollto = false);
// @cmember Seleziona la riga <p r> e la colonna <p c> come quella corrente
void select(int r, int c, bool scrollto = FALSE);
void select(int r, int c, bool scrollto = false);
// @cmember Prenota la selezione della riga <p r>
void post_select(int r);
@ -172,9 +173,9 @@ public:
void on_idle();
// @cmember Elimina una o tutte le righe
void destroy(int r = -1, bool update_sheet = TRUE);
void destroy(int r = -1, bool update_sheet = true);
// @cmember Inserisce una riga
int insert(int r = -1, bool update_sheet = TRUE, bool call_notify = FALSE);
int insert(int r = -1, bool update_sheet = true, bool call_notify = false);
// @cmember Forza l'aggiornamento dei dati della riga sullo schermo
void force_update(int r = -1);
@ -188,13 +189,13 @@ public:
// @cmember Trasforma l'identificatore di un campo <p cid> in un numero di colonna logica
int cid2index(short cid) const;
// @cmember Abilita/disabilita una colonna dello spreadsheet (vedi <mf TSpreadsheet::enable_column>)
void enable_column(int col, bool on = TRUE);
void enable_column(int col, bool on = true);
// @cmember Abilita/disabilita una cella dello spreadsheet (vedi <mf TSpreadsheet::enable_cell>)
void enable_cell(int row, int column, bool on = TRUE);
void enable_cell(int row, int column, bool on = true);
// @cmember Disabilta una cella dello spreadsheet (chiama <mf TSheet_field::enable>)
void disable_cell(int row, int column)
{ enable_cell(row, column, FALSE); }
{ enable_cell(row, column, false); }
// @cmember Controlla se una cella e' disabilitata (vedi <mf TSpreadsheet::cell_disabled>)
bool cell_disabled(int row, int column) const;
// @cmember Controlla se una cella e' disabilitata (vedi <mf TSpreadsheet::cell_disabled>)
@ -216,10 +217,10 @@ public:
void swap_columns(const int fromid, const int toid) const;
// @cmember Abilita/disabilita una riga dello spreadsheet (vedi <mf TSpreadsheet::enable_cell>)
void enable_row(int row, bool on = TRUE);
void enable_row(int row, bool on = true);
// @cmember Disabilta una riga dello spreadsheet (chiama <mf TSheet_field::enable>)
void disable_row(int row)
{ enable_row(row, FALSE); }
{ enable_row(row, false); }
// @cmember Controlla se una riga e' disabilitata (tutte le sue celle sono disabilitate)
bool row_enabled(int row);
// @cmember Permette di invertire la posizione di due righe
@ -252,7 +253,7 @@ public:
// @cmember Dispone le colonne come all'atto del caricamento
void reset_columns_order();
// @cmember Setta il member <p _append> con il valore di <p on>
void set_append(bool on = TRUE)
void set_append(bool on = true)
{ _append = on;}
// @cmember Ritorna il valore del membro <p _append>
bool append() const

View File

@ -677,14 +677,14 @@ bool list_custom_files(const char* ext, const char* library, TString_array& file
stringona.cut(0);
for (int i = 0; i < 3 && scan.good(); i++) // Leggo solo le prime righe
stringona << scan.line();
get_xml_attr(stringona, "libraries", libraries);
get_xml_child(stringona, "description", desc);
get_xml_attr(stringona, "libraries", libraries);
if (library && *library)
ok = libraries.get_pos(library) >= 0;
if (ok)
{
get_xml_child(stringona, "description", desc);
TToken_string* riga = new TToken_string;
riga->add(*row);
riga->add(desc);

View File

@ -46,6 +46,7 @@ public: // Absolutely needed methods
virtual bool move_to(TRecnotype pos) pure;
virtual TRecnotype current_row() const pure;
virtual void requery() pure;
bool empty() const { return items() == 0; }
virtual bool move_first() { return move_to(0); }
virtual bool move_prev() { return move_to(current_row()-1); }
@ -69,7 +70,6 @@ public: // Absolutely needed methods
virtual const TToken_string& sheet_head() const;
virtual bool save_as(const char* path, TRecordsetExportFormat fmt = fmt_unknown);
void set_parent(const TRecordset* rs) { _parentset = rs; }
TRecordset();
virtual ~TRecordset() { }

View File

@ -2018,7 +2018,7 @@ bool TReport::evaluate(const char* expr, TVariant& var, TFieldtypes force_type)
const bool ok = get_usr_val(name, var);
if (!ok)
var = name;
if (var.is_string())
if (var.is_string() || var.is_null())
e.setvar(i, var.as_string());
else
{

View File

@ -219,7 +219,7 @@ public:
void hide() { show(false); }
bool deactivated() const { return _deactivated; }
bool active() const { return !deactivated(); }
void activate(bool on) { _deactivated = !on; }
void activate(bool on = true) { _deactivated = !on; }
void deactivate() { activate(false); }
const TString& prescript() const;

View File

@ -243,11 +243,14 @@ public:
PNT TPrint_preview_window::log2dev(long lx, long ly) const
{
const TPoint res = _book->page_res();
PNT pnt = { lx, ly };
PNT pnt;
const TPoint res = _book->page_res();
if (res.x > 0 && res.y > 0) // Should always be true :-)
{
pnt.h = short(lx * _zoom / res.x);
pnt.v = short(ly * _zoom / res.y);
}
const TPoint orig = origin();
pnt.h -= short(orig.x);
@ -258,16 +261,19 @@ PNT TPrint_preview_window::log2dev(long lx, long ly) const
void TPrint_preview_window::update_scroll_range()
{
const TPoint size = _book->page_size();
const TPoint res = _book->page_res();
PNT pnt = { 0, 0 };
PNT pnt;
const TPoint res = _book->page_res();
if (res.x > 0 && res.y > 0) // Should always be true :-)
{
const TPoint size = _book->page_size();
pnt.h = short(size.x * _zoom / res.x);
pnt.v = short(size.y * _zoom / res.y);
RCT rct; xvt_vobj_get_client_rect(win(), &rct);
pnt.h -= rct.right; if (pnt.h < 0) pnt.h = 0;
pnt.v -= rct.bottom; if (pnt.v < 0) pnt.v = 0;
}
update_thumb(0, 0);
set_scroll_max(pnt.h, pnt.v);
@ -1600,7 +1606,7 @@ long TReport_book::print_section(TReport_section& rs)
rs.load_fields();
// Non sono sicuro se vada prima di load_fields o dopo execute_prescript
if (rs.condition().not_empty())
if (!rs.condition().blank())
{
TVariant var;
_report->evaluate(rs.condition(), var, _nullfld);

View File

@ -165,7 +165,9 @@ bool TVariant::as_string(TString& tmp) const
const TString& TVariant::as_string() const
{
if (_type == _alfafld)
return *(TString*)_ptr;
return *(TString*)_ptr; else
if (_type == _nullfld)
return EMPTY_STRING;
TString& tmp = get_tmp_string();
as_string(tmp);
return tmp;
@ -198,8 +200,14 @@ void TVariant::copy(const TVariant& var)
}
}
bool TVariant::is_kind_of(word cid) const
{
return cid == CLASS_VARIANT || TSortable::is_kind_of(cid);
}
int TVariant::compare(const TSortable& s) const
{
CHECK(s.is_kind_of(CLASS_VARIANT), "Illegal Variant comparison");
const TVariant& var = (const TVariant&)s;
int cmp = 0;
switch (_type)
@ -261,7 +269,7 @@ TVariant& TVariant::sub(const TVariant& var)
TVariant& TVariant_stack::peek(int depth)
{
const int sp = _sp-depth-1;
return sp >= 0 ? (TVariant&)_var[sp] : (TVariant &)NULL_VARIANT;
return (sp >= 0 && sp < _var.items()) ? (TVariant&)_var[sp] : (TVariant &)NULL_VARIANT;
}
bool TVariant_stack::drop()

View File

@ -24,6 +24,8 @@ class TVariant : public TSortable
protected:
virtual TObject* dup() const { return new TVariant(*this); }
virtual word class_id() const { return CLASS_VARIANT; }
virtual bool is_kind_of(word cid) const;
void copy(const TVariant& var);
public:
@ -80,6 +82,7 @@ class TVariant_stack : public TObject
public:
int items() const { return _sp; }
bool empty() const { return _sp <= 0; }
bool drop();
TVariant& pop();
TVariant& peek(int depth = 0);

View File

@ -41,11 +41,11 @@ public:
// @cmember Duplica il campo
virtual TObject* dup() const;
// @cmember segnala che il campo deve essere ricalcolato
virtual bool dirty() const { return TRUE;}
virtual bool dirty() const { return true;}
// @cmember assegna lo stato di campo da ricalcolare
virtual void set_dirty(bool on = TRUE) {}
virtual void set_dirty(bool on = true) {}
// @cmember assegna lo stato di campo da non ricalcolare
void set_clean() { set_dirty(FALSE);}
void set_clean() { set_dirty(false);}
// @cmember assegna il record a cui appartiene il campo
virtual void set_rec(TVariable_rectype * rec) { _rec = rec;}