fixed traceback when deleting last formatting tag form the list

bzr-revno: 2032
This commit is contained in:
Andreas Preikschat 2012-07-12 21:30:16 +02:00
commit f0047bece0
1 changed files with 3 additions and 0 deletions

View File

@ -145,6 +145,9 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog):
"""
if self.selected != -1:
FormattingTags.remove_html_tag(self.selected)
# As the first items are protected we should not have to take care
# of negative indexes causing tracebacks.
self.tagTableWidget.selectRow(self.selected - 1)
self.selected = -1
FormattingTags.save_html_tags()
self._reloadTable()