]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/winpars.cpp
minimal changes needed to allow linking wxCocoa as shared lib
[wxWidgets.git] / src / html / winpars.cpp
index 2e6fb654e792ccb9d73340262c9b6dffd005f7bf..df118d282321f06bc7e56f619f5f076f4a50876c 100644 (file)
 #include "wx/html/htmlwin.h"
 #include "wx/fontmap.h"
 #include "wx/log.h"
+#include "wx/settings.h"
 
 
 //-----------------------------------------------------------------------------
 // wxHtmlWinParser
 //-----------------------------------------------------------------------------
 
+IMPLEMENT_ABSTRACT_CLASS(wxHtmlWinParser, wxHtmlParser)
 
 wxList wxHtmlWinParser::m_Modules;
 
@@ -187,8 +189,11 @@ void wxHtmlWinParser::InitParser(const wxString& source)
 #endif
 
     m_Container->InsertCell(new wxHtmlColourCell(m_ActualColor));
+    wxColour windowColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) ;
     m_Container->InsertCell(
-            new wxHtmlColourCell(GetWindow()->GetBackgroundColour(),
+            new wxHtmlColourCell(GetWindow() ?
+                                     GetWindow()->GetBackgroundColour() :
+                                     windowColour,
                                  wxHTML_CLR_BACKGROUND));
     m_Container->InsertCell(new wxHtmlFontCell(CreateCurrentFont()));
 }
@@ -445,6 +450,7 @@ void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
     wxFontEncoding altfix, altnorm;
     bool availfix, availnorm;
 
+#ifndef __WXMAC__
     // exact match?
     availnorm = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceNormal);
     availfix = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceFixed);
@@ -466,6 +472,10 @@ void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
     // okay, let convert to ISO_8859-1, available always
     else
         m_OutputEnc = wxFONTENCODING_DEFAULT;
+#else
+    // we only have the current system encoding
+    m_OutputEnc = wxFONTENCODING_MACROMAN;
+#endif
 
     m_InputEnc = enc;
     if (m_OutputEnc == wxFONTENCODING_DEFAULT)