]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_layout.cpp
send selection events when Ctrl-clicking an item repeeatedly in a multiselection...
[wxWidgets.git] / src / html / m_layout.cpp
index 07b483b7d063fd325b6da18bd33968f9e08be773..58384fb59922bc3edc4df66b435742915c43f4f6 100644 (file)
@@ -293,9 +293,14 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE")
                                     tag.GetBeginPos(),
                                     tag.GetEndPos1()-tag.GetBeginPos());
 #if !wxUSE_UNICODE && wxUSE_WCHAR_T
                                     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);
             title = m_WParser->GetEntitiesParser()->Parse(title);
 
             winIface->SetHTMLWindowTitle(title);
@@ -341,12 +346,12 @@ TAG_HANDLER_BEGIN(BODY, "BODY")
                 wxInputStream *is = fileBgImage->GetStream();
                 if ( is )
                 {
                 wxInputStream *is = fileBgImage->GetStream();
                 if ( is )
                 {
-#if !defined(__WXMSW__) || wxUSE_WXDIB
                     wxImage image(*is);
                     if ( image.Ok() )
                         winIface->SetHTMLBackgroundImage(image);
                     wxImage image(*is);
                     if ( image.Ok() )
                         winIface->SetHTMLBackgroundImage(image);
-#endif
                 }
                 }
+
+                delete fileBgImage;
             }
         }
 
             }
         }
 
@@ -406,7 +411,8 @@ TAG_HANDLER_BEGIN(SUBSUP, "SUB,SUP")
         wxHtmlCell *c = cont->GetLastChild();
 
         m_WParser->SetScriptMode(issub ? wxHTML_SCRIPT_SUB : wxHTML_SCRIPT_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);
 
         // select smaller font
         m_WParser->SetFontSize(m_WParser->GetFontSize()-2);