diff --git a/include/wx/dcsvg.h b/include/wx/dcsvg.h index 6b1b0fdd72..63ebb96463 100644 --- a/include/wx/dcsvg.h +++ b/include/wx/dcsvg.h @@ -16,7 +16,7 @@ #if wxUSE_SVG -#define wxSVGVersion wxT("v0100") +#define wxSVGVersion wxT("v0101") #ifdef __BORLANDC__ #pragma warn -8008 diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index c35129be85..a26754f2c9 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -294,9 +294,7 @@ wxSVGBitmapEmbedHandler::ProcessBitmap(const wxBitmap& bmp, // write image meta information wxString s; - s += wxString::Format(" "; // last line + s += data.Mid(i, s.size() - i) + "\"\n />\n"; // last line } // write to the SVG file @@ -349,11 +347,9 @@ wxSVGBitmapFileHandler::ProcessBitmap(const wxBitmap& bmp, // reference the bitmap from the SVG doc wxString s; - s += wxString::Format(" \n\n", sPNG); + s += wxString::Format(" xlink:href=\"%s\"/>\n", sPNG); // write to the SVG file const wxCharBuffer buf = s.utf8_str(); @@ -421,21 +417,13 @@ void wxSVGFileDCImpl::Init (const wxString &filename, int Width, int Height, m_filename = filename; m_sub_images = 0; wxString s; - s = wxT("\n"); - write(s); - s = wxT("\n"); - write(s); - s = wxT("\n"), NumStr(float(Width)/dpi*2.54), NumStr(float(Height)/dpi*2.54), Width, Height ); - write(s); - s = wxT("") + title + wxT("\n"); - write(s); - s = wxString (wxT("Picture generated by wxSVG ")) + wxSVGVersion + wxT("\n"); - write(s); - s = wxT("\n"); + s += wxS("\n"); + s += wxS("\n\n"); + s += wxS("\n"), NumStr(float(Width) / dpi*2.54), NumStr(float(Height) / dpi*2.54), Width, Height); + s += wxString::Format(wxS("%s\n"), title); + s += wxString(wxS("Picture generated by wxSVG ")) + wxSVGVersion + wxS("\n\n"); + s += wxS("\n"); write(s); } } @@ -514,14 +502,14 @@ void wxSVGFileDCImpl::DoDrawLines(int n, const wxPoint points[], wxCoord xoffset } } -void wxSVGFileDCImpl::DoDrawPoint (wxCoord x1, wxCoord y1) +void wxSVGFileDCImpl::DoDrawPoint(wxCoord x1, wxCoord y1) { wxString s; NewGraphicsIfNeeded(); - s = wxT(" \n"); + s = wxS("\n"); write(s); - DoDrawLine ( x1,y1,x1,y1 ); - s = wxT(""); + DoDrawLine(x1, y1, x1, y1); + s = wxS("\n"); write(s); } @@ -663,16 +651,15 @@ void wxSVGFileDCImpl::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoo DoDrawRoundedRectangle(x, y, width, height, 0); } -void wxSVGFileDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius ) - +void wxSVGFileDCImpl::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius) { NewGraphicsIfNeeded(); wxString s; - s.Printf ( wxT(" \n"); + s += wxS("/>\n"); write(s); CalcBoundingBox(x, y); @@ -684,22 +671,22 @@ void wxSVGFileDCImpl::DoDrawPolygon(int n, const wxPoint points[], wxPolygonFillMode fillStyle) { NewGraphicsIfNeeded(); - wxString s, sTmp; - s = wxT(" \n"); + s += wxS("\"/>\n"); write(s); }