From d86a94b3c02d7aa4f9972bd399076e13672afe0c Mon Sep 17 00:00:00 2001 From: Martin Barrett Date: Sat, 30 Jun 2012 17:11:49 +0100 Subject: [PATCH] fixes bug #986699: Print Service not separating verses --- openlp/core/ui/printserviceform.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/printserviceform.py b/openlp/core/ui/printserviceform.py index ec0993a50..833b68801 100644 --- a/openlp/core/ui/printserviceform.py +++ b/openlp/core/ui/printserviceform.py @@ -60,7 +60,7 @@ http://doc.trolltech.com/4.7/richtext-html-subset.html#css-properties } .itemText { - margin-top: 5px; + margin-top: 10px; } .itemFooter { @@ -218,7 +218,6 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): if not verse_def or verse_def != slide[u'verseTag']: text_div = self._addElement(u'div', parent=div, classId=u'itemText') - self._addElement(u'br', parent=text_div) else: self._addElement(u'br', parent=text_div) self._addElement(u'span', slide[u'html'], text_div) @@ -331,7 +330,24 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog): Copies the display text to the clipboard as plain text """ self.update_song_usage() - self.mainWindow.clipboard.setText(self.document.toPlainText()) + cursor = QtGui.QTextCursor(self.document) + cursor.select(3) + clipboard_text = cursor.selectedText () + # We now have the unprocessed unicode service text in the cursor + # So we replace u2029 with \n and u2029 with \n\n and a few others + clipboard_text = clipboard_text.replace(u'\u2028', u'\n') + clipboard_text = clipboard_text.replace(u'\u2029', u'\n\n') + clipboard_text = clipboard_text.replace(u'\u2018', u'\'') + clipboard_text = clipboard_text.replace(u'\u2019', u'\'') + clipboard_text = clipboard_text.replace(u'\u201c', u'"') + clipboard_text = clipboard_text.replace(u'\u201d', u'"') + clipboard_text = clipboard_text.replace(u'\u2026', u'...') + clipboard_text = clipboard_text.replace(u'\u2013', u'-') + clipboard_text = clipboard_text.replace(u'\u2014', u'-') + # remove the icon from the text + clipboard_text = clipboard_text.replace(u'\ufffc\xa0', u'') + # and put it all on the clipboard + self.mainWindow.clipboard.setText(clipboard_text) def copyHtmlText(self): """