]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/htmlwin.cpp
Always link with expat in monolithic build.
[wxWidgets.git] / src / html / htmlwin.cpp
index 2b0e4b96cbe41d930b29a865cdf9b361ed72ce14..2ed020e48e681844b6389d9604f74d7c1eb91ab0 100644 (file)
@@ -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;
@@ -1216,7 +1214,7 @@ void wxHtmlWindow::OnSize(wxSizeEvent& event)
     {
         m_selection->Set(m_selection->GetFromCell(),
                          m_selection->GetToCell());
-        m_selection->ClearPrivPos();
+        m_selection->ClearFromToCharacterPos();
     }
 
     Refresh();
@@ -1417,7 +1415,7 @@ void wxHtmlWindow::OnInternalIdle()
                         m_selection->Set(wxPoint(x,y), selcell,
                                          m_tmpSelFromPos, m_tmpSelFromCell);
                     }
-                    m_selection->ClearPrivPos();
+                    m_selection->ClearFromToCharacterPos();
                     Refresh();
                 }
             }
@@ -1578,7 +1576,7 @@ void wxHtmlWindow::SelectLine(const wxPoint& pos)
         {
             // We use following heuristic to find a "line": let the line be all
             // cells in same container as the cell under mouse cursor that are
-            // neither completely above nor completely bellow the clicked cell
+            // neither completely above nor completely below the clicked cell
             // (i.e. are likely to be words positioned on same line of text).
 
             int y1 = cell->GetAbsPos().y;
@@ -1642,9 +1640,6 @@ void wxHtmlWindow::SelectAll()
 
 IMPLEMENT_ABSTRACT_CLASS(wxHtmlProcessor,wxObject)
 
-#if wxUSE_EXTENDED_RTTI
-IMPLEMENT_DYNAMIC_CLASS_XTI(wxHtmlWindow, wxScrolledWindow,"wx/html/htmlwin.h")
-
 wxBEGIN_PROPERTIES_TABLE(wxHtmlWindow)
 /*
     TODO PROPERTIES
@@ -1659,9 +1654,8 @@ wxBEGIN_HANDLERS_TABLE(wxHtmlWindow)
 wxEND_HANDLERS_TABLE()
 
 wxCONSTRUCTOR_5( wxHtmlWindow , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
-#else
-IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindow,wxScrolledWindow)
-#endif
+
+wxIMPLEMENT_DYNAMIC_CLASS_XTI(wxHtmlWindow, wxScrolledWindow,"wx/html/htmlwin.h")
 
 BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow)
     EVT_SIZE(wxHtmlWindow::OnSize)