From 148c04fb4119ffefd9453037de8e488eecbf73a7 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 6 Jul 2017 17:10:33 +0300 Subject: [PATCH] Fix multiline monospace pre blocks editing. Now we pass current flags and lnkIndex to the NewlineBlock, so that we don't get one multiline pre block split to separate line blocks. --- Telegram/SourceFiles/ui/text/text.cpp | 2 +- Telegram/SourceFiles/ui/text/text_block.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp index 5e3bed9fb..4d07d477b 100644 --- a/Telegram/SourceFiles/ui/text/text.cpp +++ b/Telegram/SourceFiles/ui/text/text.cpp @@ -182,7 +182,7 @@ public: emoji = 0; lastSkipped = true; } else if (newline) { - _t->_blocks.push_back(new NewlineBlock(_t->_st->font, _t->_text, blockStart, len)); + _t->_blocks.push_back(new NewlineBlock(_t->_st->font, _t->_text, blockStart, len, flags, lnkIndex)); } else { _t->_blocks.push_back(new TextBlock(_t->_st->font, _t->_text, _t->_minResizeWidth, blockStart, len, flags, lnkIndex)); } diff --git a/Telegram/SourceFiles/ui/text/text_block.h b/Telegram/SourceFiles/ui/text/text_block.h index 3d89956f9..d7d3689d8 100644 --- a/Telegram/SourceFiles/ui/text/text_block.h +++ b/Telegram/SourceFiles/ui/text/text_block.h @@ -108,7 +108,7 @@ public: } private: - NewlineBlock(const style::font &font, const QString &str, uint16 from, uint16 length) : ITextBlock(font, str, from, length, 0, 0), _nextDir(Qt::LayoutDirectionAuto) { + NewlineBlock(const style::font &font, const QString &str, uint16 from, uint16 length, uchar flags, uint16 lnkIndex) : ITextBlock(font, str, from, length, flags, lnkIndex), _nextDir(Qt::LayoutDirectionAuto) { _flags |= ((TextBlockTNewline & 0x0F) << 8); }