Merge lp:~phill-ridout/openlp/bug1098075 into lp:openlp

Proposed by Phill
Status: Merged
Approved by: Tim Bentley
Approved revision: 2170
Merged at revision: 2171
Proposed branch: lp:~phill-ridout/openlp/bug1098075
Merge into: lp:openlp
Diff against target: 60 lines (+14/-3)
4 files modified
openlp/plugins/songs/lib/__init__.py (+2/-0)
openlp/plugins/songs/lib/ewimport.py (+4/-1)
openlp/plugins/songs/lib/songproimport.py (+4/-1)
openlp/plugins/songs/lib/sundayplusimport.py (+4/-1)
To merge this branch: bzr merge lp:~phill-ridout/openlp/bug1098075
Reviewer Review Type Date Requested Status
Tim Bentley Approve
Raoul Snyman Approve
Review via email: mp+146480@code.launchpad.net

Description of the change

fixes bug 1098075 trunk version

To post a comment you must log in.
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve
Revision history for this message
Tim Bentley (trb143) :
review: Approve
Revision history for this message
Andreas Preikschat (googol-deactivatedaccount) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'openlp/plugins/songs/lib/__init__.py'
--- openlp/plugins/songs/lib/__init__.py 2013-01-18 23:31:02 +0000
+++ openlp/plugins/songs/lib/__init__.py 2013-02-04 17:50:45 +0000
@@ -571,6 +571,8 @@
571 while True:571 while True:
572 try:572 try:
573 encoding, default_encoding = get_encoding(font, font_table, default_encoding, failed=failed)573 encoding, default_encoding = get_encoding(font, font_table, default_encoding, failed=failed)
574 if not encoding:
575 return None
574 out.append(chr(charcode).decode(encoding))576 out.append(chr(charcode).decode(encoding))
575 except UnicodeDecodeError:577 except UnicodeDecodeError:
576 failed = True578 failed = True
577579
=== modified file 'openlp/plugins/songs/lib/ewimport.py'
--- openlp/plugins/songs/lib/ewimport.py 2013-01-06 17:25:49 +0000
+++ openlp/plugins/songs/lib/ewimport.py 2013-02-04 17:50:45 +0000
@@ -174,7 +174,10 @@
174 self.addAuthor(author_name.strip())174 self.addAuthor(author_name.strip())
175 if words:175 if words:
176 # Format the lyrics176 # Format the lyrics
177 words, self.encoding = strip_rtf(words, self.encoding)177 result = strip_rtf(words, self.encoding)
178 if result is None:
179 return
180 words, self.encoding = result
178 verse_type = VerseType.Tags[VerseType.Verse]181 verse_type = VerseType.Tags[VerseType.Verse]
179 for verse in SLIDE_BREAK_REGEX.split(words):182 for verse in SLIDE_BREAK_REGEX.split(words):
180 verse = verse.strip()183 verse = verse.strip()
181184
=== modified file 'openlp/plugins/songs/lib/songproimport.py'
--- openlp/plugins/songs/lib/songproimport.py 2013-01-18 23:31:02 +0000
+++ openlp/plugins/songs/lib/songproimport.py 2013-02-04 17:50:45 +0000
@@ -107,7 +107,10 @@
107 self.finish()107 self.finish()
108 return108 return
109 if u'rtf1' in text:109 if u'rtf1' in text:
110 text, self.encoding = strip_rtf(text, self.encoding)110 result = strip_rtf(text, self.encoding)
111 if result is None:
112 return
113 text, self.encoding = result
111 text = text.rstrip()114 text = text.rstrip()
112 if not text:115 if not text:
113 return116 return
114117
=== modified file 'openlp/plugins/songs/lib/sundayplusimport.py'
--- openlp/plugins/songs/lib/sundayplusimport.py 2013-01-06 17:25:49 +0000
+++ openlp/plugins/songs/lib/sundayplusimport.py 2013-02-04 17:50:45 +0000
@@ -148,7 +148,10 @@
148 verse_type = HOTKEY_TO_VERSE_TYPE[value]148 verse_type = HOTKEY_TO_VERSE_TYPE[value]
149 if name == 'rtf':149 if name == 'rtf':
150 value = self.unescape(value)150 value = self.unescape(value)
151 verse, self.encoding = strip_rtf(value, self.encoding)151 result = strip_rtf(value, self.encoding)
152 if result is None:
153 return
154 verse, self.encoding = result
152 lines = verse.strip().split('\n')155 lines = verse.strip().split('\n')
153 # If any line inside any verse contains CCLI or156 # If any line inside any verse contains CCLI or
154 # only Public Domain, we treat this as special data:157 # only Public Domain, we treat this as special data: