Ok the problem appears to be that TextSelectionDumper::getText does a top-down qsort on the fragments it was passed, when they were in reading order already. The qsort here is just a relic from before the 'flow' code centralized reading-order decisions, and getText should more closely resemble the section commented 'output the page "undoing" the layout' in TextPage::dump, complicated a little by the visitor infrastructure. This looks like I can wrap it up in a unit test.
Ok the problem appears to be that TextSelectionDu mper::getText does a top-down qsort on the fragments it was passed, when they were in reading order already. The qsort here is just a relic from before the 'flow' code centralized reading-order decisions, and getText should more closely resemble the section commented 'output the page "undoing" the layout' in TextPage::dump, complicated a little by the visitor infrastructure. This looks like I can wrap it up in a unit test.