TCustomGrid.ScrollToCell may go into infite loop
Original Reporter info from Mantis: cobines
-
Reporter name:
Original Reporter info from Mantis: cobines
- Reporter name:
Description:
I have found that my program hangs in ScrollToCell. Unfortunately I cannot reproduce it in a small sample, but I have attached a log when compiled with "dbgGridScroll". From it you can see that Xinc is -1 at some point in the loop, then next turn it is 1, then -1, and again 1, etc. So it adds and substracts value of 1 indefinitely.
This started happening I think after commit 29202, so it is a regression from 0.9.28.
The grid has:
- Flat=True
- FixedCols=0
- FixedRows=1
- ColCount = 5
- RowCount = 21
- Options := [goFixedVertLine, goFixedHorzLine, goTabs, goRowSelect,
goColSizing, goThumbTracking, goSmoothScroll];
In the program I do:
aGrid.RowCount := 21;
aGrid.Row := 3; <- here it hangs
I'm hoping this might be enough information. Here is the log:
aCol=0 aRow=3 FixHeight=22 CHeight=87 FixWidth=0 CWidth=201
TL.C=0 TL.R=1 RNew:L=1 T=67 R=251 B=89 Xinc=1 YInc=1 ColOff=0 RowOff=0
TL.C=1 TL.R=2 RNew:L=-249 T=45 R=1 B=67 Xinc=-1 YInc=0 ColOff=0 RowOff=0
TL.C=0 TL.R=2 RNew:L=1 T=45 R=251 B=67 Xinc=1 YInc=0 ColOff=0 RowOff=0
TL.C=1 TL.R=2 RNew:L=-249 T=45 R=1 B=67 Xinc=-1 YInc=0 ColOff=0 RowOff=0
TL.C=0 TL.R=2 RNew:L=1 T=45 R=251 B=67 Xinc=1 YInc=0 ColOff=0 RowOff=0
TL.C=1 TL.R=2 RNew:L=-249 T=45 R=1 B=67 Xinc=-1 YInc=0 ColOff=0 RowOff=0
TL.C=0 TL.R=2 RNew:L=1 T=45 R=251 B=67 Xinc=1 YInc=0 ColOff=0 RowOff=0
TL.C=1 TL.R=2 RNew:L=-249 T=45 R=1 B=67 Xinc=-1 YInc=0 ColOff=0 RowOff=0
TL.C=0 TL.R=2 RNew:L=1 T=45 R=251 B=67 Xinc=1 YInc=0 ColOff=0 RowOff=0
TL.C=1 TL.R=2 RNew:L=-249 T=45 R=1 B=67 Xinc=-1 YInc=0 ColOff=0 RowOff=0
Last two lines continue indefinitely.
Mantis conversion info:
- Mantis ID: 18660
- OS: Windows XP
- OS Build: SP3
- Build: 29299
- Platform: Win32
- Version: 0.9.31 (SVN)
- Fixed in version: 0.9.31 (SVN)
- Fixed in revision: 29406 (#73701772)
- Target version: 0.9.30