mirror of
https://github.com/storytold/gridcraft.git
synced 2026-11-09 03:49:54 -06:00
draw_block checked every cell against every merge meeting the block, and the fill, border and text passes searched the merge list again for each merge start, so an imported sheet with many merge ranges in a print area cost cells x merges (and merges x merges) comparisons. The merges meeting a block are now gathered once and swept down the rows: whether a cell is covered is a BTreeMap lookup among the merges active on its row, and merge starts are found through a HashMap. A merge overlapping one kept before it (only possible in a damaged file) is left out, as Excel does when it repairs the file. Hyperlink rectangles use the same index instead of scanning all sheet merges.