diff --git a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp index 230d7d7e6..5e22d2b50 100644 --- a/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp +++ b/Telegram/SourceFiles/history/admin_log/history_admin_log_inner.cpp @@ -903,7 +903,7 @@ void InnerWidget::keyPressEvent(QKeyEvent *e) { copySelectedText(); #ifdef Q_OS_MAC } else if (e->key() == Qt::Key_E && e->modifiers().testFlag(Qt::ControlModifier)) { - SetClipboardWithEntities(getSelectedText(), QClipboard::FindBuffer); + SetClipboardText(getSelectedText(), QClipboard::FindBuffer); #endif // Q_OS_MAC } else { e->ignore(); @@ -1394,7 +1394,7 @@ void InnerWidget::mouseActionFinish(const QPoint &screenPos, Qt::MouseButton but #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 if (_selectedItem && _selectedText.from != _selectedText.to) { - SetClipboardWithEntities( + SetClipboardText( _selectedItem->selectedText(_selectedText), QClipboard::Selection); } diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index 778e02552..8af07d706 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -1380,7 +1380,7 @@ void HistoryInner::mouseActionFinish( if (!_selected.empty() && _selected.cbegin()->second != FullSelection) { const auto [item, selection] = *_selected.cbegin(); if (const auto view = item->mainView()) { - SetClipboardWithEntities( + SetClipboardText( view->selectedText(selection), QClipboard::Selection); } @@ -1959,7 +1959,7 @@ void HistoryInner::keyPressEvent(QKeyEvent *e) { #ifdef Q_OS_MAC } else if (e->key() == Qt::Key_E && e->modifiers().testFlag(Qt::ControlModifier)) { - SetClipboardWithEntities(getSelectedText(), QClipboard::FindBuffer); + SetClipboardText(getSelectedText(), QClipboard::FindBuffer); #endif // Q_OS_MAC } else if (e == QKeySequence::Delete) { auto selectedState = getSelectionState(); diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index 4cf49c82e..f880e3b74 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -2035,7 +2035,7 @@ void ListWidget::mouseActionFinish( if (_selectedTextItem && _selectedTextRange.from != _selectedTextRange.to) { if (const auto view = viewForItem(_selectedTextItem)) { - SetClipboardWithEntities( + SetClipboardText( view->selectedText(_selectedTextRange), QClipboard::Selection); } diff --git a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp index a0ced347d..f4c57efc0 100644 --- a/Telegram/SourceFiles/info/media/info_media_list_widget.cpp +++ b/Telegram/SourceFiles/info/media/info_media_list_widget.cpp @@ -2031,7 +2031,7 @@ void ListWidget::mouseActionFinish( #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 //if (hasSelectedText()) { // #TODO linux clipboard - // SetClipboardWithEntities(_selected.cbegin()->first->selectedText(_selected.cbegin()->second), QClipboard::Selection); + // SetClipboardText(_selected.cbegin()->first->selectedText(_selected.cbegin()->second), QClipboard::Selection); //} #endif // Q_OS_LINUX32 || Q_OS_LINUX64 } diff --git a/Telegram/SourceFiles/ui/text/text_entity.cpp b/Telegram/SourceFiles/ui/text/text_entity.cpp index d1a063e42..1ccd0014e 100644 --- a/Telegram/SourceFiles/ui/text/text_entity.cpp +++ b/Telegram/SourceFiles/ui/text/text_entity.cpp @@ -2007,8 +2007,9 @@ EntityInText::EntityInText( int EntityInText::FirstMonospaceOffset( const EntitiesInText &entities, int textLength) { - auto &&monospace = ranges::view::all( - entities + auto &&monospace = ranges::make_iterator_range( + entities.begin(), + entities.end() ) | ranges::view::filter([](const EntityInText & entity) { return (entity.type() == EntityType::Pre) || (entity.type() == EntityType::Code); diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp index c84469dd7..54444826f 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp @@ -762,8 +762,9 @@ struct FormattingAction { QString ExpandCustomLinks(const TextWithTags &text) { const auto entities = ConvertTextTagsToEntities(text.tags); - auto &&urls = ranges::view::all( - entities + auto &&urls = ranges::make_iterator_range( + entities.begin(), + entities.end() ) | ranges::view::filter([](const EntityInText &entity) { return entity.type() == EntityType::CustomUrl; }); diff --git a/Telegram/SourceFiles/ui/widgets/labels.cpp b/Telegram/SourceFiles/ui/widgets/labels.cpp index 701906767..d5ef9184c 100644 --- a/Telegram/SourceFiles/ui/widgets/labels.cpp +++ b/Telegram/SourceFiles/ui/widgets/labels.cpp @@ -363,7 +363,7 @@ Text::StateResult FlatLabel::dragActionFinish(const QPoint &p, Qt::MouseButton b #if defined Q_OS_LINUX32 || defined Q_OS_LINUX64 if (!_selection.empty()) { - QApplication::clipboard()->setText(_text.originalText(_selection, ExpandLinksAll), QClipboard::Selection); + SetClipboardText(_text.toTextForMimeData(_selection), QClipboard::Selection); } #endif // Q_OS_LINUX32 || Q_OS_LINUX64 @@ -434,7 +434,7 @@ void FlatLabel::keyPressEvent(QKeyEvent *e) { } else if (e->key() == Qt::Key_E && e->modifiers().testFlag(Qt::ControlModifier)) { auto selection = _selection.empty() ? (_contextMenu ? _savedSelection : _selection) : _selection; if (!selection.empty()) { - QApplication::clipboard()->setText(_text.originalText(selection, ExpandLinksAll), QClipboard::FindBuffer); + SetClipboardText(_text.toTextForMimeData(selection), QClipboard::FindBuffer); } #endif // Q_OS_MAC }