Skip to content

Commit

Permalink
Position coincident page marks in the correct order
Browse files Browse the repository at this point in the history
If Pg123 and Pg124 were at the same location in the file,
usually because Pg123 is blank, then when the page locations
are loaded from the bin file and positioned in the text widget
using "marks", the mark for Pg124 was inserted at the location
where Pg123's mark was, and ended up before it in the text
widget's internal list of marks.

Loading the marks in reverse order means that coincident
marks appear in alphanumeric order,  which is preferable.

This was assumed to be the case by the HTML generation
code when set to skip coincident pagenum spans. So this
fixes DistributedProofreaders#1272
  • Loading branch information
windymilla committed Nov 7, 2023
1 parent 19fcf49 commit f366b5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/Guiguts/FileMenu.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ sub file_import_markup {
sub interpretbinfile {
my $textwindow = $::textwindow;
my $markindex;
foreach my $mark ( sort keys %::pagenumbers ) {
foreach my $mark ( reverse sort keys %::pagenumbers ) {
$markindex = $::pagenumbers{$mark}{offset};
unless ($markindex) {
delete $::pagenumbers{$mark};
Expand Down

0 comments on commit f366b5e

Please sign in to comment.