Switch pages before removing current page

If we are asked to remove the current page, we should first switch to a
different page.
This commit is contained in:
Bryan Schumaker 2010-11-30 21:21:54 -05:00
parent 537e258ffe
commit f1f2b49966
1 changed files with 2 additions and 0 deletions

View File

@ -82,6 +82,8 @@ def remove_page(name):
if page == None:
return
n = body.page_num(page)
if n == body.get_current_page():
body.set_current_page(n - 1)
body.remove_page(n)
del contents[name]