From 17b6eed9692e6856b265524d82a4f9fd7ee72c70 Mon Sep 17 00:00:00 2001 From: luca Date: Tue, 9 Oct 2007 10:51:14 +0000 Subject: [PATCH] Patch level :4.0 799 Files correlati :cg2.exe sc0.exe Ricompilazione Demo : [ ] Commento :riportate correzioni sul saldaconto dalla 3.1 git-svn-id: svn://10.65.10.50/trunk@15694 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- cg/cg2105.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/cg/cg2105.cpp b/cg/cg2105.cpp index 8a6bfc7d6..87322b3ba 100755 --- a/cg/cg2105.cpp +++ b/cg/cg2105.cpp @@ -1815,20 +1815,25 @@ static int sort_games_date(const TObject** o1, const TObject** o2) void TGame_mask::sort_partite() { TString_array& a = partite().rows_array(); - const int last = a.last(); - if (last > 1) + + // Elimina riga saldo se presente + int last = a.last(); + if (last > 0 && a.row(last).get_int(0) == 0) // Se l'anno dell'ultima riga e' nullo ... + a.destroy(last--); // ... elimina riga saldo + + // Ordina lista se necessario (ci sono almeno due partite) + if (last > 0) { - if (a.row(last).get_int(0) == 0) // Se non c'e' l'anno ... - a.destroy(last); // ... elimina riga saldo switch (get(P_SORT)[0]) { case 'N': a.TArray::sort(sort_games_num); break; // Ordine numerico case 'D': a.TArray::sort(sort_games_date); break; // Ordine per data default : a.sort(); break; // Ordine alfabetico } - update_saldo_clifo(); // Ricrea riga saldo - partite().force_update(); // Aggiorna lo spreadsheet + update_saldo_clifo(); // Ricrea riga saldo } + + partite().force_update(); // Aggiorna lo spreadsheet } void TGame_mask::fill_partite() @@ -1854,7 +1859,7 @@ void TGame_mask::fill_partite() bool u = (k.tipo() > ' ' && k.sottoconto() == conto().sottoconto()) || k == conto(); if (u && !all && gioco->chiusa() && gioco->mov2rig(_numreg, _numrig) <= 0) - u = FALSE; + u = false; if (u) update_partita(*gioco, -1); @@ -1895,7 +1900,7 @@ void TGame_mask::fill_partite() sort_partite(); aggiorna_residuo(); - if (a.items() > 1) + if (!a.empty()) { _riga_partite = -1;