X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/69941f05864fa8b37856ccc1338124bfac756a2b..b8aa1680f21faef698d39a2bce9c09e45a5bbf7a:/src/html/winpars.cpp?ds=sidebyside diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 88bf5cc529..3c3fbb22a7 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -12,7 +12,7 @@ #pragma implementation #endif -#include +#include "wx/wxprec.h" #include "wx/defs.h" #if wxUSE_HTML @@ -22,7 +22,7 @@ #endif #ifndef WXPRECOMP -#include +#include "wx/wx.h" #endif #include "wx/html/htmldefs.h" @@ -34,7 +34,6 @@ // wxHtmlWinParser //----------------------------------------------------------------------------- -IMPLEMENT_DYNAMIC_CLASS(wxHtmlWinParser,wxHtmlParser) wxList wxHtmlWinParser::m_Modules; @@ -55,16 +54,16 @@ wxHtmlWinParser::wxHtmlWinParser(wxWindow *wnd) : wxHtmlParser() for (m = 0; m < 7; m++) m_FontsTable[i][j][k][l][m] = NULL; #ifdef __WXMSW__ - int default_sizes[7] = {7, 8, 10, 12, 16, 22, 30}; + static int default_sizes[7] = {7, 8, 10, 12, 16, 22, 30}; #else - int default_sizes[7] = {10, 12, 14, 16, 19, 24, 32}; + static int default_sizes[7] = {10, 12, 14, 16, 19, 24, 32}; #endif SetFonts("", wxSLANT, "", wxSLANT, default_sizes); } // fill in wxHtmlParser's tables: wxNode *node = m_Modules.GetFirst(); - while (node){ + while (node) { wxHtmlTagsModule *mod = (wxHtmlTagsModule*) node -> GetData(); mod -> FillHandlersTable(this); node = node -> GetNext(); @@ -80,13 +79,26 @@ void wxHtmlWinParser::AddModule(wxHtmlTagsModule *module) -void wxHtmlWinParser::SetFonts(wxString normal_face, int normal_italic_mode, wxString fixed_face, int fixed_italic_mode, int *sizes) +void wxHtmlWinParser::SetFonts(wxString normal_face, int normal_italic_mode, wxString fixed_face, int fixed_italic_mode, const int *sizes) { - for (int i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i]; + int i, j, k, l, m; + + for (i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i]; m_FontFaceFixed = fixed_face; m_FontFaceNormal = normal_face; m_ItalicModeFixed = fixed_italic_mode; m_ItalicModeNormal = normal_italic_mode; + + for (i = 0; i < 2; i++) + for (j = 0; j < 2; j++) + for (k = 0; k < 2; k++) + for (l = 0; l < 2; l++) + for (m = 0; m < 7; m++) { + if (m_FontsTable[i][j][k][l][m] != NULL) { + delete m_FontsTable[i][j][k][l][m]; + m_FontsTable[i][j][k][l][m] = NULL; + } + } } @@ -107,7 +119,7 @@ void wxHtmlWinParser::InitParser(const wxString& source) m_Link = ""; m_LinkColor.Set(0, 0, 0xFF); m_ActualColor.Set(0, 0, 0); - m_Align = HTML_ALIGN_LEFT; + m_Align = wxHTML_ALIGN_LEFT; m_tmpLastWasSpace = FALSE; OpenContainer(); @@ -133,7 +145,7 @@ wxObject* wxHtmlWinParser::GetProduct() CloseContainer(); OpenContainer(); - GetContainer() -> SetIndent(m_CharHeight, HTML_INDENT_TOP); + GetContainer() -> SetIndent(m_CharHeight, wxHTML_INDENT_TOP); top = m_Container; while (top -> GetParent()) top = top -> GetParent(); return top; @@ -167,7 +179,7 @@ void wxHtmlWinParser::AddText(const char* txt) { wxHtmlCell *c; int i = 0, x, lng = strlen(txt); - char temp[HTML_BUFLEN]; + char temp[wxHTML_BUFLEN]; register char d; int templen = 0; @@ -243,13 +255,12 @@ wxFont* wxHtmlWinParser::CreateCurrentFont() if (m_FontsTable[fb][fi][fu][ff][fs] == NULL) { m_FontsTable[fb][fi][fu][ff][fs] = - //wxTheFontList -> FindOrCreateFont( new wxFont( m_FontsSizes[fs], ff ? wxMODERN : wxSWISS, - fi ? (ff ? m_ItalicModeFixed : m_ItalicModeNormal) : wxNORMAL, - fb ? wxBOLD : wxNORMAL, - fu ? TRUE : FALSE, ff ? m_FontFaceFixed : m_FontFaceNormal); + fi ? (ff ? m_ItalicModeFixed : m_ItalicModeNormal) : wxNORMAL, + fb ? wxBOLD : wxNORMAL, + fu ? TRUE : FALSE, ff ? m_FontFaceFixed : m_FontFaceNormal); } m_DC -> SetFont(*(m_FontsTable[fb][fi][fu][ff][fs])); return (m_FontsTable[fb][fi][fu][ff][fs]); @@ -285,5 +296,5 @@ bool wxHtmlTagsModule::OnInit() void wxHtmlTagsModule::OnExit() { } +#endif -#endif \ No newline at end of file