X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c1bfc5da0e4a79803c87747371bcccb377899e0..f1d93f0beeec9d88f8a225aa35a9ccc163dcdb15:/src/html/htmlcell.cpp diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 845a709c1f..820fdd9cc0 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -14,7 +14,8 @@ #include "wx/wxprec.h" #include "wx/defs.h" -#if wxUSE_HTML + +#if wxUSE_HTML && wxUSE_STREAMS #ifdef __BORDLANDC__ #pragma hdrstop @@ -85,7 +86,38 @@ bool wxHtmlCell::AdjustPagebreak(int *pagebreak) const void wxHtmlCell::SetLink(const wxHtmlLinkInfo& link) { if (m_Link) delete m_Link; - m_Link = new wxHtmlLinkInfo(link); + m_Link = NULL; + if (link.GetHref() != wxEmptyString) + m_Link = new wxHtmlLinkInfo(link); +} + + + +void wxHtmlCell::Layout(int w) +{ + SetPos(0, 0); + if (m_Next) m_Next -> Layout(w); +} + + +void wxHtmlCell::Draw(wxDC& dc, int x, int y, int view_y1, int view_y2) +{ + if (m_Next) m_Next -> Draw(dc, x, y, view_y1, view_y2); +} + + + +void wxHtmlCell::DrawInvisible(wxDC& dc, int x, int y) +{ + if (m_Next) m_Next -> DrawInvisible(dc, x, y); +} + + + +const wxHtmlCell* wxHtmlCell::Find(int condition, const void* param) const +{ + if (m_Next) return m_Next -> Find(condition, param); + else return NULL; } @@ -101,7 +133,7 @@ wxHtmlWordCell::wxHtmlWordCell(const wxString& word, wxDC& dc) : wxHtmlCell() if (m_Word.Find(wxT('&')) != -1) { #define ESCSEQ(escape, subst) \ - { wxT("&"escape";"), wxT("&"escape" "), wxT(subst) } + { _T("&") _T(escape) _T(";"), _T("&") _T(escape) _T(" "), _T(subst) } static wxChar* substitutions[][3] = { ESCSEQ("quot", "\""), @@ -246,6 +278,11 @@ wxHtmlContainerCell::wxHtmlContainerCell(wxHtmlContainerCell *parent) : wxHtmlCe m_LastLayout = -1; } +wxHtmlContainerCell::~wxHtmlContainerCell() +{ + if (m_Cells) delete m_Cells; +} + void wxHtmlContainerCell::SetIndent(int i, int what, int units) @@ -403,12 +440,14 @@ void wxHtmlContainerCell::Layout(int w) int counter = 0; int step = (s_width - xpos); if (step < 0) step = 0; - while (line != cell) { + xcnt--; + if (xcnt > 0) while (line != cell) { line -> SetPos(line -> GetPosX() + s_indent + (counter++ * step / xcnt), ypos + line -> GetPosY()); line = line -> GetNext(); } + xcnt++; } ypos += ysizedown;