Fix build in Xcode.

This commit is contained in:
John Preston 2022-11-11 22:58:51 +04:00
parent 4c8187f623
commit 97356032ac
4 changed files with 7 additions and 4 deletions

View File

@ -536,7 +536,8 @@ void InnerWidget::paintEvent(QPaintEvent *e) {
const auto reorderingPinned = (_aboveIndex >= 0) const auto reorderingPinned = (_aboveIndex >= 0)
&& !_pinnedRows.empty(); && !_pinnedRows.empty();
const auto reorderingIndex = promoted + _aboveIndex; const auto reorderingIndex = promoted + _aboveIndex;
const auto reorderingRow = (reorderingIndex < list.size()) const auto reorderingRow = (reorderingIndex >= 0
&& reorderingIndex < list.size())
? (list.cbegin() + reorderingIndex)->get() ? (list.cbegin() + reorderingIndex)->get()
: nullptr; : nullptr;
if (reorderingRow) { if (reorderingRow) {

View File

@ -198,6 +198,9 @@ private:
}; };
struct FilterResult { struct FilterResult {
FilterResult(not_null<Row*> row) : row(row) {
}
not_null<Row*> row; not_null<Row*> row;
int top = 0; int top = 0;

View File

@ -164,7 +164,7 @@ Row *List::rowAtY(int y) const {
return (top <= y && bottom > y) ? row.get() : nullptr; return (top <= y && bottom > y) ? row.get() : nullptr;
} }
List::const_iterator List::findByY(int y) const { List::iterator List::findByY(int y) const {
return ranges::lower_bound(_rows, y, ranges::less(), [](const Row *row) { return ranges::lower_bound(_rows, y, ranges::less(), [](const Row *row) {
return row->top() + row->height(); return row->top() + row->height();
}); });

View File

@ -64,8 +64,7 @@ public:
return cfind(value); return cfind(value);
} }
[[nodiscard]] iterator find(Row *value) { return cfind(value); } [[nodiscard]] iterator find(Row *value) { return cfind(value); }
[[nodiscard]] const_iterator findByY(int y) const; [[nodiscard]] iterator findByY(int y) const;
[[nodiscard]] iterator findByY(int y) { return findByY(y); }
private: private:
void adjustByName(not_null<Row*> row); void adjustByName(not_null<Row*> row);