From 4dc2b5e7801994cbbb2049c45b886e3879b06d95 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 23 Oct 2015 22:02:29 +0200 Subject: [PATCH] temp removing 0x0B00-0x0B7F diacritics from OS X 10.11+ because of crash, see https://bugreports.qt.io/browse/QTBUG-48910 + added changelog for 0.9.7 --- Telegram/SourceFiles/application.cpp | 4 ++-- Telegram/SourceFiles/gui/flatinput.cpp | 2 +- Telegram/SourceFiles/gui/text.h | 9 ++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index f153087c49..cadabe8fa2 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -696,8 +696,8 @@ void Application::checkMapVersion() { if (Local::oldMapVersion() < AppVersion) { if (Local::oldMapVersion()) { QString versionFeatures; - if (cDevVersion() && Local::oldMapVersion() < 9004) { - versionFeatures = QString::fromUtf8("\xe2\x80\x94 New design for all modal windows\n\xe2\x80\x94 Toggle notifications from tray menu\n\xe2\x80\x94 Bug fixes and other minor improvements");// .replace('@', qsl("@") + QChar(0x200D)); + if (cDevVersion() && Local::oldMapVersion() < 9007) { + versionFeatures = QString::fromUtf8("\xe2\x80\x94 Tilde symbol display fixed\n\xe2\x80\x94 Bold and Italic text display from bots supported\n\xe2\x80\x94 Send code without text and emoji replaces using `such syntax` for inline parts and ```such syntax``` for blocks of code\n\xe2\x80\x94 Some bugfixes and improvements");// .replace('@', qsl("@") + QChar(0x200D)); } else if (Local::oldMapVersion() < 9005) { versionFeatures = lang(lng_new_version_text).trimmed(); } else { diff --git a/Telegram/SourceFiles/gui/flatinput.cpp b/Telegram/SourceFiles/gui/flatinput.cpp index 73eb5010f3..098522c818 100644 --- a/Telegram/SourceFiles/gui/flatinput.cpp +++ b/Telegram/SourceFiles/gui/flatinput.cpp @@ -535,10 +535,10 @@ _maxLength(-1), _inner(this), _oldtext(val), +_ctrlEnterSubmit(CtrlEnterSubmitCtrlEnter), _undoAvailable(false), _redoAvailable(false), _inHeightCheck(false), -_ctrlEnterSubmit(CtrlEnterSubmitCtrlEnter), _customUpDown(false), diff --git a/Telegram/SourceFiles/gui/text.h b/Telegram/SourceFiles/gui/text.h index a7c76448dd..a79169b128 100644 --- a/Telegram/SourceFiles/gui/text.h +++ b/Telegram/SourceFiles/gui/text.h @@ -689,8 +689,11 @@ const QChar *textSkipCommand(const QChar *from, const QChar *end, bool canLink = inline bool chIsSpace(QChar ch, bool rich = false) { return ch.isSpace() || (ch < 32 && !(rich && ch == TextCommand)) || (ch == QChar::ParagraphSeparator) || (ch == QChar::LineSeparator) || (ch == QChar::ObjectReplacementCharacter) || (ch == QChar::SoftHyphen) || (ch == QChar::CarriageReturn) || (ch == QChar::Tabulation); } +inline bool chIsDiac(QChar ch) { // diac and variation selectors + return (ch.category() == QChar::Mark_NonSpacing) || (ch.unicode() == 1652); +} inline bool chIsBad(QChar ch) { - return (ch == 0) || (ch >= 8232 && ch < 8237) || (ch >= 65024 && ch < 65040 && ch != 65039) || (ch >= 127 && ch < 160 && ch != 156); + return (ch == 0) || (ch >= 8232 && ch < 8237) || (ch >= 65024 && ch < 65040 && ch != 65039) || (ch >= 127 && ch < 160 && ch != 156) || (cPlatform() == dbipMac && ch >= 0x0B00 && ch <= 0x0B7F && chIsDiac(ch) && QSysInfo::macVersion() >= QSysInfo::MV_10_11); // tmp hack see https://bugreports.qt.io/browse/QTBUG-48910 } inline bool chIsTrimmed(QChar ch, bool rich = false) { return (!rich || ch != TextCommand) && (chIsSpace(ch) || chIsBad(ch)); @@ -704,10 +707,6 @@ inline bool chReplacedBySpace(QChar ch) { return (/*code >= 0x00 && */ch <= 0x02) || (ch >= 0x07 && ch <= 0x09) || (ch >= 0x0b && ch <= 0x1f) || (ch == 819) || (ch == 831) || (ch == 778) || (ch >= 8232 && ch <= 8237); } -inline bool chIsDiac(QChar ch) { // diac and variation selectors - QChar::Category c = ch.category(); - return (c == QChar::Mark_NonSpacing) || (ch.unicode() == 1652); -} inline int32 chMaxDiacAfterSymbol() { return 2; }