summaryrefslogtreecommitdiffstats
path: root/gui/ModEditDialogCommon.cpp
blob: 5da0a039508f743eeecc5e2558eb6a39fb475a8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "ModEditDialogCommon.h"

bool lastfirst (QModelIndexList & list, int & first, int & last)
{
	if(!list.size())
		return false;
	first = last = list[0].row();
	for(auto item: list)
	{
		int row = item.row();
		if(row < first)
			first = row;
		if(row > last)
			last = row;
	}
	return true;
}