Subversion Repositories svn1-original

Rev

Rev 363 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 363 Rev 374
Line 39... Line 39...
39
int         print_line = 0;                      /* Current print line */
39
int         print_line = 0;                      /* Current print line */
40
int         print_underline_start;               /* Start of underline */
40
int         print_underline_start;               /* Start of underline */
41
int         print_underline_end;                 /* End of underline */
41
int         print_underline_end;                 /* End of underline */
42
long        print_current_colour;                /* Current printing colour */
42
long        print_current_colour;                /* Current printing colour */
43
QString     printFileName;                       /* Last printer file opened */
43
QString     printFileName;                       /* Last printer file opened */
-
 
44
char        print_href[200];                     /* Current HREF string */
44
 
45
 
45
/*========================================================================
46
/*========================================================================
46
 *
47
 *
47
 *  Open the printer
48
 *  Open the printer
48
 *
49
 *
Line 265... Line 266...
265
 
266
 
266
    va_start( ap, format );
267
    va_start( ap, format );
267
    len = vsprintf( pp, format, ap );
268
    len = vsprintf( pp, format, ap );
268
    va_end( ap );
269
    va_end( ap );
269
 
270
 
-
 
271
 
270
    /*
272
    /*
271
    **  Detect the end of a line and flag for later processing
273
    **  Detect the end of a line and flag for later processing
272
    */
274
    */
273
    if ( len > 0 && pp[len - 1] == '\n' )
275
    if ( len > 0 && pp[len - 1] == '\n' )
274
    {
276
    {
275
        len--;
277
        len--;
276
        eol = TRUE;
278
        eol = TRUE;
277
    }
279
    }
278
 
280
 
-
 
281
    //  Insert pre-set HTML HREF into the string
-
 
282
    if (print_html && *print_href) {
-
 
283
        int iStart = 0;
-
 
284
        int iEnd = len;
-
 
285
        char *debugPtr = pp;
-
 
286
 
-
 
287
        for (int ii = 0; ii < len; ii++) {
-
 
288
            if (pp[ii] != ' ') {
-
 
289
                iStart = ii;
-
 
290
                break;
-
 
291
            }
-
 
292
        }
-
 
293
 
-
 
294
        for (int ii = len-1; ii >= iStart; ii--) {
-
 
295
            if (pp[ii] != ' ') {
-
 
296
                iEnd = ii + 1;
-
 
297
                break;
-
 
298
            }
-
 
299
        }
-
 
300
 debugPtr = print_href;
-
 
301
 
-
 
302
        strncat(print_href, &pp[iStart], iEnd - iStart);
-
 
303
        strcat(print_href, "</A>");
-
 
304
        strncat(print_href, &pp[iEnd], len - iEnd );
-
 
305
        strcpy(&pp[iStart], print_href);
-
 
306
        len = strlen(pp);
-
 
307
 
-
 
308
    }
-
 
309
    *print_href = 0;
-
 
310
 
-
 
311
 
279
    if ( len )
312
    if ( len )
280
    {
313
    {
281
        fwrite( pp, 1, len, pfile );
314
        fwrite( pp, 1, len, pfile );
282
        print_col += len;
315
        print_col += len;
283
    }
316
    }
Line 730... Line 763...
730
    va_end( ap );
763
    va_end( ap );
731
 
764
 
732
    return ( pp );
765
    return ( pp );
733
}
766
}
734
 
767
 
-
 
768
/*========================================================================
-
 
769
 *
-
 
770
 *  Set HTML HREF to be used in the next print
-
 
771
 *
-
 
772
 *  Purpose:
-
 
773
 *      Create and save a printf like string so that it will be used
-
 
774
 *      to create an HTML HREF
-
 
775
 *
-
 
776
 *      Down-side. Can only have one at a time
-
 
777
 *                 Only valid for the next print
-
 
778
 *                 Strings have a limited length
-
 
779
 *
-
 
780
 *  Parameters:
-
 
781
 *      Standard printf type parameters
-
 
782
 *
-
 
783
 *  Returns:
-
 
784
 *      TRUE : Operation was succesful
-
 
785
 *
-
 
786
 *========================================================================*/
-
 
787
 
-
 
788
char *setHref( const char *format, ... )
-
 
789
{
-
 
790
    va_list     ap;
-
 
791
 
-
 
792
    *print_href = 0;
-
 
793
 
-
 
794
    va_start( ap, format );
-
 
795
    vsprintf( print_href, format, ap );
-
 
796
    va_end( ap );
-
 
797
 
-
 
798
    return ( print_href );
-
 
799
}
-
 
800
 
-
 
801
 
735
/*----------------------------------------------------------------------------
802
/*----------------------------------------------------------------------------
736
** FUNCTION           : to_hex
803
** FUNCTION           : to_hex
737
**
804
**
738
** DESCRIPTION        : Converts an integer value to its hex character
805
** DESCRIPTION        : Converts an integer value to its hex character
739
**
806
**