Subject: | back_page_number uses 0-based count |
The back_page_number function returns 0-based page numbers as opposed to
the 1-based page numbers returned by next_page_number.
At page 3 of pages 1 .. 5, with no Skips, next_page_number returns 4,
back_page_number returns 1.
For consistency, the following patch makes back_page_number 1-based.
=====================================================================
--- Wizard.pm (revision 2.149)
+++ Wizard.pm (working copy)
@@ -1765,6 +1765,11 @@
sub back_page_number {
my $self = shift;
+ return $self->_back_page_number + 1;
+}
+
+sub _back_page_number {
+ my $self = shift;
my $iPage = $self->{_current_page_idx};
do {
$iPage--;
@@ -1777,7 +1782,7 @@
# honouring the Skip flags:
sub _page_backward {
my $self = shift;
- $self->{_current_page_idx} = $self->back_page_number;
+ $self->{_current_page_idx} = $self->_back_page_number;
}
=head2 prompt
=====================================================================