mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
Fix zero division error in spell check when list of words is empty
This commit is contained in:
parent
8daa598bb9
commit
67ba227f90
@ -857,9 +857,11 @@ class WordsView(QTableView):
|
|||||||
self.verticalHeader().close()
|
self.verticalHeader().close()
|
||||||
|
|
||||||
def change_current_word_by(self, delta=1):
|
def change_current_word_by(self, delta=1):
|
||||||
row = self.currentIndex().row()
|
rc = self.model().rowCount()
|
||||||
row = (row + delta + self.model().rowCount()) % self.model().rowCount()
|
if rc > 0:
|
||||||
self.highlight_row(row)
|
row = self.currentIndex().row()
|
||||||
|
row = (row + delta + rc) % rc
|
||||||
|
self.highlight_row(row)
|
||||||
|
|
||||||
def next_word(self):
|
def next_word(self):
|
||||||
self.change_current_word_by(1)
|
self.change_current_word_by(1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user