diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 9398a48b6e..6b1b0fdd72 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -66,7 +66,8 @@ class WXDLLIMPEXP_CORE wxSVGFileDCImpl : public wxDCImpl { public: wxSVGFileDCImpl( wxSVGFileDC *owner, const wxString &filename, - int width=320, int height=240, double dpi=72.0 ); + int width = 320, int height = 240, double dpi = 72.0, + const wxString &title = wxString() ); virtual ~wxSVGFileDCImpl(); @@ -214,7 +215,8 @@ private: virtual wxSize GetPPI() const wxOVERRIDE; - void Init (const wxString &filename, int width, int height, double dpi); + void Init (const wxString &filename, int width, int height, + double dpi, const wxString &title); void write( const wxString &s ); @@ -254,8 +256,9 @@ public: wxSVGFileDC(const wxString& filename, int width = 320, int height = 240, - double dpi = 72.0) - : wxDC(new wxSVGFileDCImpl(this, filename, width, height, dpi)) + double dpi = 72.0, + const wxString& title = wxString()) + : wxDC(new wxSVGFileDCImpl(this, filename, width, height, dpi, title)) { } diff --git a/interface/wx/dcsvg.h b/interface/wx/dcsvg.h index f28c81af29..7ae2f84523 100644 --- a/interface/wx/dcsvg.h +++ b/interface/wx/dcsvg.h @@ -40,9 +40,11 @@ class wxSVGFileDC : public wxDC public: /** Initializes a wxSVGFileDC with the given @a f filename with the given - @a Width and @a Height at @a dpi resolution. + @a Width and @a Height at @a dpi resolution, and an optional @a title. + The title provides a readable name for the SVG document. */ - wxSVGFileDC(const wxString& filename, int width = 320, int height = 240, double dpi = 72); + wxSVGFileDC(const wxString& filename, int width = 320, int height = 240, + double dpi = 72, const wxString& title = wxString()); /** Destructor. diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 925fa52a7a..c35129be85 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -378,13 +378,14 @@ void wxSVGFileDC::SetBitmapHandler(wxSVGBitmapHandler* handler) wxIMPLEMENT_ABSTRACT_CLASS(wxSVGFileDCImpl, wxDC); wxSVGFileDCImpl::wxSVGFileDCImpl( wxSVGFileDC *owner, const wxString &filename, - int width, int height, double dpi ) : + int width, int height, double dpi, const wxString &title ) : wxDCImpl( owner ) { - Init( filename, width, height, dpi ); + Init( filename, width, height, dpi, title ); } -void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, double dpi) +void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, + double dpi, const wxString &title) { m_width = Width; m_height = Height; @@ -430,9 +431,9 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, dou write(s); s.Printf( wxT(" width=\"%scm\" height=\"%scm\" viewBox=\"0 0 %d %d \">\n"), NumStr(float(Width)/dpi*2.54), NumStr(float(Height)/dpi*2.54), Width, Height ); write(s); - s = wxT("SVG Picture created as ") + wxFileName(filename).GetFullName() + wxT(" \n"); + s = wxT("") + title + wxT("\n"); write(s); - s = wxString (wxT("Picture generated by wxSVG ")) + wxSVGVersion + wxT(" \n"); + s = wxString (wxT("Picture generated by wxSVG ")) + wxSVGVersion + wxT("\n"); write(s); s = wxT("\n"); write(s);