From f22e1385be9422e8178a6590d612522431f00a8d Mon Sep 17 00:00:00 2001 From: Andreas Preikschat Date: Mon, 13 Jun 2011 13:26:06 +0200 Subject: [PATCH] _paginate_slide_words detects long verses itself --- openlp/core/lib/renderer.py | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 5c80ce71c..a6db56614 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -222,21 +222,23 @@ class Renderer(object): line_end = u'
' if item.is_capable(ItemCapabilities.NoLineBreaks): line_end = u' ' - # clean up line endings - lines = self._lines_split(text) - pages = self._paginate_slide(lines, line_end) - if len(pages) > 1: - # Songs and Custom - if item.is_capable(ItemCapabilities.AllowsVirtualSplit): - # Do not forget the line breaks ! - slides = text.split(u'[---]') - pages = [] - for slide in slides: - lines = slide.strip(u'\n').split(u'\n') - pages.extend(self._paginate_slide(lines, line_end)) - # Bibles - elif item.is_capable(ItemCapabilities.AllowsWordSplit): - pages = self._paginate_slide_words(text, line_end) + # Bibles + if item.is_capable(ItemCapabilities.AllowsWordSplit): + pages = self._paginate_slide_words(text, line_end) + else: + # Clean up line endings. + lines = self._lines_split(text) + pages = self._paginate_slide(lines, line_end) + #TODO: Maybe move the detection to _paginate_slide. + if len(pages) > 1: + # Songs and Custom + if item.is_capable(ItemCapabilities.AllowsVirtualSplit): + # Do not forget the line breaks! + slides = text.split(u'[---]') + pages = [] + for slide in slides: + lines = slide.strip(u'\n').split(u'\n') + pages.extend(self._paginate_slide(lines, line_end)) new_pages = [] for page in pages: while page.endswith(u'
'):