Patch level :

Files correlati     : agalib
Ricompilazione Demo : [ ]
Commento            :
Nuovi tracciati per FE
Aggiunta possibilita'di spostare righe dello sheet coi relativi attributi


git-svn-id: svn://10.65.10.50/branches/R_10_00@22462 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
guy 2011-10-20 15:28:07 +00:00
parent e88723e1bb
commit 7439d8e351
5 changed files with 35 additions and 10 deletions

View File

@ -12,16 +12,13 @@ DEFFLD(TIPOCF)
DEFFLD(CODCF) DEFFLD(CODCF)
DEFFLD(OCFPI) DEFFLD(OCFPI)
// Key 3 = NUMREG
DEFFLD(NUMREG) // Can be null
// Flags // Flags
DEFFLD(FORZATURA) DEFFLD(FORZATURA)
DEFFLD(IGNORA) DEFFLD(IGNORA)
// Content fields // Content fields
DEFFLD(DATAREG) DEFFLD(DATAREG)
DEFFLD(NUMFATT) DEFFLD(NUMDOC)
DEFFLD(MODPAG) DEFFLD(MODPAG)
DEFFLD(IMPORTO) DEFFLD(IMPORTO)
DEFFLD(IMPOSTA) DEFFLD(IMPOSTA)

View File

@ -49,8 +49,8 @@
#define MOV_LIQDIFF "LIQDIFF" #define MOV_LIQDIFF "LIQDIFF"
#define MOV_MODPAG "MODPAG" #define MOV_MODPAG "MODPAG"
#define MOV_CONTRATTO "CONTRATTO" #define MOV_CONTRATTO "CONTRATTO"
#define MOV_DATAFATT "DATAFATT" #define MOV_DATARETT "DATARETT"
#define MOV_NUMFATT "NUMFATT" #define MOV_NUMRETT "NUMRETT"
#define MOV_ANNOFE "ANNOFE" #define MOV_ANNOFE "ANNOFE"
#define MOV_CONTSEP "CONTSEP" #define MOV_CONTSEP "CONTSEP"

View File

@ -316,6 +316,9 @@ public:
void swap_columns(const int fromid, const int toid) const; void swap_columns(const int fromid, const int toid) const;
// @cmember Permette di invertire la posizione di due righe // @cmember Permette di invertire la posizione di due righe
void swap_rows(const int fromindex, const int toindex); void swap_rows(const int fromindex, const int toindex);
// @cmember Sposta la riga fromindex alla posizione toindex
void move_row(const int fromindex, const int toindex);
// @cmember L'utente ha salvato la disposizione delle colonne? // @cmember L'utente ha salvato la disposizione delle colonne?
bool user_saved_columns_order() const; bool user_saved_columns_order() const;
@ -2226,10 +2229,28 @@ void TSpreadsheet::swap_columns(const int fromid, const int toid) const
void TSpreadsheet::swap_rows( const int fromindex, const int toindex) void TSpreadsheet::swap_rows( const int fromindex, const int toindex)
{ {
_str.swap(fromindex, toindex); if (fromindex != toindex)
_property.swap(fromindex, toindex); {
_str.swap(fromindex, toindex);
_property.swap(fromindex, toindex);
}
} }
void TSpreadsheet::move_row(const int fromindex, const int toindex)
{
if (fromindex != toindex)
{
TObject* r = _str.remove(fromindex);
_str.insert(r, toindex, true);
_str.pack();
TObject* p = _property.remove(fromindex);
_property.insert(p, toindex, true);
_property.pack();
}
}
int TSpreadsheet::set_line_number_width(int digits) int TSpreadsheet::set_line_number_width(int digits)
{ {
const int old = ROW_NUMBER_WIDTH; const int old = ROW_NUMBER_WIDTH;
@ -3026,6 +3047,12 @@ void TSheet_field::swap_rows( const int fromindex, const int toindex)
s->swap_rows(fromindex, toindex); s->swap_rows(fromindex, toindex);
} }
void TSheet_field::move_row(const int fromindex, const int toindex) const
{
TSpreadsheet* s = (TSpreadsheet*)_ctl;
s->move_row(fromindex, toindex);
}
static int default_rows_compare(TSheet_field &s, int i, int j) static int default_rows_compare(TSheet_field &s, int i, int j)
{ {
TToken_string &s1 = s.row(i); TToken_string &s1 = s.row(i);

View File

@ -231,7 +231,8 @@ public:
bool row_enabled(int row); bool row_enabled(int row);
// @cmember Permette di invertire la posizione di due righe // @cmember Permette di invertire la posizione di due righe
void swap_rows( const int fromindex, const int toindex ) ; void swap_rows( const int fromindex, const int toindex ) ;
void move_row(const int fromindex, const int toindex) const;
// @cmember Permette di ordinare le righe dello sheet // @cmember Permette di ordinare le righe dello sheet
void sort(ROWS_COMPARE_FUNCTION = NULL); void sort(ROWS_COMPARE_FUNCTION = NULL);

View File

@ -428,7 +428,7 @@ int TFile_info::close()
if (_ref_count > 0) if (_ref_count > 0)
{ {
_ref_count--; _ref_count--;
if (_ref_count == 0 || (_exclusive && _ref_count < 2)) if (_ref_count == 0 || _exclusive)
{ {
if (is_open()) if (is_open())
{ {