Changeset ea69247 in git


Ignore:
Timestamp:
13/01/14 04:01:56 (6 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
70462c8
Parents:
179a57b
Message:

src/avenprcore.cc,src/printwx.cc: Don't bother looking up the
printer page setup info when exporting.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r179a57b rea69247  
     1Mon Jan 13 04:00:54 GMT 2014  Olly Betts <olly@survex.com>
     2
     3        * src/avenprcore.cc,src/printwx.cc: Don't bother looking up the
     4          printer page setup info when exporting.
     5
    16Wed Jan 08 04:50:10 GMT 2014  Olly Betts <olly@survex.com>
    27
  • src/avenprcore.cc

    r179a57b rea69247  
    11/* avenprcore.cc
    22 * Printer independent parts of Survex printer drivers
    3  * Copyright (C) 1993-2002,2004,2005,2006,2010,2011,2012,2013 Olly Betts
     3 * Copyright (C) 1993-2002,2004,2005,2006,2010,2011,2012,2013,2014 Olly Betts
    44 * Copyright (C) 2004 Philip Underwood
    55 *
     
    5656          pagesX(1), pagesY(1), pages(1), xOrg(0), yOrg(0), footer()
    5757{
    58     // Create a temporary wxPrinterDC/wxPostScriptDC so we can get access to
    59     // the size of the printable area in mm to allow us to calculate how many
    60     // pages will be needed.
     58    if (data) {
     59        // Printing.
     60
     61        // Create a temporary wxPrinterDC/wxPostScriptDC so we can get access
     62        // to the size of the printable area in mm to allow us to calculate how
     63        // many pages will be needed.
    6164#if defined __WXMSW__ || defined __WXMAC__
    62     wxPrinterDC pdc(data->GetPrintData());
     65        wxPrinterDC pdc(data->GetPrintData());
    6366#else
    64     wxPostScriptDC pdc(data->GetPrintData());
    65 #endif
    66     int width, depth;
    67     pdc.GetSizeMM(&width, &depth);
    68     width -= data->GetMarginBottomRight().x + data->GetMarginTopLeft().x;
    69     PaperWidth = width;
    70     depth -= data->GetMarginBottomRight().y + data->GetMarginTopLeft().y;
    71     // Allow for the 10mm footer.
    72     PaperDepth = depth - 10;
     67        wxPostScriptDC pdc(data->GetPrintData());
     68#endif
     69        int width, depth;
     70        pdc.GetSizeMM(&width, &depth);
     71        width -= data->GetMarginBottomRight().x + data->GetMarginTopLeft().x;
     72        PaperWidth = width;
     73        depth -= data->GetMarginBottomRight().y + data->GetMarginTopLeft().y;
     74        // Allow for the 10mm footer.
     75        PaperDepth = depth - 10;
     76    } else {
     77        // Exporting.
     78        PaperWidth = PaperDepth = 0;
     79    }
    7380}
    7481
  • src/printwx.cc

    r179a57b rea69247  
    284284                         bool printing)
    285285        : wxDialog(mainfrm_, -1, wxString(printing ? wmsg(/*Print*/399) : wmsg(/*Export*/383))),
    286           m_layout(wxGetApp().GetPageSetupDialogData()),
     286          m_layout(printing ? wxGetApp().GetPageSetupDialogData() : NULL),
    287287          m_File(filename), mainfrm(mainfrm_)
    288288{
Note: See TracChangeset for help on using the changeset viewer.