Corretti errori nel posizionamento dopo i codici di colore

e nella formattazione dei long ????


git-svn-id: svn://10.65.10.50/trunk@84 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
alex 1994-08-29 11:04:37 +00:00
parent 053739a3f7
commit 833e3df2ef

View File

@ -1,4 +1,4 @@
// $Id: printapp.cpp,v 1.3 1994-08-18 07:43:44 villa Exp $ // $Id: printapp.cpp,v 1.4 1994-08-29 11:04:37 alex Exp $
#include <ctype.h> #include <ctype.h>
#include <stdarg.h> #include <stdarg.h>
@ -699,15 +699,15 @@ set_row (int r, const char *frmt,...)
case 'o': case 'o':
case 'x': case 'x':
case 'X': case 'X':
q.format (t, islong ? va_arg (params, int) : q.format (t, islong ? va_arg (params, long) :
va_arg (params, long)); va_arg (params, int));
break; break;
case 'f': case 'f':
case 'e': case 'e':
case 'E': case 'E':
case 'G': case 'G':
q.format (t, islong ? va_arg (params, float) : q.format (t, islong ? va_arg (params, double) :
va_arg (params, double)); va_arg (params, float));
break; break;
case 'c': case 'c':
q.format (t, va_arg (params, char)); q.format (t, va_arg (params, char));
@ -1097,9 +1097,24 @@ print_one (int file)
TString v = pt->_val; TString v = pt->_val;
((TPrintrow *) (&rw[pt->row ()]))->put (v, pos[pt->row ()]); ((TPrintrow *) (&rw[pt->row ()]))->put (v, pos[pt->row ()]);
if (pos[pt->row ()] != -1) if (pos[pt->row ()] != -1)
{
pos[pt->row ()] += v.len (); pos[pt->row ()] += v.len ();
const char * s = v;
while (*s && strncmp(s, "$[", 2) == 0)
{
while (*s && *s != ']')
{
pos[pt->row()]--;
s++;
} }
else if (t->tag () == 2) if (*s)
pos[pt->row()]--;
while (*s && *s != '$') s++;
}
}
}
else
if (t->tag () == 2)
{ {
// printf by reference // printf by reference
_PrintfRef *pr = (_PrintfRef *) t; _PrintfRef *pr = (_PrintfRef *) t;
@ -1113,13 +1128,13 @@ print_one (int file)
case 'o': case 'o':
case 'x': case 'x':
case 'X': case 'X':
ps.format (pr->_fmt, islong ? *((int *) (pr->_what)) : ps.format (pr->_fmt, islong ? *((long *) (pr->_what)) :
*((long *) (pr->_what))); *((int *) (pr->_what)));
break; break;
case 'f': case 'f':
case 'e': case 'e':
ps.format (pr->_fmt, islong ? *((float *) (pr->_what)) : ps.format (pr->_fmt, islong ? *((double *) (pr->_what)) :
*((double *) (pr->_what))); *((float *) (pr->_what)));
break; break;
case 'c': case 'c':
ps.format (pr->_fmt, *((char *) (pr->_what))); ps.format (pr->_fmt, *((char *) (pr->_what)));