Commit 4bfce4d0 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Fixes for merged rows

parent dffceed3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -398,6 +398,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
						if len(cellsContent) <= numberOfColumns: # Colspan: Positions of | with respect to + need to be determined
							columnCellIndex = 0

							maxRowsTracker = max(rowsTracker)
							# Go through all cells in a columnt
							for columnIndex, content in enumerate(cellsContent):
								rowIndex = rowsTracker[columnCellIndex]
@@ -405,7 +406,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR

								# Check whether a cell contains a header separator
								if matchGridTableBodySeparatorLine.match(content):  # A new row is to be added
									rowsTracker[columnCellIndex] = max(rowsTracker) + 1	# That actual row will have more than one row
									rowsTracker[columnCellIndex] = maxRowsTracker + 1	# That actual row will have more than one row
									cell.listFlag = False
									columnForward = 0
								
@@ -413,7 +414,7 @@ def parseGridTableWithSpans(gridTable:str) -> tuple[GridTableRowList, GridTableR
										rowIndex = rowsTracker[columnCellIndex]	# Correcting the rowIndex. Might have been changed by a previous iteration
										if rows[rowIndex][columnCellIndex].position >= delimiterPositions[delIndex]:
											columnForward += 1
											rowsTracker[columnCellIndex + columnForward - 1] = max(rowsTracker) + 1 if columnForward > 1 else 0
											rowsTracker[columnCellIndex + columnForward - 1] = maxRowsTracker + 1 if columnForward > 1 else 0
									columnCellIndex += columnForward

									continue