fixed traceback when deleting last formatting tag form the list

This commit is contained in:
Andreas Preikschat 2012-07-11 23:05:28 +02:00
parent 3f7de39bdd
commit 0a89ddbc86

View File

@ -145,6 +145,9 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog):
""" """
if self.selected != -1: if self.selected != -1:
FormattingTags.remove_html_tag(self.selected) 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 self.selected = -1
FormattingTags.save_html_tags() FormattingTags.save_html_tags()
self._reloadTable() self._reloadTable()