lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master db6278e 2/2: Conditionally suppress old or ne


From: Greg Chicares
Subject: [lmi-commits] [lmi] master db6278e 2/2: Conditionally suppress old or new PDF code
Date: Fri, 2 Feb 2018 07:32:31 -0500 (EST)

branch: master
commit db6278edd5525acda4b8ba911ff02763a83a45b5
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Conditionally suppress old or new PDF code
    
    Added temporary options only for testing with '--ash_nazg':
      '--pyx=only_new_pdf': skip old code
      '--pyx=only_old_pdf': skip new code
      both those options together: demons fly out your nose
---
 ledger_pdf.cpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/ledger_pdf.cpp b/ledger_pdf.cpp
index ec90ad3..11efd81 100644
--- a/ledger_pdf.cpp
+++ b/ledger_pdf.cpp
@@ -24,6 +24,7 @@
 #include "ledger_pdf.hpp"
 
 #include "configurable_settings.hpp"
+#include "contains.hpp" // PDF !! expunge
 #include "global_settings.hpp" // PDF !! expunge
 #include "ledger.hpp"
 #include "ledger_pdf_generator.hpp"
@@ -37,13 +38,17 @@
 std::string write_ledger_as_pdf(Ledger const& ledger, fs::path const& filepath)
 {
     // PDF !! Expunge this conditional block:
-    if(global_settings::instance().ash_nazg())
+    if
+        (global_settings::instance().ash_nazg()
+        && !contains(global_settings::instance().pyx(), "only_new_pdf")
+        )
         {
+        std::string z;
         try
             {
             // Execute both the new and the old code so that their results
             // may be compared.
-            write_ledger_as_pdf_via_xsl(ledger, filepath);
+            z = write_ledger_as_pdf_via_xsl(ledger, filepath);
             }
         // The developer-only password having been specified, show
         // diagnostics only on the console, and don't let them escape
@@ -57,6 +62,8 @@ std::string write_ledger_as_pdf(Ledger const& ledger, 
fs::path const& filepath)
             {
             throw;
             }
+        if(contains(global_settings::instance().pyx(), "only_old_pdf"))
+            return z;
         }
 
     throw_if_interdicted(ledger);



reply via email to

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