Fix #791805 (Curly brackets incorrectly converted from PDF to RTF)

This commit is contained in:
Kovid Goyal 2011-06-02 19:07:14 -06:00
commit b5d59eb1bc
2 changed files with 8 additions and 3 deletions

View File

@ -68,8 +68,13 @@ TODO:
'''
def txt2rtf(text):
# Escape { and } in the text.
text = text.replace('{', r'\'7b')
text = text.replace('}', r'\'7d')
if not isinstance(text, unicode):
return text
buf = cStringIO.StringIO()
for x in text:
val = ord(x)

View File

@ -44,9 +44,9 @@ class Customize(QFrame, Ui_Frame):
clear.clicked.connect(partial(self.clear_clicked, which=x))
def clear_clicked(self, which=0):
button = getattr(self, 'button%d'%which)
button.setText(_('None'))
setattr(self, 'shortcut%d'%which, None)
button = getattr(self, 'button%d'%which)
button.setText(_('None'))
setattr(self, 'shortcut%d'%which, None)
def custom_toggled(self, checked):
for w in ('1', '2'):