lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Group premium quotes--setting PDF file name


From: Vadim Zeitlin
Subject: Re: [lmi] Group premium quotes--setting PDF file name
Date: Tue, 18 Aug 2015 23:22:29 +0200

On Mon, 17 Aug 2015 14:37:36 +0000 Greg Chicares <address@hidden> wrote:

GC> This comment is interesting:
GC> 
GC> void group_premium_pdf_generator_wx::save(
GC> ...
GC>     // This is pretty baroque: to specify the name of the file after wxPdfDC
GC>     // creation, we need to poke print data stored inside it.
GC>     wxPdfDCImpl* const impl = dynamic_cast<wxPdfDCImpl*>(pdf_dc.GetImpl());
GC>     LMI_ASSERT(impl);
GC> 
GC>     impl->GetPrintData().SetFilename(output_filename);
GC> 
GC> This save() function is called only by ledger_emitter::finish(), which
GC> supplies 'output_filename'. But ledger_emitter::initiate() assembles the
GC> same filename string:
GC>   case_filepath_.string() + ".quote.pdf"
GC> so it would seem natural to pass it there to
GC>   group_premium_pdf_generator::create()
GC> But I'm sure I'm missing something, which I just want to understand.

 Sorry, no, you're not missing anything, this is just a leftover from an
earlier version in which things had been done differently and I collapsed
them together while updating my pending changes to match your changes to
emit_ledger.cpp but forgot to remove/simplify this part. With the current
approach we just need to call print_data.SetFilename(output_filename) at
the start of the function before creating wxPdfDC and remove this ugly
workaround.

 Thanks for noticing this and sorry for missing it myself,
VZ

reply via email to

[Prev in Thread] Current Thread [Next in Thread]