TValueListEditor streaming problems
Original Reporter info from Mantis: Joost
-
Reporter name: Joost van der Sluis
Original Reporter info from Mantis: Joost
- Reporter name: Joost van der Sluis
Description:
When loading a TValueListEditor from a resource I have a 'List index (-1) out of bounds' exception.
The problem is that for the cells-property all cells are written to the .lfm. Including the cells in the FixedRows region. But when the cells are read the code expects no FixedRows within the cells-property. (FixedRows is substracted from the row-index, which leads to a reference to row -1)
I don't know how to fix this properly (Why is the cells-property streamed at all?!?) so that's what this bug-report is for. The backtrace is below.
To reproduce: drop a TValueListEditor on a form, and add two strings to the TitleCaptions-property. Then run the application.
#0 fpc_raiseexception(0x9df668, 0xffffffff, 0x7ffff7fef9c0) at ../inc/except.inc:170
#1 ERROR(0x7ffff7fef9c0, 0x9df668 'List index (%d) out of bounds', -1) at ../objpas/classes/stringl.inc:408
#2 PUT(0x7ffff7fef9c0, -1, 0x7ffff0aae358 'IDL-Type=Pascal-Type') at ../objpas/classes/stringl.inc:1056
#3 SETCELLS(0x7ffff7fca410, 0, 0, 0x7ffff0aae258 'IDL-Type') at valedit.pas:464
#4 READCELLS(0x7ffff7fca410, 0x7ffff1938700) at grids.pas:9678
#5 DEFINEPROPERTY(0x7ffff1938700, 0xb17268 'Cells', {Proc = {procedure (POINTER, TREADER)} 0x7fffffffcc28, Self = 0x7ffff7fca410}, {Proc = {procedure (POINTER, TWRITER)} 0x7fffffffcc18, Self = 0x7ffff7fca410}, true) at ../objpas/classes/reader.inc:608
#6 DEFINEPROPERTIES(0x7ffff7fca410, 0x7ffff1938700) at grids.pas:9936
#7 READPROPERTY(0x7ffff1938700, 0x7ffff7fca410) at ../objpas/classes/reader.inc:1243
#8 READDATA(0x7ffff1938700, 0x7ffff7fca410) at ../objpas/classes/reader.inc:965
#9 READSTATE(0x7ffff7fca410, 0x7ffff1938700) at ../objpas/classes/compon.inc:317
#10 READSTATE(0x7ffff7fca410, 0x7ffff1938700) at include/control.inc:3567
#11 READCOMPONENT(0x7ffff1938700, 0x0) at ../objpas/classes/reader.inc:929
#12 READDATA(0x7ffff1938700, 0x7ffff7fc5450) at ../objpas/classes/reader.inc:978
#13 READSTATE(0x7ffff7fc5450, 0x7ffff1938700) at ../objpas/classes/compon.inc:317
#14 READSTATE(0x7ffff7fc5450, 0x7ffff1938700) at include/control.inc:3567
#15 READCOMPONENT(0x7ffff1938700, 0x0) at ../objpas/classes/reader.inc:929
#16 READDATA(0x7ffff1938700, 0x7ffff7fc4c70) at ../objpas/classes/reader.inc:978
#17 READSTATE(0x7ffff7fc4c70, 0x7ffff1938700) at ../objpas/classes/compon.inc:317
#18 READSTATE(0x7ffff7fc4c70, 0x7ffff1938700) at include/control.inc:3567
#19 READROOTCOMPONENT(0x7ffff1938700, 0x7ffff7fc4c70) at ../objpas/classes/reader.inc:1437
#20 INITCOMPONENT(0x7fffffffdb70, 0x997880) at lresources.pp:3090
#21 INITLAZRESOURCECOMPONENT(0x7ffff7fc4c70, 0x98afa0) at lresources.pp:3110
#22 INITRESOURCECOMPONENT(0x7ffff7fc4c70, 0x98afa0) at lresources.pp:801
#23 CREATE(0x7ffff7fc4c70, 0x0, 0x7ffff7f8e350) at include/customform.inc:1864
#24 CREATE(0x7ffff7fc4c70, 0x1, 0x7ffff7f8e350) at include/customform.inc:2955
#25 CREATEFORM(0x7ffff7f8e350, 0x997880, 0) at include/application.inc:2166
#26 main at project1.lpr:19
Mantis conversion info:
- Mantis ID: 21480
- Version: 0.9.31 (SVN)
- Fixed in version: 0.9.31 (SVN)
- Fixed in revision: 36064 (#cd63f40b)
- Target version: 0.99.0