This commit is contained in:
zneix 2021-07-31 22:34:47 +02:00
parent e7b89e61e8
commit 850869bb0f
No known key found for this signature in database
GPG key ID: 911916E0523B22F6
2 changed files with 6 additions and 4 deletions

View file

@ -552,8 +552,8 @@ void Notebook::performLayout(bool animated)
{ {
auto largestWidth = 0; auto largestWidth = 0;
int colStart = col * verticalRowSpace; int colStart = col * verticalRowSpace;
int colEnd = int colEnd = std::min((col + 1) * verticalRowSpace,
std::min((col + 1) * verticalRowSpace, this->items_.size()); static_cast<int>(this->items_.size()));
for (int i = colStart; i < colEnd; i++) for (int i = colStart; i < colEnd; i++)
{ {

View file

@ -486,7 +486,8 @@ void SplitInput::updateCompletionPopup()
return; return;
} }
for (int i = clamp(position, 0, text.length() - 1); i >= 0; i--) for (int i = clamp(position, 0, static_cast<int>(text.length() - 1));
i >= 0; i--)
{ {
if (text[i] == ' ') if (text[i] == ' ')
{ {
@ -560,7 +561,8 @@ void SplitInput::insertCompletionText(const QString &input_)
auto text = edit.toPlainText(); auto text = edit.toPlainText();
auto position = edit.textCursor().position(); auto position = edit.textCursor().position();
for (int i = clamp(position, 0, text.length() - 1); i >= 0; i--) for (int i = clamp(position, 0, static_cast<int>(text.length() - 1));
i >= 0; i--)
{ {
bool done = false; bool done = false;
if (text[i] == ':') if (text[i] == ':')