X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3c7fd79d081ccd02dc1a4ed601f4f1ea7b62e69..0e32fdb872d413f14da8ce045766f0e2f13e202d:/src/html/winpars.cpp diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 66b8871b72..fc5ddff815 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -201,6 +201,7 @@ void wxHtmlWinParser::AddText(const wxChar* txt) lng = wxStrlen(txt); register wxChar d; int templen = 0; + wxChar nbsp = GetEntitiesParser()->GetCharForCode(160 /* nbsp */); if (lng+1 > m_tmpStrBufSize) { @@ -236,7 +237,12 @@ void wxHtmlWinParser::AddText(const wxChar* txt) templen = 0; if (m_EncConv) m_EncConv->Convert(temp); - c = new wxHtmlWordCell(GetEntitiesParser()->Parse(temp), *(GetDC())); + wxString str = GetEntitiesParser()->Parse(temp); + size_t len = str.Len(); + for (size_t j = 0; j < len; j++) + if (str.GetChar(j) == nbsp) + str[j] = wxT(' '); + c = new wxHtmlWordCell(str, *(GetDC())); if (m_UseLink) c->SetLink(m_Link); m_Container->InsertCell(c); @@ -248,7 +254,12 @@ void wxHtmlWinParser::AddText(const wxChar* txt) temp[templen] = 0; if (m_EncConv) m_EncConv->Convert(temp); - c = new wxHtmlWordCell(GetEntitiesParser()->Parse(temp), *(GetDC())); + wxString str = GetEntitiesParser()->Parse(temp); + size_t len = str.Len(); + for (size_t j = 0; j < len; j++) + if (str.GetChar(j) == nbsp) + str[j] = wxT(' '); + c = new wxHtmlWordCell(str, *(GetDC())); if (m_UseLink) c->SetLink(m_Link); m_Container->InsertCell(c);