[q-lang-cvs] qcalc qcalc.q,1.177,1.178
Brought to you by:
agraef
From: Albert G. <ag...@us...> - 2007-11-23 18:21:41
|
Update of /cvsroot/q-lang/qcalc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27013 Modified Files: qcalc.q Log Message: proper formatting of spanned cells when printing Index: qcalc.q =================================================================== RCS file: /cvsroot/q-lang/qcalc/qcalc.q,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** qcalc.q 23 Nov 2007 12:50:53 -0000 1.177 --- qcalc.q 23 Nov 2007 18:21:38 -0000 1.178 *************** *** 1145,1148 **** --- 1145,1151 ---- = true otherwise; + is_modified (I,J) + = not is_empty (I,J) or else is_spanned (I,J); + is_gui_elem IT:QtObject = eq () X or else is_qt_object X *************** *** 1928,1932 **** J2 = foldl1 max $ map snd W if not null W ! where W = filter (neg is_empty) $ keys $ get CELLS; = () otherwise; --- 1931,1935 ---- J2 = foldl1 max $ map snd W if not null W ! where W = filter is_modified $ keys $ get CELLS; = () otherwise; *************** *** 2061,2065 **** add_recent_file $ get FILENAME || statusmsg "Done" ! where KEYS = filter must_save $ keys $ get CELLS, SPANS = filter is_spanned KEYS, SPANS = zip SPANS $ map cell_span SPANS, --- 2064,2068 ---- add_recent_file $ get FILENAME || statusmsg "Done" ! where KEYS = filter is_modified $ keys $ get CELLS, SPANS = filter is_spanned KEYS, SPANS = zip SPANS $ map cell_span SPANS, *************** *** 2084,2089 **** htmlquote $ get FILENAME; - must_save (I,J) = not is_empty (I,J) or else is_spanned (I,J); - indexcmp (I1,J1) (I2,J2) = (I1<I2) or else (I1=I2) and then (J1<J2); --- 2087,2090 ---- *************** *** 2486,2490 **** // data row [format_cell OPT_CELLS (I,J) : ! J in [J1..J2]] : I in [I1..I2]]; format_cell OPT_CELLS (I,J) --- 2487,2492 ---- // data row [format_cell OPT_CELLS (I,J) : ! J in [J1..J2], real_index (I,J) = (I,J)] : ! I in [I1..I2]]; format_cell OPT_CELLS (I,J) *************** *** 2496,2515 **** S = if (OPT_CELLS and 1<>0) or else null F or else FLAG then sel_cval (I,J) ! else "": = if null F then ! sprintf "<td align=right>%s</td>" $ htmlquote S else ! sprintf "<td><p align=right>%s</p><p><i>%s</i></p></td>" $ ! tuple $ map htmlquote [S,F] if checknum 'X where 'X = valq S; ! = sprintf "<td><img src=\"%s\"> <i>%s</i></td>" ! (htmlquote $ which "pixmaps/flag.png",htmlquote S) if FLAG; = if #L<=1 then ! sprintf "<td>%s</td>" ! (if not null F then sprintf "<i>%s</i>" (hd L) else strcat L) else ! sprintf "<td><p>%s</p><p><i>%s</i></p></td>" $ ! tuple L where L = map htmlquote $ filter (neg null) [S,F]; --- 2498,2524 ---- S = if (OPT_CELLS and 1<>0) or else null F or else FLAG then sel_cval (I,J) ! else "", ! (N,M) = cell_span (I,J), ! SP = if (N>1) or else (M>1) then ! [sprintf "colspan=%d" M,sprintf "rowspan=%d" N] ! else []: = if null F then ! sprintf "<td %s>%s</td>" ! (join " " ["align=right"|SP],htmlquote S) else ! sprintf "<td %s><p align=right>%s</p><p><i>%s</i></p></td>" ! (tuple [join " " SP|map htmlquote [S,F]]) if checknum 'X where 'X = valq S; ! = sprintf "<td %s><img src=\"%s\"> <i>%s</i></td>" ! (join " " SP,htmlquote $ which "pixmaps/flag.png", ! htmlquote S) if FLAG; = if #L<=1 then ! sprintf "<td %s>%s</td>" ! (join " " SP, ! if not null F then sprintf "<i>%s</i>" (hd L) else strcat L) else ! sprintf "<td %s><p>%s</p><p><i>%s</i></p></td>" ! (tuple [join " " SP|L]) where L = map htmlquote $ filter (neg null) [S,F]; |