From 451e456a913092927ee7133a805caf93aae16f5a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 25 Oct 2013 21:23:11 +0000 Subject: [PATCH] Fix special characters handling in wxSVGFileDC::DrawText(). Special XML characters need to be quoted before being saved in an SVG file (which is also an XML file). Closes #15602. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/common/dcsvg.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changes.txt b/docs/changes.txt index 34533f2ae3..2e3b327b88 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -572,6 +572,7 @@ All: All (GUI): - Fix wxListEvent::GetData() in LLP64 builds. +- Fix special characters handling in wxSVGFileDC::DrawText() (Ludovic Aubert). wxGTK: diff --git a/src/common/dcsvg.cpp b/src/common/dcsvg.cpp index 6fd0c2a46f..5c55a0b935 100644 --- a/src/common/dcsvg.cpp +++ b/src/common/dcsvg.cpp @@ -27,6 +27,8 @@ #include "wx/wfstream.h" #include "wx/filename.h" +#include "wx/private/markupparser.h" + // ---------------------------------------------------------- // Global utilities // ---------------------------------------------------------- @@ -293,7 +295,7 @@ void wxSVGFileDCImpl::DoDrawRotatedText(const wxString& sText, wxCoord x, wxCoor //text will be solid, unless alpha value isn't opaque in the foreground colour s += wxBrushString(m_textForegroundColour) + wxPenString(m_textForegroundColour); sTmp.Printf ( wxT("stroke-width:0;\" transform=\"rotate( %s %d %d ) \" >"), NumStr(-angle), x,y ); - s += sTmp + sText + wxT(" ") + wxT("\n"); + s += sTmp + wxMarkupParser::Quote(sText) + wxT(" ") + wxT("\n"); if (m_OK) { write(s);