a hack to make copying double clicked words to clipboard work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21035 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -438,14 +438,26 @@ wxString wxHtmlWordCell::ConvertToText(wxHtmlSelection *s) const
|
||||
{
|
||||
if ( s && (this == s->GetFromCell() || this == s->GetToCell()) )
|
||||
{
|
||||
wxPoint priv = (this == s->GetFromCell()) ?
|
||||
s->GetFromPrivPos() : s->GetToPrivPos();
|
||||
int part1 = priv.x;
|
||||
int part2 = priv.y;
|
||||
return m_Word.Mid(part1, part2-part1);
|
||||
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 )
|
||||
{
|
||||
int part1 = priv.x;
|
||||
int part2 = priv.y;
|
||||
return m_Word.Mid(part1, part2-part1);
|
||||
}
|
||||
//else: return the whole word below
|
||||
}
|
||||
else
|
||||
return m_Word;
|
||||
|
||||
return m_Word;
|
||||
}
|
||||
|
||||
wxCursor wxHtmlWordCell::GetCursor() const
|
||||
@@ -461,7 +473,6 @@ wxCursor wxHtmlWordCell::GetCursor() const
|
||||
}
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxHtmlContainerCell
|
||||
//-----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user