summaryrefslogtreecommitdiffstats
path: root/gui/ModEditDialogCommon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ModEditDialogCommon.cpp')
-rw-r--r--gui/ModEditDialogCommon.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/gui/ModEditDialogCommon.cpp b/gui/ModEditDialogCommon.cpp
new file mode 100644
index 00000000..5da0a039
--- /dev/null
+++ b/gui/ModEditDialogCommon.cpp
@@ -0,0 +1,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;
+} \ No newline at end of file