X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a7b2c092b782f57a4aebd31802a9c81741f208b1..3571e1add4e6ceb45ad88c224c432609f837a8dd:/src/html/htmlwin.cpp diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 2b0e4b96cb..ceb2fac7c8 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -469,14 +469,13 @@ bool wxHtmlWindow::DoSetPage(const wxString& source) SetBackgroundImage(wxNullBitmap); m_Parser->SetDC(dc); - if (m_Cell) - { - delete m_Cell; - // notice that it's important to set m_Cell to NULL here before calling - // Parse() below, even if it will be overwritten by its return value: - // without this we may crash if it's used from inside Parse() - m_Cell = NULL; - } + + // notice that it's important to set m_Cell to NULL here before calling + // Parse() below, even if it will be overwritten by its return value as + // without this we may crash if it's used from inside Parse(), so use + // wxDELETE() and not just delete here + wxDELETE(m_Cell); + m_Cell = (wxHtmlContainerCell*) m_Parser->Parse(newsrc); delete dc; m_Cell->SetIndent(m_Borders, wxHTML_INDENT_ALL, wxHTML_UNITS_PIXELS); @@ -799,8 +798,7 @@ void wxHtmlWindow::CreateLayout() } } - - +#if wxUSE_CONFIG void wxHtmlWindow::ReadCustomization(wxConfigBase *cfg, wxString path) { wxString oldpath; @@ -853,8 +851,7 @@ void wxHtmlWindow::WriteCustomization(wxConfigBase *cfg, wxString path) if (path != wxEmptyString) cfg->SetPath(oldpath); } - - +#endif // wxUSE_CONFIG bool wxHtmlWindow::HistoryBack() { @@ -1152,6 +1149,7 @@ void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) // draw the HTML window contents dc->SetMapMode(wxMM_TEXT); dc->SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); + dc->SetLayoutDirection(GetLayoutDirection()); wxHtmlRenderingInfo rinfo; wxDefaultHtmlRenderingStyle rstyle;