From 3bd0ad91817f29354844972cb6c3cce08d0cd5e5 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Nov 2011 18:58:46 +0000 Subject: [PATCH 1/2] Fix crash with two soft breaks --- openlp/core/lib/renderer.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 02f6970ac..bcb1f2b70 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -229,6 +229,7 @@ class Renderer(object): # Songs and Custom elif item.is_capable(ItemCapabilities.CanSoftBreak): pages = [] + # if u'[---]' in text: while True: slides = text.split(u'\n[---]\n', 2) @@ -250,7 +251,12 @@ class Renderer(object): # render the first virtual slide. text_contains_break = u'[---]' in text if text_contains_break: - text_to_render, text = text.split(u'\n[---]\n', 1) + try: + text_to_render, text = \ + text.split(u'\n[---]\n', 1) + except: + text_to_render = text.split(u'\n[---]\n')[0] + text = u'' else: text_to_render = text text = u'' From 0304057e0035d1d55209cbec99f3824932943436 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Wed, 2 Nov 2011 20:09:06 +0000 Subject: [PATCH 2/2] remove # --- openlp/core/lib/renderer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index bcb1f2b70..226e8b472 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -229,7 +229,6 @@ class Renderer(object): # Songs and Custom elif item.is_capable(ItemCapabilities.CanSoftBreak): pages = [] - # if u'[---]' in text: while True: slides = text.split(u'\n[---]\n', 2)