From e32721247a4e69d003b87695ade9e026b2d0c3fc Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Tue, 23 Apr 2019 21:20:02 +0200 Subject: [PATCH] Use wxFileName in wxSVGBitmapFileHandler constructor --- include/wx/dcsvg.h | 5 +++-- interface/wx/dcsvg.h | 9 ++++----- src/common/dcsvg.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 26631b4f90..2a64f8882c 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -12,6 +12,7 @@ #define _WX_DCSVG_H_ #include "wx/string.h" +#include "wx/filename.h" #include "wx/dc.h" #if wxUSE_SVG @@ -49,7 +50,7 @@ public: { } - explicit wxSVGBitmapFileHandler(const wxString& path) + explicit wxSVGBitmapFileHandler(const wxFileName& path) : m_path(path) { } @@ -59,7 +60,7 @@ public: wxOutputStream& stream) const wxOVERRIDE; private: - wxString m_path; // When set, will be appended with _image#.png + wxFileName m_path; // When set, name will be appended with _image#.png }; // Predefined handler which embeds the bitmap (base64-encoding it) inside the diff --git a/interface/wx/dcsvg.h b/interface/wx/dcsvg.h index 8c717a7701..f4d55e22a1 100644 --- a/interface/wx/dcsvg.h +++ b/interface/wx/dcsvg.h @@ -180,7 +180,7 @@ public: When using wxSVGFileDC::SetBitmapHandler() to set this handler with the default constructor, the PNG files are created in the runtime location of the application. The save location can be customized by using the - wxSVGBitmapFileHandler(const wxString&) constructor. + wxSVGBitmapFileHandler(const wxFileName&) constructor. @see wxSVGFileDC::SetBitmapHandler(). @@ -196,13 +196,12 @@ public: Create a wxSVGBitmapFileHandler and specify the location where the file will be saved. - @param path The path (with separator) of the save location. If - @a path contains a filename, the autogenerated filename will be - appended to this name. + @param path The path of the save location. If @a path contains a + filename, the autogenerated filename will be appended to this name. @since 3.1.3 */ - wxSVGBitmapFileHandler(const wxString& path); + wxSVGBitmapFileHandler(const wxFileName& path); virtual bool ProcessBitmap(const wxBitmap& bitmap, wxCoord x, wxCoord y, diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 0d4bd52bae..494f3a615c 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -335,7 +335,7 @@ wxSVGBitmapFileHandler::ProcessBitmap(const wxBitmap& bmp, wxImage::AddHandler(new wxPNGHandler); // find a suitable file name - wxFileName sPNG = wxFileName(m_path); + wxFileName sPNG = m_path; do { sPNG.SetFullName(wxString::Format("%s%simage%d.png",