X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66a77a748e5c8002f3f9ebd66f5457aca5aabad8..1a787c5dc89b1cb6a9ddb4ebef3ad2fb24b49c8c:/src/html/m_pre.cpp diff --git a/src/html/m_pre.cpp b/src/html/m_pre.cpp index fdeaaf4a1f..b7f283a224 100644 --- a/src/html/m_pre.cpp +++ b/src/html/m_pre.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: mod_pre.cpp +// Name: m_pre.cpp // Purpose: wxHtml module for
 ... 
tag (code citation) // Author: Vaclav Slavik // RCS-ID: $Id$ @@ -11,7 +11,7 @@ #pragma implementation #endif -#include +#include "wx/wxprec.h" #include "wx/defs.h" #if wxUSE_HTML @@ -20,7 +20,7 @@ #endif #ifndef WXPRECOMP -#include +#include "wx/wx.h" #endif @@ -28,9 +28,10 @@ #include "wx/html/m_templ.h" #include "wx/html/htmlcell.h" -#include +#include "wx/tokenzr.h" +#include "wx/encconv.h" -FORCE_LINK_ME(mod_pre) +FORCE_LINK_ME(m_pre) //----------------------------------------------------------------------------- @@ -70,6 +71,7 @@ wxHtmlPRECell::wxHtmlPRECell(const wxString& s, wxDC& dc) : wxHtmlCell() while (tokenizer.HasMoreTokens()) { if (i % 10 == 0) m_Text = (wxString**) realloc(m_Text, sizeof(wxString*) * (i + 10)); tmp = tokenizer.NextToken(); + tmp.Replace(wxT("©"), wxT("(c)"), TRUE); tmp.Replace(wxT(" "), wxT(" "), TRUE); tmp.Replace(wxT("""), wxT("\""), TRUE); tmp.Replace(wxT("<"), wxT("<"), TRUE); @@ -132,13 +134,20 @@ TAG_HANDLER_BEGIN(PRE, "PRE") m_WParser -> SetFontBold(FALSE); m_WParser -> SetFontItalic(FALSE); m_WParser -> SetFontFixed(TRUE); - m_WParser -> SetFontSize(0); + m_WParser -> SetFontSize(3); c -> InsertCell(new wxHtmlFontCell(m_WParser -> CreateCurrentFont())); { 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);