X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7a5e62674f8c9e923956d67d95f5d0c97763ca1f..5adad46628e545a6d4172ecf3a0cb848934f5cd0:/src/html/winpars.cpp diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 121b76e3aa..e90c35f723 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -197,10 +197,12 @@ void wxHtmlWinParser::AddText(const char* txt) char temp[wxHTML_BUFLEN]; register char d; int templen = 0; - + if (m_tmpLastWasSpace) { - while ((i < lng) && ((txt[i] == '\n') || (txt[i] == '\r') || (txt[i] == ' ') || (txt[i] == '\t'))) i++; + while ((i < lng) && + ((txt[i] == '\n') || (txt[i] == '\r') || (txt[i] == ' ') || + (txt[i] == '\t'))) i++; } while (i < lng) @@ -210,7 +212,8 @@ void wxHtmlWinParser::AddText(const char* txt) if ((d == '\n') || (d == '\r') || (d == ' ') || (d == '\t')) { i++, x++; - while ((i < lng) && ((txt[i] == '\n') || (txt[i] == '\r') || (txt[i] == ' ') || (txt[i] == '\t'))) i++, x++; + while ((i < lng) && ((txt[i] == '\n') || (txt[i] == '\r') || + (txt[i] == ' ') || (txt[i] == '\t'))) i++, x++; } else i++; @@ -219,9 +222,11 @@ void wxHtmlWinParser::AddText(const char* txt) temp[templen-1] = ' '; temp[templen] = 0; templen = 0; - if (m_EncConv) m_EncConv->Convert(temp); - c = new wxHtmlWordCell(temp, *(GetDC())); - if (m_UseLink) c->SetLink(m_Link); + if (m_EncConv) + m_EncConv->Convert(temp); + c = new wxHtmlWordCell(GetEntitiesParser()->Parse(temp), *(GetDC())); + if (m_UseLink) + c->SetLink(m_Link); m_Container->InsertCell(c); m_tmpLastWasSpace = TRUE; } @@ -229,9 +234,11 @@ void wxHtmlWinParser::AddText(const char* txt) if (templen) { temp[templen] = 0; - if (m_EncConv) m_EncConv->Convert(temp); - c = new wxHtmlWordCell(temp, *(GetDC())); - if (m_UseLink) c->SetLink(m_Link); + if (m_EncConv) + m_EncConv->Convert(temp); + c = new wxHtmlWordCell(GetEntitiesParser()->Parse(temp), *(GetDC())); + if (m_UseLink) + c->SetLink(m_Link); m_Container->InsertCell(c); m_tmpLastWasSpace = FALSE; } @@ -333,7 +340,11 @@ void wxHtmlWinParser::SetFontFace(const wxString& face) void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc) { m_InputEnc = m_OutputEnc = wxFONTENCODING_DEFAULT; - if (m_EncConv) {delete m_EncConv; m_EncConv = NULL;} + if (m_EncConv) + { + delete m_EncConv; + m_EncConv = NULL; + } if (enc == wxFONTENCODING_DEFAULT) return; @@ -363,6 +374,10 @@ void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc) m_OutputEnc = wxFONTENCODING_DEFAULT; m_InputEnc = enc; + if (m_OutputEnc == wxFONTENCODING_DEFAULT) + GetEntitiesParser()->SetEncoding(wxFONTENCODING_SYSTEM); + else + GetEntitiesParser()->SetEncoding(m_OutputEnc); if (m_InputEnc == m_OutputEnc) return;