Permalink
Browse files

Merge branch 'master' of github.com:andrejv/wxmaxima

  • Loading branch information...
2 parents ee4e0be + 604e9f5 commit 301c545037757bcb625237be3004d47738a237a8 @andrejv committed Feb 11, 2014
Showing with 17 additions and 11 deletions.
  1. +17 −11 src/TextCell.cpp
View
@@ -270,6 +270,9 @@ wxString TextCell::ToString(bool all)
text = m_altCopyText;
else
text = m_text;
+#if wxUSE_UNICODE
+ text.Replace(wxT("\x2212"), wxT("-")); // unicode minus sign
+#endif
if (m_textStyle == TS_STRING)
text = wxT("\"") + text + wxT("\"");
return text + MathCell::ToString(all);
@@ -343,31 +346,34 @@ wxString TextCell::ToTeX(bool all)
text.Replace(wxT("^"), wxT("\\^"));
text.Replace(wxT("_"), wxT("\\_"));
text.Replace(wxT("%"), wxT("\\%"));
+#if wxUSE_UNICODE
+ text.Replace(wxT("\x2212"), wxT("-")); // unicode minus sign
+#endif
}
return text + MathCell::ToTeX(all);
}
wxString TextCell::ToXML(bool all)
{
- wxString tag = ( m_isHidden ) ? _T("h") :
- ( m_textStyle == TS_GREEK_CONSTANT ) ? _T("g") :
- ( m_textStyle == TS_SPECIAL_CONSTANT ) ? _T("s") :
- ( m_textStyle == TS_VARIABLE ) ? _T("v") :
- ( m_textStyle == TS_FUNCTION ) ? _T("fnm") :
- ( m_textStyle == TS_NUMBER ) ? _T("n") :
- ( m_textStyle == TS_STRING ) ? _T("st") :
- ( m_textStyle == TS_LABEL) ? _T("lbl") : _T("t");
+ wxString tag = ( m_isHidden ) ? _T("h") :
+ ( m_textStyle == TS_GREEK_CONSTANT ) ? _T("g") :
+ ( m_textStyle == TS_SPECIAL_CONSTANT ) ? _T("s") :
+ ( m_textStyle == TS_VARIABLE ) ? _T("v") :
+ ( m_textStyle == TS_FUNCTION ) ? _T("fnm") :
+ ( m_textStyle == TS_NUMBER ) ? _T("n") :
+ ( m_textStyle == TS_STRING ) ? _T("st") :
+ ( m_textStyle == TS_LABEL) ? _T("lbl") : _T("t");
wxString xmlstring = m_text;
// convert it, so that the XML parser doesn't fail
xmlstring.Replace(wxT("&"), wxT("&"));
xmlstring.Replace(wxT("<"), wxT("&lt;"));
xmlstring.Replace(wxT(">"), wxT("&gt;"));
xmlstring.Replace(wxT("'"), wxT("&apos;"));
xmlstring.Replace(wxT("\""), wxT("&quot;"));
-
- return _T("<") + tag + _T(">") + xmlstring + _T("</") + tag + _T(">") +
- MathCell::ToXML(all);
+
+ return _T("<") + tag + _T(">") + xmlstring + _T("</") + tag + _T(">") +
+ MathCell::ToXML(all);
}
wxString TextCell::GetDiffPart()

0 comments on commit 301c545

Please sign in to comment.