]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_layout.cpp
compilation fix
[wxWidgets.git] / src / html / m_layout.cpp
index e118e82fc7c9216385796d3d672020fff8265ba5..1bea3402014246c47a75f8026e0bba6eeb65bd4c 100644 (file)
 
 #if wxUSE_HTML && wxUSE_STREAMS
 
-#ifndef WXPRECOMP
+#ifndef WX_PRECOMP
+    #include "wx/image.h"
 #endif
 
-#include "wx/image.h"
-
 #include "wx/html/forcelnk.h"
 #include "wx/html/m_templ.h"
 
@@ -101,7 +100,7 @@ bool wxHtmlPageBreakCell::AdjustPagebreak(int* pagebreak, wxArrayInt& known_page
     // vertical position. Otherwise we'd be setting a pagebreak above
     // the current cell, which is incorrect, or duplicating a
     // pagebreak that has already been set.
-    if( known_pagebreaks.Count() == 0 || *pagebreak <= m_PosY)
+    if( known_pagebreaks.GetCount() == 0 || *pagebreak <= m_PosY)
     {
         return false;
     }
@@ -294,9 +293,14 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE")
                                     tag.GetBeginPos(),
                                     tag.GetEndPos1()-tag.GetBeginPos());
 #if !wxUSE_UNICODE && wxUSE_WCHAR_T
-            wxCSConv conv(m_WParser->GetInputEncoding());
-            title = wxString(title.wc_str(conv), wxConvLocal);
-#endif
+            const wxFontEncoding enc = m_WParser->GetInputEncoding();
+            if ( enc != wxFONTENCODING_DEFAULT )
+            {
+                // need to convert to the current one
+                title = wxString(title.wc_str(wxCSConv(enc)), wxConvLocal);
+            }
+#endif // !wxUSE_UNICODE
+
             title = m_WParser->GetEntitiesParser()->Parse(title);
 
             winIface->SetHTMLWindowTitle(title);
@@ -342,12 +346,12 @@ TAG_HANDLER_BEGIN(BODY, "BODY")
                 wxInputStream *is = fileBgImage->GetStream();
                 if ( is )
                 {
-#if !defined(__WXMSW__) || wxUSE_WXDIB
                     wxImage image(*is);
                     if ( image.Ok() )
                         winIface->SetHTMLBackgroundImage(image);
-#endif
                 }
+
+                delete fileBgImage;
             }
         }
 
@@ -407,7 +411,8 @@ TAG_HANDLER_BEGIN(SUBSUP, "SUB,SUP")
         wxHtmlCell *c = cont->GetLastChild();
 
         m_WParser->SetScriptMode(issub ? wxHTML_SCRIPT_SUB : wxHTML_SCRIPT_SUP);
-        m_WParser->SetScriptBaseline(oldbase + c->GetScriptBaseline());
+        m_WParser->SetScriptBaseline(
+                oldbase + c ? c->GetScriptBaseline() : 0);
 
         // select smaller font
         m_WParser->SetFontSize(m_WParser->GetFontSize()-2);