Fixed Clear() crash (thx to Zbych)

git-svn-id: svn://ultimatepp.org/upp/trunk@1895 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
unodgs 2010-01-15 18:04:56 +00:00
parent 3a4e1bc772
commit 3d8aa6fd67

View file

@ -1978,6 +1978,8 @@ void GridCtrl::SyncPopup()
int y = vi.npos + p0.y - p.y - 1 - sby.Get() * int(!fr);
GetItemAttrs(it, hi.id, hi, vi, popup.style, popup.gd, popup.fg, popup.bg, popup.fnt);
popup.gd->row = -1;
popup.gd->col = -1;
Size scrsz = GetScreenSize();
int margin = popup.gd->lm + popup.gd->rm;
int cx = min(600, min((int) (scrsz.cx * 0.4), max(it.rcx + margin + 2, hi.nsize + 1)));
@ -5544,8 +5546,8 @@ void GridCtrl::Clear(bool columns)
else
{
total_height = fixed_height;
firstVisRow = fixed_rows;
lastVisRow = fixed_rows;
firstVisRow = fixed_rows - 1;
lastVisRow = fixed_rows - 1;
}
valid_cursor = false;