drop events from anywhere in anki should preserve formatting

This commit is contained in:
Damien Elmes 2011-04-21 06:53:46 +09:00
parent 157801621c
commit d0c9beddfd

View file

@ -788,8 +788,8 @@ class EditorWebView(AnkiWebView):
def dropEvent(self, evt): def dropEvent(self, evt):
oldmime = evt.mimeData() oldmime = evt.mimeData()
# coming from us? # coming from this program?
if evt.source() == self: if evt.source():
# if they're copying just an image, we need to turn it into html # if they're copying just an image, we need to turn it into html
# again # again
txt = "" txt = ""
@ -800,7 +800,7 @@ class EditorWebView(AnkiWebView):
unicode(oldmime.urls()[0].toString())) unicode(oldmime.urls()[0].toString()))
mime.setHtml(txt) mime.setHtml(txt)
else: else:
mime.setText(oldmime.text()) mime.setHtml(oldmime.html())
else: else:
mime = self._processMime(oldmime) mime = self._processMime(oldmime)
# create a new event with the new mime data # create a new event with the new mime data