diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/kvirc/ui/KviInputEditor.cpp | 8 | ||||
| -rw-r--r-- | src/kvirc/ui/KviMenuBar.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/kvirc/ui/KviInputEditor.cpp b/src/kvirc/ui/KviInputEditor.cpp index 0231bb74d..9958891e5 100644 --- a/src/kvirc/ui/KviInputEditor.cpp +++ b/src/kvirc/ui/KviInputEditor.cpp @@ -1146,7 +1146,7 @@ void KviInputEditor::showContextPopup(const QPoint & pos) std::vector<KviInputEditorSpellCheckerBlock *> lBuffer; splitTextIntoSpellCheckerBlocks(m_szTextBuffer, lBuffer); - m_iSpellCheckPosition = std::min(charIndexFromXPosition(pos.x()), m_szTextBuffer.length()); + m_iSpellCheckPosition = qMin(charIndexFromXPosition(pos.x()), m_szTextBuffer.length()); KviInputEditorSpellCheckerBlock * pCurrentBlock = findSpellCheckerBlockAtCursor(lBuffer); if(pCurrentBlock && pCurrentBlock->bSpellCheckable && (!pCurrentBlock->bCorrect)) @@ -1325,7 +1325,7 @@ void KviInputEditor::mousePressEvent(QMouseEvent * e) { if(e->button() & Qt::LeftButton) { - m_iCursorPosition = std::min(charIndexFromXPosition(e->pos().x()), m_szTextBuffer.length()); + m_iCursorPosition = qMin(charIndexFromXPosition(e->pos().x()), m_szTextBuffer.length()); m_iSelectionAnchorChar = m_iCursorPosition; clearSelection(); repaintWithCursorOn(); @@ -1675,7 +1675,7 @@ void KviInputEditor::handleDragSelection() QPoint pnt = mapFromGlobal(QCursor::pos()); - m_iCursorPosition = std::min(charIndexFromXPosition(pnt.x()), m_szTextBuffer.length()); + m_iCursorPosition = qMin(charIndexFromXPosition(pnt.x()), m_szTextBuffer.length()); if(m_iCursorPosition == m_iSelectionAnchorChar) clearSelection(); @@ -2304,7 +2304,7 @@ void KviInputEditor::completion(bool bShift) for(auto szTmp : tmp) { - szMatch.truncate(std::mismatch(szMatch.data(), szMatch.data() + std::min(szMatch.size(), szTmp.size()), szTmp.data(), predicate).first - szMatch.data()); + szMatch.truncate(std::mismatch(szMatch.data(), szMatch.data() + qMin(szMatch.size(), szTmp.size()), szTmp.data(), predicate).first - szMatch.data()); if(!szAll.isEmpty()) szAll.append(", "); diff --git a/src/kvirc/ui/KviMenuBar.cpp b/src/kvirc/ui/KviMenuBar.cpp index f0face6e5..64ae92ebf 100644 --- a/src/kvirc/ui/KviMenuBar.cpp +++ b/src/kvirc/ui/KviMenuBar.cpp @@ -384,7 +384,7 @@ void KviMenuBar::updateToolbarsPopup() int KviMenuBar::getDefaultItemRealIndex(int iDefaultIndex) { - return std::clamp(iDefaultIndex, 0, actions().count()); + return qBound(0, iDefaultIndex, actions().count()); } KviScriptMenuBarItem * KviMenuBar::findMenu(const QString & text) |
