mirror of https://github.com/procxx/kepka.git
text_entity: Add enum for used Unicode codepoints
It's better to use the named constants instead of magic character codes.
This commit is contained in:
parent
49b3469963
commit
c237414cc6
|
@ -24,6 +24,17 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||||
#include "lang/lang_tag.h"
|
#include "lang/lang_tag.h"
|
||||||
|
|
||||||
namespace TextUtilities {
|
namespace TextUtilities {
|
||||||
|
|
||||||
|
// note: these names are taken from Unicode Specification.
|
||||||
|
// All spaces in this names are replaced to SwitchingCase, all dashes ('-')
|
||||||
|
// are replaced to underscore ('_')
|
||||||
|
enum UnicodePoints
|
||||||
|
{
|
||||||
|
Left_PointingDoubleAngleQuotationMark = 171,
|
||||||
|
Right_PointingDoubleAngleQuotationMark = 187,
|
||||||
|
EmDash = 8212,
|
||||||
|
};
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
QString ExpressionDomain() {
|
QString ExpressionDomain() {
|
||||||
|
@ -2121,9 +2132,9 @@ void PrepareForSending(TextWithEntities &result, qint32 flags) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cMessageFormatting()) {
|
if (cMessageFormatting()) {
|
||||||
ReplaceStringWithChar(qstr("--"), QChar(8212), result, true);
|
ReplaceStringWithChar(qstr("--"), QChar(EmDash), result, true);
|
||||||
ReplaceStringWithChar(qstr("<<"), QChar(171), result);
|
ReplaceStringWithChar(qstr("<<"), QChar(Left_PointingDoubleAngleQuotationMark), result);
|
||||||
ReplaceStringWithChar(qstr(">>"), QChar(187), result);
|
ReplaceStringWithChar(qstr(">>"), QChar(Right_PointingDoubleAngleQuotationMark), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cReplaceEmojis()) {
|
if (cReplaceEmojis()) {
|
||||||
|
|
Loading…
Reference in New Issue