]> git.saurik.com Git - wxWidgets.git/commitdiff
No real changes, just avoid unnecessary string operations in wxSVGFileDCImpl.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 23:40:17 +0000 (23:40 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Oct 2012 23:40:17 +0000 (23:40 +0000)
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

src/common/dcsvg.cpp

index 446c3fc4bc63e841971789861ac7865b84832341..dcba36482771392140b8bcfa7049cee640bac7e7 100644 (file)
@@ -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("<?xml version=\"1.0\" standalone=\"no\"?>") + wxString(wxT("\n"));
+        s = wxT("<?xml version=\"1.0\" standalone=\"no\"?>\n");
         write(s);
-        s = wxT("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20010904//EN\" ") + wxString(wxT("\n"));
+        s = wxT("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 20010904//EN\"\n");
         write(s);
-        s = wxT("\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\"> ") + wxString(wxT("\n"));
+        s = wxT("\"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n");
         write(s);
-        s = wxT("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" ") + wxString(wxT("\n"));
+        s = wxT("<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n");
         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 );
+        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("<title>SVG Picture created as ") + wxFileName(filename).GetFullName() + wxT(" </title>") + wxT("\n");
+        s = wxT("<title>SVG Picture created as ") + wxFileName(filename).GetFullName() + wxT(" </title>\n");
         write(s);
-        s = wxString (wxT("<desc>Picture generated by wxSVG ")) + wxSVGVersion + wxT(" </desc>")+ wxT("\n");
+        s = wxString (wxT("<desc>Picture generated by wxSVG ")) + wxSVGVersion + wxT(" </desc>\n");
         write(s);
-        s =  wxT("<g style=\"fill:black; stroke:black; stroke-width:1\">") + wxString(wxT("\n"));
+        s =  wxT("<g style=\"fill:black; stroke:black; stroke-width:1\">\n");
         write(s);
     }
 }
@@ -219,7 +219,7 @@ void wxSVGFileDCImpl::DoDrawPoint (wxCoord x1, wxCoord y1)
 {
     wxString s;
     NewGraphicsIfNeeded();
-    s = wxT("<g style = \"stroke-linecap:round;\" > ") + wxString(wxT("\n"));
+    s = wxT("<g style = \"stroke-linecap:round;\" > \n");
     write(s);
     DoDrawLine ( x1,y1,x1,y1 );
     s = wxT("</g>");