+ drawSelectionAfterCell = (selstate != wxHTML_SEL_OUT);
+ }
+
+ // NB: If the text is justified then there is usually some free space
+ // between adjacent cells and drawing the selection only onto cells
+ // would result in ugly unselected spaces. The code below detects
+ // this special case and renders the selection *outside* the sell,
+ // too.
+ if ( m_Parent->GetAlignHor() == wxHTML_ALIGN_JUSTIFY &&
+ drawSelectionAfterCell )
+ {
+ wxHtmlCell *nextCell = m_Next;
+ while ( nextCell && nextCell->IsFormattingCell() )
+ nextCell = nextCell->GetNext();
+ if ( nextCell )
+ {
+ int nextX = nextCell->GetPosX();
+ if ( m_PosX + m_Width < nextX )
+ {
+ dc.SetBrush(dc.GetBackground());
+ dc.SetPen(*wxTRANSPARENT_PEN);
+ dc.DrawRectangle(x + m_PosX + m_Width, y + m_PosY,
+ nextX - m_PosX - m_Width, m_Height);
+ }
+ }
+ }
+}
+
+wxCursor wxHtmlWordCell::GetMouseCursor(wxHtmlWindowInterface *window) const
+{
+ if ( !GetLink() )
+ {
+ return window->GetHTMLCursor(wxHtmlWindowInterface::HTMLCursor_Text);
+ }
+ else
+ {
+ return wxHtmlCell::GetMouseCursor(window);
+ }
+}
+
+wxString wxHtmlWordCell::ConvertToText(wxHtmlSelection *s) const
+{
+ if ( s && (this == s->GetFromCell() || this == s->GetToCell()) )
+ {
+ wxPoint priv = this == s->GetFromCell() ? s->GetFromPrivPos()
+ : s->GetToPrivPos();
+
+ // VZ: we may be called before we had a chance to re-render ourselves
+ // and in this case GetFrom/ToPrivPos() is not set yet -- assume
+ // that this only happens in case of a double/triple click (which
+ // seems to be the case now) and so it makes sense to select the
+ // entire contents of the cell in this case
+ //
+ // TODO: but this really needs to be fixed in some better way later...
+ if ( priv != wxDefaultPosition )
+ {
+ const int part1 = priv.x;
+ const int part2 = priv.y;
+ if ( part1 == part2 )
+ return wxEmptyString;
+ return GetPartAsText(part1, part2);
+ }
+ //else: return the whole word below