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
1=== modified file 'openlp/plugins/songs/lib/__init__.py'
2--- openlp/plugins/songs/lib/__init__.py 2013-01-18 23:31:02 +0000
3+++ openlp/plugins/songs/lib/__init__.py 2013-02-04 17:50:45 +0000
4@@ -571,6 +571,8 @@
5 while True:
6 try:
7 encoding, default_encoding = get_encoding(font, font_table, default_encoding, failed=failed)
8+ if not encoding:
9+ return None
10 out.append(chr(charcode).decode(encoding))
11 except UnicodeDecodeError:
12 failed = True
13
14=== modified file 'openlp/plugins/songs/lib/ewimport.py'
15--- openlp/plugins/songs/lib/ewimport.py 2013-01-06 17:25:49 +0000
16+++ openlp/plugins/songs/lib/ewimport.py 2013-02-04 17:50:45 +0000
17@@ -174,7 +174,10 @@
18 self.addAuthor(author_name.strip())
19 if words:
20 # Format the lyrics
21- words, self.encoding = strip_rtf(words, self.encoding)
22+ result = strip_rtf(words, self.encoding)
23+ if result is None:
24+ return
25+ words, self.encoding = result
26 verse_type = VerseType.Tags[VerseType.Verse]
27 for verse in SLIDE_BREAK_REGEX.split(words):
28 verse = verse.strip()
29
30=== modified file 'openlp/plugins/songs/lib/songproimport.py'
31--- openlp/plugins/songs/lib/songproimport.py 2013-01-18 23:31:02 +0000
32+++ openlp/plugins/songs/lib/songproimport.py 2013-02-04 17:50:45 +0000
33@@ -107,7 +107,10 @@
34 self.finish()
35 return
36 if u'rtf1' in text:
37- text, self.encoding = strip_rtf(text, self.encoding)
38+ result = strip_rtf(text, self.encoding)
39+ if result is None:
40+ return
41+ text, self.encoding = result
42 text = text.rstrip()
43 if not text:
44 return
45
46=== modified file 'openlp/plugins/songs/lib/sundayplusimport.py'
47--- openlp/plugins/songs/lib/sundayplusimport.py 2013-01-06 17:25:49 +0000
48+++ openlp/plugins/songs/lib/sundayplusimport.py 2013-02-04 17:50:45 +0000
49@@ -148,7 +148,10 @@
50 verse_type = HOTKEY_TO_VERSE_TYPE[value]
51 if name == 'rtf':
52 value = self.unescape(value)
53- verse, self.encoding = strip_rtf(value, self.encoding)
54+ result = strip_rtf(value, self.encoding)
55+ if result is None:
56+ return
57+ verse, self.encoding = result
58 lines = verse.strip().split('\n')
59 # If any line inside any verse contains CCLI or
60 # only Public Domain, we treat this as special data: