mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 12:39:55 +00:00
Avoid nested ifs
This commit is contained in:
parent
c8402c0b14
commit
899c302b14
@ -298,10 +298,12 @@ int CSMWorld::IdTable::findColumnIndex(Columns::ColumnId id) const
|
|||||||
|
|
||||||
void CSMWorld::IdTable::reorderRows(int baseIndex, const std::vector<int>& newOrder)
|
void CSMWorld::IdTable::reorderRows(int baseIndex, const std::vector<int>& newOrder)
|
||||||
{
|
{
|
||||||
if (!newOrder.empty())
|
if (newOrder.empty())
|
||||||
if (mIdCollection->reorderRows(baseIndex, newOrder))
|
return;
|
||||||
emit dataChanged(index(baseIndex, 0),
|
if (!mIdCollection->reorderRows(baseIndex, newOrder))
|
||||||
index(baseIndex + static_cast<int>(newOrder.size()) - 1, mIdCollection->getColumns() - 1));
|
return;
|
||||||
|
emit dataChanged(
|
||||||
|
index(baseIndex, 0), index(baseIndex + static_cast<int>(newOrder.size()) - 1, mIdCollection->getColumns() - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::pair<CSMWorld::UniversalId, std::string> CSMWorld::IdTable::view(int row) const
|
std::pair<CSMWorld::UniversalId, std::string> CSMWorld::IdTable::view(int row) const
|
||||||
|
Loading…
x
Reference in New Issue
Block a user