From: Vadim Zeitlin Date: Wed, 24 Oct 2012 23:40:17 +0000 (+0000) Subject: No real changes, just avoid unnecessary string operations in wxSVGFileDCImpl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c84c7347ba63a08a8a9b426055b7be5a0aca2617 No real changes, just avoid unnecessary string operations in wxSVGFileDCImpl. Simply write string together instead of concatenating them during run-time. See #14462. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 446c3fc4bc..dcba364827 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -153,21 +153,21 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, dou m_filename = filename; m_sub_images = 0; wxString s; - s = wxT("") + wxString(wxT("\n")); + s = wxT("\n"); write(s); - s = wxT(" ") + wxString(wxT("\n")); + s = wxT("\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n"); write(s); - s = wxT(" \n"), NumStr(float(Width)/dpi*2.54), NumStr(float(Height)/dpi*2.54), Width, Height ); + 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(" ") + wxT("\n"); + s = wxT("SVG Picture created as ") + wxFileName(filename).GetFullName() + wxT(" \n"); write(s); - s = wxString (wxT("Picture generated by wxSVG ")) + wxSVGVersion + wxT(" ")+ wxT("\n"); + s = wxString (wxT("Picture generated by wxSVG ")) + wxSVGVersion + wxT(" \n"); write(s); - s = wxT("") + wxString(wxT("\n")); + s = wxT("\n"); write(s); } } @@ -219,7 +219,7 @@ void wxSVGFileDCImpl::DoDrawPoint (wxCoord x1, wxCoord y1) { wxString s; NewGraphicsIfNeeded(); - s = wxT(" ") + wxString(wxT("\n")); + s = wxT(" \n"); write(s); DoDrawLine ( x1,y1,x1,y1 ); s = wxT("");