Changeset View
Changeset View
Standalone View
Standalone View
outputview/outputformats.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | ActionFormat::ActionFormat(int file, const QString& regExp) | 44 | ActionFormat::ActionFormat(int file, const QString& regExp) | ||
45 | : expression( regExp ) | 45 | : expression( regExp ) | ||
46 | , fileGroup( file ) | 46 | , fileGroup( file ) | ||
47 | { | 47 | { | ||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | int ErrorFormat::columnNumber(const QRegularExpressionMatch& match) const | 50 | int ErrorFormat::columnNumber(const QRegularExpressionMatch& match) const | ||
51 | { | 51 | { | ||
52 | return columnGroup >= 0 ? match.captured( columnGroup ).toInt() - 1 : 0; | 52 | return columnGroup < 0 ? 0 : std::max(match.captured(columnGroup).toInt() - 1, 0); | ||
mwolff: style: spaces after if, always use braces
overall, I'd rewrite this as:
```
return… | |||||
53 | } | 53 | } | ||
54 | 54 | | |||
55 | } | 55 | } | ||
56 | 56 | |
style: spaces after if, always use braces
overall, I'd rewrite this as: