X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6fb0a92e2c3ec26a1c94083d793b44b2a906daa1..80a24267cbc17d85e278e1f10cdfdaea12199639:/src/html/m_pre.cpp diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp index 5e3a4ae9da..df51c4246a 100644 --- a/src/html/m_pre.cpp +++ b/src/html/m_pre.cpp @@ -14,7 +14,7 @@ #include "wx/wxprec.h" #include "wx/defs.h" -#if wxUSE_HTML +#if wxUSE_HTML && wxUSE_STREAMS #ifdef __BORDLANDC__ #pragma hdrstop #endif @@ -29,6 +29,7 @@ #include "wx/html/htmlcell.h" #include "wx/tokenzr.h" +#include "wx/encconv.h" FORCE_LINK_ME(m_pre) @@ -138,8 +139,15 @@ TAG_HANDLER_BEGIN(PRE, "PRE") { wxString cit; - cit = m_WParser -> GetSource() -> Mid(tag.GetBeginPos(), tag.GetEndPos1() - tag.GetBeginPos()); - c -> InsertCell(new wxHtmlPRECell(cit, *(m_WParser -> GetDC()))); + wxEncodingConverter *encconv = m_WParser -> GetEncodingConverter(); + cit = m_WParser -> GetSource() -> Mid(tag.GetBeginPos(), + tag.GetEndPos1() - tag.GetBeginPos()); + if (encconv) + c -> InsertCell(new wxHtmlPRECell(encconv -> Convert(cit), + *(m_WParser -> GetDC()))); + else + c -> InsertCell(new wxHtmlPRECell(cit, + *(m_WParser -> GetDC()))); } m_WParser -> SetFontUnderlined(underlined);