[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] gwc-no-xslfo aec2811 12/12: Enable old and new PDF i
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] gwc-no-xslfo aec2811 12/12: Enable old and new PDF implementations to coexist |
Date: |
Sat, 27 Jan 2018 04:23:34 -0500 (EST) |
branch: gwc-no-xslfo
commit aec28110bec274233151840ca2ef494a51a4ed84
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Enable old and new PDF implementations to coexist
Eventually the old implementation will be retired, and only the new
will survive. However, during a testing interregnum, the old remains
the production default, and the new is available only with the most
powerful password.
---
ledger_pdf.cpp | 12 ++++++++++++
ledger_xsl.cpp | 4 +++-
ledger_xsl.hpp | 2 +-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/ledger_pdf.cpp b/ledger_pdf.cpp
index 48b2a75..64e575f 100644
--- a/ledger_pdf.cpp
+++ b/ledger_pdf.cpp
@@ -24,17 +24,29 @@
#include "ledger_pdf.hpp"
#include "configurable_settings.hpp"
+#include "global_settings.hpp" // PDF !! expunge
#include "ledger.hpp"
#include "ledger_pdf_generator.hpp"
+#include "ledger_xsl.hpp" // PDF !! expunge
#include "path_utility.hpp"
/// Write ledger as pdf.
std::string write_ledger_as_pdf(Ledger const& ledger, fs::path const& filepath)
{
+ // PDF !! Expunge this conditional block:
+ if(global_settings::instance().ash_nazg())
+ {
+ // Execute both the new and the old code so that their results
+ // may be compared.
+ write_ledger_as_pdf_via_xsl(ledger, filepath);
+ }
+
throw_if_interdicted(ledger);
fs::path print_dir(configurable_settings::instance().print_directory());
+ // PDF !! Either orthodox_filename() should be used here, or its
+ // use should be reconsidered everywhere else.
fs::path pdf_out_file = unique_filepath(print_dir / filepath, ".pdf");
auto const pdf = ledger_pdf_generator::create();
diff --git a/ledger_xsl.cpp b/ledger_xsl.cpp
index 7743940..ee008c4 100644
--- a/ledger_xsl.cpp
+++ b/ledger_xsl.cpp
@@ -94,11 +94,13 @@ fs::path xsl_filepath(Ledger const& ledger)
/// filenames must be transformed is that apache fop is java, and
/// java is "portable".
-std::string write_ledger_as_pdf(Ledger const& ledger, fs::path const& filepath)
+std::string write_ledger_as_pdf_via_xsl(Ledger const& ledger, fs::path const&
filepath)
{
throw_if_interdicted(ledger);
fs::path print_dir(configurable_settings::instance().print_directory());
+ // Old implementation: write to a distinctive subdirectory.
+ print_dir = print_dir / "old";
fs::path real_filepath(orthodox_filename(filepath.leaf()));
LMI_ASSERT(fs::portable_name(real_filepath.string()));
diff --git a/ledger_xsl.hpp b/ledger_xsl.hpp
index 31b30a4..22aee10 100644
--- a/ledger_xsl.hpp
+++ b/ledger_xsl.hpp
@@ -30,7 +30,7 @@
class Ledger;
-std::string write_ledger_as_pdf(Ledger const&, fs::path const&);
+std::string write_ledger_as_pdf_via_xsl(Ledger const&, fs::path const&);
fs::path xsl_filepath(Ledger const&);
- [lmi-commits] [lmi] gwc-no-xslfo updated (a78b402 -> aec2811), Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo 1f8c16d 02/12: Restore two deleted object files, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo 4a983d0 01/12: Import makefile changes verbatim from vz-no-xslfo, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo ec4fcc0 07/12: Restore vz-no-xslfo deletions, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo c216db3 05/12: Allow 'PDF !!' markers, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo 90d858b 10/12: Import 'emit_ledger.cpp' changes verbatim from vz-no-xslfo, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo adb7ff0 11/12: Restore a deleted header, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo 89df28a 06/12: Import 'ledger.hpp' changes verbatim from vz-no-xslfo, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo 88cc286 08/12: Import 'main_wx*.cpp' changes verbatim from vz-no-xslfo, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo f294831 09/12: Mark some deferred PDF issues, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo aec2811 12/12: Enable old and new PDF implementations to coexist,
Greg Chicares <=
- [lmi-commits] [lmi] gwc-no-xslfo 4fcbd32 03/12: Import 'wx_table_generator.?pp' changes verbatim from vz-no-xslfo, Greg Chicares, 2018/01/27
- [lmi-commits] [lmi] gwc-no-xslfo 28d5b17 04/12: Import 'group_quote_pdf_gen_wx.cpp' changes verbatim from vz-no-xslfo, Greg Chicares, 2018/01/27