lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master d4dfaa9 075/156: Also use data directory for


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d4dfaa9 075/156: Also use data directory for image files referenced from HTML
Date: Tue, 30 Jan 2018 17:22:14 -0500 (EST)

branch: master
commit d4dfaa986f6c41292b4fd868748c661a071fec21
Author: Vadim Zeitlin <address@hidden>
Commit: Vadim Zeitlin <address@hidden>

    Also use data directory for image files referenced from HTML
    
    Look for the images such as company logo in the data directory instead
    of the current one too.
---
 pdf_writer_wx.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/pdf_writer_wx.cpp b/pdf_writer_wx.cpp
index ebed4ed..9b9b193 100644
--- a/pdf_writer_wx.cpp
+++ b/pdf_writer_wx.cpp
@@ -24,6 +24,7 @@
 #include "pdf_writer_wx.hpp"
 
 #include "alert.hpp"
+#include "global_settings.hpp"
 #include "html.hpp"
 
 #include <wx/filesys.h>
@@ -103,7 +104,14 @@ pdf_writer_wx::pdf_writer_wx
             ,"Courier"
             );
         }
+
+    // Create the virtual file system object for loading images referenced from
+    // HTML and interpret relative paths from the data directory.
     html_vfs_.reset(new wxFileSystem());
+    html_vfs_->ChangePathTo
+        (global_settings::instance().data_directory().string()
+        ,true /* argument is a directory, not file path */
+        );
     html_parser_.SetFS(html_vfs_.get());
 }
 



reply via email to

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