[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 6586cab 1/9: Simplify
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 6586cab 1/9: Simplify |
Date: |
Wed, 4 Apr 2018 21:27:37 -0400 (EDT) |
branch: master
commit 6586cab0da80b02ca3ae8e31e03fcf05b30eda9e
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Simplify
See discussion beginning here:
https://lists.nongnu.org/archive/html/lmi/2018-04/msg00002.html
Incidentally, simplified the alarum() statement: it isn't necessary to
name the unsupported ledger type here. Reason: unsupported ledger types
are diagnosed upstream when the Ledger object is constructed (so this
alarum() statement is actually unreachable).
---
ledger_pdf_generator_wx.cpp | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 21aa230..c207c45 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -2923,31 +2923,26 @@ void ledger_pdf_generator_wx::write
{
wxBusyCursor reverie;
- std::unique_ptr<pdf_illustration> pdf_ill;
-
- auto const z = ledger.ledger_type();
- switch(z)
+ switch(ledger.ledger_type())
{
case mce_ill_reg:
- pdf_ill = std::make_unique<pdf_illustration_regular>(ledger);
+ pdf_illustration_regular (ledger).render_all(output);
break;
case mce_nasd:
- pdf_ill = std::make_unique<pdf_illustration_nasd>(ledger);
+ pdf_illustration_nasd (ledger).render_all(output);
break;
case mce_group_private_placement:
- pdf_ill = std::make_unique<pdf_illustration_reg_d_group>(ledger);
+ pdf_illustration_reg_d_group (ledger).render_all(output);
break;
case mce_individual_private_placement:
- pdf_ill =
std::make_unique<pdf_illustration_reg_d_individual>(ledger);
+ pdf_illustration_reg_d_individual(ledger).render_all(output);
break;
case mce_prospectus_obsolete: // fall through
case mce_offshore_private_placement_obsolete: // fall through
case mce_ill_reg_private_placement_obsolete: // fall through
case mce_variable_annuity_obsolete:
- alarum() << "Unsupported ledger type '" << z << "'." << LMI_FLUSH;
+ alarum() << "Unsupported ledger type." << LMI_FLUSH;
}
-
- pdf_ill->render_all(output);
}
volatile bool ensure_setup = ledger_pdf_generator::set_creator
- [lmi-commits] [lmi] master updated (d9f9215 -> f4580cf), Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 035e5a0 2/9: Simplify, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master afdbbeb 6/9: Consolidate commentary, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 38df10a 4/9: Simplify diagnostics, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 6586cab 1/9: Simplify,
Greg Chicares <=
- [lmi-commits] [lmi] master ecd1362 3/9: Shorten diagnostics, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 783f4dd 5/9: Consolidate and revise documentation, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master f4580cf 9/9: Don't ref-qualify save(), Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master 5d225f5 7/9: Move commentary to point of member-function definition, Greg Chicares, 2018/04/04
- [lmi-commits] [lmi] master f5651d1 8/9: Prevent save() from being called twice, Greg Chicares, 2018/04/04