fixed selecting part of word from right to left in wxHTML (patch #1719530)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2007-06-17 17:31:09 +00:00
parent faf75a0f58
commit 887e1ab976
2 changed files with 11 additions and 0 deletions

View File

@@ -94,6 +94,7 @@ Major new features in 2.8 release
All (GUI):
- Added colour normalization to PNM image handler (Ray Johnston)
- Fixed selecting part of word from right to left in wxHTML (Michael Hieke)
wxMSW:

View File

@@ -381,6 +381,16 @@ void wxHtmlWordCell::Split(const wxDC& dc,
wxPoint pt2 = (selTo == wxDefaultPosition) ?
wxPoint(m_Width, wxDefaultCoord) : selTo - GetAbsPos();
// if the selection is entirely within this cell, make sure pt1 < pt2 in
// order to make the rest of this function simpler:
if ( selFrom != wxDefaultPosition && selTo != wxDefaultPosition &&
selFrom.x > selTo.x )
{
wxPoint tmp = pt1;
pt1 = pt2;
pt2 = tmp;
}
unsigned len = m_Word.length();
unsigned i = 0;
pos1 = 0;