Ignore:
Timestamp:
Sep 15, 2006, 5:39:39 PM (14 years ago)
Author:
Eugene Romanenko
Message:

allow printing in descending order (closes #88), small interface fixes (closes #89)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Lucide/SOURCE/gui/print.cpp

    r102 r123  
    169169    DevEscape( hdcPrinter, DEVESC_STARTDOC, strlen(title), (PBYTE)title, NULL, NULL );
    170170
    171     long totalpages = psetup->pgto - psetup->pgfrom + 1;
    172     for ( long pg = psetup->pgfrom; pg <= psetup->pgto; pg++ )
     171
     172    long totalpages = abs( psetup->pgto - psetup->pgfrom ) + 1;
     173    long pg = psetup->pgfrom;
     174    for ( long i = 0; i < totalpages; i++ )
    173175    {
    174176        char *fmt = newstrdupL( PRINT_PRINTING_PAGE_OF );
    175177        char *buf = new char[ 255 ];
    176         snprintf( buf, 255, fmt, pg, totalpages );
     178        snprintf( buf, 255, fmt, pg, i + 1, totalpages );
    177179        progressDlg->setText( buf );
    178180        delete fmt;
     
    188190            break;
    189191        }
     192
     193        pg += ( psetup->pgfrom <= psetup->pgto ) ? 1 : -1;
    190194    }
    191195
     
    310314
    311315    boolean rcexp = doc->exportToPostScript( ev, tmpps, psetup->pgfrom-1, psetup->pgto-1,
    312                                              pwidth, pheight, false, &abortPrinting );
     316                                             pwidth, pheight, &abortPrinting );
    313317
    314318    if ( abortPrinting ) {
Note: See TracChangeset for help on using the changeset viewer.