Fix #1205 Fix calculation of current page
Merge pull request #410 from nlegoff/fix_1205

[3.8] Fix #1205 Fix calculation of current page