correct wrapping of fields in cloze

This commit is contained in:
Damien Elmes 2009-03-06 05:26:40 +09:00
parent 1543f92ac4
commit cfaf9388c3

View file

@ -693,7 +693,8 @@ class FactEditor(object):
re1 = "\[" + re1 + "\]" re1 = "\[" + re1 + "\]"
re2 = "\[" + re2 + "\]" re2 = "\[" + re2 + "\]"
dst = None dst = None
for (name, (field, w)) in self.fields.items(): for field in self.fact.fields:
w = self.fields[field.name][1]
if w.hasFocus(): if w.hasFocus():
dst = False dst = False
continue continue
@ -701,7 +702,7 @@ class FactEditor(object):
dst = w dst = w
break break
if not dst: if not dst:
dst = self.fields.values()[0][1] dst = self.fields[self.fact.fields[0].name][1]
if dst == w: if dst == w:
return return
# check if there's alredy something there # check if there's alredy something there