X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f23e92e72ae94e775a9931ba3a9f40cbdf774c71..018e2f1300b726936e8afa41fcc3e2a85d2ed456:/src/html/winpars.cpp?ds=sidebyside diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index fc5ddff815..59b93e0692 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -234,32 +234,32 @@ void wxHtmlWinParser::AddText(const wxChar* txt) { temp[templen-1] = wxT(' '); temp[templen] = 0; + if (templen == 1) continue; templen = 0; if (m_EncConv) m_EncConv->Convert(temp); - wxString str = GetEntitiesParser()->Parse(temp); - size_t len = str.Len(); + size_t len = wxStrlen(temp); for (size_t j = 0; j < len; j++) - if (str.GetChar(j) == nbsp) - str[j] = wxT(' '); - c = new wxHtmlWordCell(str, *(GetDC())); + if (temp[j] == nbsp) + temp[j] = wxT(' '); + c = new wxHtmlWordCell(temp, *(GetDC())); if (m_UseLink) c->SetLink(m_Link); m_Container->InsertCell(c); m_tmpLastWasSpace = TRUE; } } - if (templen) + + if (templen && (templen > 1 || temp[0] != wxT(' '))) { temp[templen] = 0; if (m_EncConv) m_EncConv->Convert(temp); - wxString str = GetEntitiesParser()->Parse(temp); - size_t len = str.Len(); + size_t len = wxStrlen(temp); for (size_t j = 0; j < len; j++) - if (str.GetChar(j) == nbsp) - str[j] = wxT(' '); - c = new wxHtmlWordCell(str, *(GetDC())); + if (temp[j] == nbsp) + temp[j] = wxT(' '); + c = new wxHtmlWordCell(temp, *(GetDC())); if (m_UseLink) c->SetLink(m_Link); m_Container->InsertCell(c);