Adobe Acrobat: fix table cells after a row span in the last column (#21075)
Summary of the issue:
In Adobe Acrobat, when a header or cell in the last column of a tagged PDF table spans several rows (RowSpan), the next cell to reach that column is given a column number one too high. NVDA cannot navigate to that cell with table navigation commands and reports "edge of table".
A typical case is a header row where a column header with ColSpan is followed by a column header with RowSpan 2 in the last column. The first cell in the last column of the first body row is then numbered as column 7 of a 6-column table.
Cause: in nvdaHelper/vbufBackends/adobeAcrobat/adobeAcrobat.cpp, row spans were stored in TableInfo::columnRowSpans as a count of rows still to cover. That count was only decremented in handleColsSpannedByPrevRows, which runs when a later cell in a row walks past the spanned column. When no cell in a row lay to the right of the spanned column, the count was never decremented for that row, so it carried over into the next row and pushed a cell one column to the right.
Thanks to @ibromurph for the analysis posted on #21020, which reaches the same conclusion.
Description of user facing changes:
In Adobe Acrobat, cells beneath a row-spanning header or cell in the last column of a table are reported in the correct column and can be reached with table navigation commands.
Description of developer facing changes:
None.
Description of development approach:
TableInfo::columnRowSpans (column → rows still to cover) is replaced by TableInfo::columnLastSpannedRow (column → last row number covered by a span from a previous row). handleColsSpannedByPrevRows now skips a column only while the current row is within that range, so a span expires when its rows end, whether or not a later cell walks past it.
table-columncount is now taken from the highest column number used by any cell (TableInfo::maxColumnNumber) rather than from the column where the last row ends.