lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 956e5ce 3/4: Load images uniformly


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 956e5ce 3/4: Load images uniformly
Date: Thu, 9 Aug 2018 11:26:00 -0400 (EDT)

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

    Load images uniformly
    
    Resolved an observed problem:
      https://lists.nongnu.org/archive/html/lmi/2018-08/msg00011.html
    by handling images uniformly.
---
 ledger_pdf_generator_wx.cpp | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index 67787e0..e224ad4 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -29,6 +29,7 @@
 #include "data_directory.hpp"           // AddDataDir()
 #include "force_linking.hpp"
 #include "html.hpp"
+#include "icon_monger.hpp"              // load_image()
 #include "interpolate_string.hpp"
 #include "istream_to_string.hpp"
 #include "ledger.hpp"
@@ -43,8 +44,6 @@
 
 #include <wx/pdfdc.h>
 
-#include <wx/image.h>
-#include <wx/log.h>
 #include <wx/utils.h>                   // wxBusyCursor
 
 #include <wx/html/m_templ.h>
@@ -603,14 +602,7 @@ TAG_HANDLER_BEGIN(scaled_image, "IMG")
             scale_factor = 1.0 / inv_factor;
             }
 
-        wxImage image;
-        // Disable error logging, we'll simply ignore the tag if the image is
-        // not present.
-            {
-            wxLogNull NoLog;
-            image.LoadFile(AddDataDir(src.ToStdString()));
-            }
-
+        wxImage image(load_image(src.c_str()));
         if (image.IsOk())
             {
             m_WParser->GetContainer()->InsertCell



reply via email to

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