Cell (row?) index not accurate after inserting new row in table

VERIFIED FIXED in M13

Status

()

Core
Layout
P3
major
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: Charles Manske, Assigned: karnaze (gone))

Tracking

Trunk
All
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
1. Open a new page in Composer
2. Create a table by clicking on Table toolbar icon. Change the number of rows
to 2 to create a 2x2 table. (This is important, default of 1 row, 2 cols
doesn't show the bug!)
is OK. Caret should be in first cell after table is inserted.
3. Use menu: Table | Insert | Row below
A new row with 2 cells is inserted, but the caret should be in the first new
cell in the second row. This seems to be a failure in getting the cell
indexes (row=1, col=0) that were stored to relocate the caret after row
insertion. Putting a breakpoints in mozilla/editor/base/EditTable.cpp
demonstrates the error: Break at
res = GetCellDataAt(table, startRowIndex, startColIndex,
res = GetCellDataAt(table, startRowIndex, startColIndex,
*getter_AddRefs(curCell), ...
(around line 250 in method InsertTableRow())
to get the address of the cell at 0,0 before the new row is inserted.
Break at:
res = CreateElementWithDefaults("td", getter_AddRefs(newCell));
to get addresses of new cells to be inserted.
Break at:
res = GetCellAt(aTable, aRow, aCol, *getter_AddRefs(cell))
in the method SetCaretAfterTableEdit() to get address of cell where the caret
should be moved to. aRow should be 1, aCol = 0. You will see that the cell
returned is same as the starting cell, thus the caret is moved as it should be.
Tracing into GetCellAt reveals error in identifying the new cell because of
an incorrect rowindex in the cell frame class.
It is curious that the caret is moved correctly to a new cell in a
newly-inserted row if the starting table has 1 row and 2 columns.
(Assignee)

Updated

18 years ago
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(Assignee)

Updated

18 years ago
Target Milestone: M13
(Assignee)

Comment 1

18 years ago
Fixed with latest checkin.

Comment 2

18 years ago
Fixed in the Feb 21 build (2000022108).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.