Commit 003be29e authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

SL: Fix move down exception.

Showing with 3 additions and 3 deletions
+3 -3
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment