changeset 5094:180956b08fa2

action.Slideshow: fixed bug for no headings of level 1
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 12 Sep 2009 20:38:51 +0200
parents 939ccb653aad
children c8ea1985d348
files MoinMoin/action/SlideShow.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SlideShow.py	Sat Sep 12 20:13:29 2009 +0200
+++ b/MoinMoin/action/SlideShow.py	Sat Sep 12 20:38:51 2009 +0200
@@ -112,12 +112,18 @@
 
     def titleAt(self, number):
         """ Return the title of slide number """
-        return self.slideIndex()[number - 1][0]
+        try:
+            return self.slideIndex()[number - 1][0]
+        except IndexError:
+            return 1
 
     def bodyAt(self, number):
         """ Return the body of slide number """
-        start, end = self.slideIndex()[number - 1][1:]
-        return self.get_raw_body()[start:end]
+        try:
+            start, end = self.slideIndex()[number - 1][1:]
+            return self.get_raw_body()[start:end]
+        except IndexError:
+            return self.get_raw_body()
 
     # Private ----------------------------------------------------------------