mirror of https://gitlab.com/pamhyr/pamhyr2
SL: Fix move down exception.
parent
a9b905a039
commit
003be29eca
|
|
@ -284,7 +284,7 @@ class SedimentLayer(SQLSubModel):
|
|||
self.delete(els)
|
||||
|
||||
def move_up(self, index):
|
||||
if index < len(self._layers):
|
||||
if index >= 0:
|
||||
next = index - 1
|
||||
|
||||
l = self._layers
|
||||
|
|
@ -293,7 +293,7 @@ class SedimentLayer(SQLSubModel):
|
|||
self._status.modified()
|
||||
|
||||
def move_down(self, index):
|
||||
if index >= 0:
|
||||
if index + 1 < len(self._layers):
|
||||
prev = index + 1
|
||||
|
||||
l = self._layers
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ class TableModel(QAbstractTableModel):
|
|||
self.layoutChanged.emit()
|
||||
|
||||
def move_down(self, row, parent=QModelIndex()):
|
||||
if row > len(self._sl):
|
||||
if row + 1 >= len(self._sl):
|
||||
return
|
||||
|
||||
target = row
|
||||
|
|
|
|||
Loading…
Reference in New Issue