#endif
#include "wx/html/htmldefs.h"
#include "wx/html/winpars.h"
#include "wx/html/htmlwin.h"
#include "wx/fontmap.h"
#endif
#include "wx/html/htmldefs.h"
#include "wx/html/winpars.h"
#include "wx/html/htmlwin.h"
#include "wx/fontmap.h"
m_FontsTable[i][j][k][l][m] = NULL;
m_FontsFacesTable[i][j][k][l][m] = wxEmptyString;
m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT;
}
#ifdef __WXMSW__
static int default_sizes[7] = {7, 8, 10, 12, 16, 22, 30};
m_FontsTable[i][j][k][l][m] = NULL;
m_FontsFacesTable[i][j][k][l][m] = wxEmptyString;
m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT;
}
#ifdef __WXMSW__
static int default_sizes[7] = {7, 8, 10, 12, 16, 22, 30};
+#elif defined(__WXMAC__)
+ static int default_sizes[7] = {9, 12, 14, 18, 24, 30, 36};
#else
static int default_sizes[7] = {10, 12, 14, 16, 19, 24, 32};
#endif
#else
static int default_sizes[7] = {10, 12, 14, 16, 19, 24, 32};
#endif
- while (node) {
- wxHtmlTagsModule *mod = (wxHtmlTagsModule*) node -> GetData();
- mod -> FillHandlersTable(this);
- node = node -> GetNext();
+ while (node)
+ {
+ wxHtmlTagsModule *mod = (wxHtmlTagsModule*) node->GetData();
+ mod->FillHandlersTable(this);
+ node = node->GetNext();
for (i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i];
m_FontFaceFixed = fixed_face;
m_FontFaceNormal = normal_face;
for (i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i];
m_FontFaceFixed = fixed_face;
m_FontFaceNormal = normal_face;
m_FontBold = m_FontItalic = m_FontUnderlined = m_FontFixed = FALSE;
m_FontSize = 3; //default one
CreateCurrentFont(); // we're selecting default font into
m_FontBold = m_FontItalic = m_FontUnderlined = m_FontFixed = FALSE;
m_FontSize = 3; //default one
CreateCurrentFont(); // we're selecting default font into
- m_Container -> InsertCell(new wxHtmlColourCell(m_ActualColor));
- m_Container -> InsertCell(new wxHtmlFontCell(CreateCurrentFont()));
+ m_Container->InsertCell(new wxHtmlColourCell(m_ActualColor));
+ m_Container->InsertCell(new wxHtmlFontCell(CreateCurrentFont()));
- if (m_tmpLastWasSpace) {
- while ((i < lng) && ((txt[i] == '\n') || (txt[i] == '\r') || (txt[i] == ' ') || (txt[i] == '\t'))) i++;
+ if (lng+1 > m_tmpStrBufSize)
+ {
+ delete[] m_tmpStrBuf;
+ m_tmpStrBuf = new wxChar[lng+1];
+ m_tmpStrBufSize = lng+1;
- while ((i < lng) && ((txt[i] == '\n') || (txt[i] == '\r') || (txt[i] == ' ') || (txt[i] == '\t'))) i++, x++;
+ while ((i < lng) && ((txt[i] == wxT('\n')) || (txt[i] == wxT('\r')) ||
+ (txt[i] == wxT(' ')) || (txt[i] == wxT('\t')))) i++, x++;
- if (m_EncConv) m_EncConv -> Convert(temp);
- c = new wxHtmlWordCell(temp, *(GetDC()));
- if (m_UseLink) c -> SetLink(m_Link);
- m_Container -> InsertCell(c);
+ 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);
- if (m_EncConv) m_EncConv -> Convert(temp);
- c = new wxHtmlWordCell(temp, *(GetDC()));
- if (m_UseLink) c -> SetLink(m_Link);
- m_Container -> InsertCell(c);
+ 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);
wxHtmlContainerCell* wxHtmlWinParser::OpenContainer()
{
m_Container = new wxHtmlContainerCell(m_Container);
wxHtmlContainerCell* wxHtmlWinParser::OpenContainer()
{
m_Container = new wxHtmlContainerCell(m_Container);
wxFont **fontptr = &(m_FontsTable[fb][fi][fu][ff][fs]);
wxFontEncoding *encptr = &(m_FontsEncTable[fb][fi][fu][ff][fs]);
wxFont **fontptr = &(m_FontsTable[fb][fi][fu][ff][fs]);
wxFontEncoding *encptr = &(m_FontsEncTable[fb][fi][fu][ff][fs]);
void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
{
m_InputEnc = m_OutputEnc = wxFONTENCODING_DEFAULT;
void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
{
m_InputEnc = m_OutputEnc = wxFONTENCODING_DEFAULT;
if (enc == wxFONTENCODING_DEFAULT) return;
wxFontEncoding altfix, altnorm;
bool availfix, availnorm;
if (enc == wxFONTENCODING_DEFAULT) return;
wxFontEncoding altfix, altnorm;
bool availfix, availnorm;
-
- // exact match?
- availnorm = wxTheFontMapper -> IsEncodingAvailable(enc, m_FontFaceNormal);
- availfix = wxTheFontMapper -> IsEncodingAvailable(enc, m_FontFaceFixed);
- if (availnorm && availfix)
+
+ // exact match?
+ availnorm = wxTheFontMapper->IsEncodingAvailable(enc, m_FontFaceNormal);
+ availfix = wxTheFontMapper->IsEncodingAvailable(enc, m_FontFaceFixed);
+ if (availnorm && availfix)
- else if (wxTheFontMapper -> GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE) &&
- wxTheFontMapper -> GetAltForEncoding(enc, &altfix, m_FontFaceFixed, FALSE) &&
+ else if (wxTheFontMapper->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE) &&
+ wxTheFontMapper->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, FALSE) &&
- else if (wxTheFontMapper -> GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE))
+ else if (wxTheFontMapper->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, FALSE))
// okay, let convert to ISO_8859-1, available always
else
m_OutputEnc = wxFONTENCODING_DEFAULT;
// okay, let convert to ISO_8859-1, available always
else
m_OutputEnc = wxFONTENCODING_DEFAULT;
(m_OutputEnc == wxFONTENCODING_DEFAULT) ?
wxFONTENCODING_ISO8859_1 : m_OutputEnc,
(m_OutputEnc == wxFONTENCODING_DEFAULT) ?
wxFONTENCODING_ISO8859_1 : m_OutputEnc,