Bulk clearing of whitespace
This commit is contained in:
@@ -26,7 +26,7 @@ public:
|
||||
cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser4), "CompositeChat parser test 4");
|
||||
cSelfTests::Get().Register(cSelfTests::SelfTestFunction(&TestParser5), "CompositeChat parser test 5");
|
||||
}
|
||||
|
||||
|
||||
static void TestParser1(void)
|
||||
{
|
||||
cCompositeChat Msg;
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
assert_test(Parts[2]->m_Style == "@2");
|
||||
assert_test(Parts[3]->m_Style == "@2");
|
||||
}
|
||||
|
||||
|
||||
static void TestParser2(void)
|
||||
{
|
||||
cCompositeChat Msg;
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
assert_test(Parts[2]->m_Style == "@5");
|
||||
assert_test(Parts[3]->m_Style == "@5");
|
||||
}
|
||||
|
||||
|
||||
static void TestParser3(void)
|
||||
{
|
||||
cCompositeChat Msg;
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
assert_test(Parts[0]->m_Style == "");
|
||||
assert_test(Parts[1]->m_Style == "");
|
||||
}
|
||||
|
||||
|
||||
static void TestParser4(void)
|
||||
{
|
||||
cCompositeChat Msg;
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
assert_test(Parts[0]->m_Style == "");
|
||||
assert_test(Parts[1]->m_Style == "");
|
||||
}
|
||||
|
||||
|
||||
static void TestParser5(void)
|
||||
{
|
||||
cCompositeChat Msg;
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
assert_test(Parts[0]->m_PartType == cCompositeChat::ptUrl);
|
||||
assert_test(Parts[0]->m_Style == "");
|
||||
}
|
||||
|
||||
|
||||
} gTest;
|
||||
#endif // SELF_TEST
|
||||
|
||||
@@ -244,7 +244,7 @@ void cCompositeChat::ParseText(const AString & a_ParseText)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case ':':
|
||||
{
|
||||
const char * LinkPrefixes[] =
|
||||
@@ -271,7 +271,7 @@ void cCompositeChat::ParseText(const AString & a_ParseText)
|
||||
AddTextPart(CurrentText, CurrentStyle);
|
||||
CurrentText.clear();
|
||||
}
|
||||
|
||||
|
||||
// Go till the last non-whitespace char in the text:
|
||||
for (; i < len; i++)
|
||||
{
|
||||
@@ -419,7 +419,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
|
||||
AddChatPartStyle(Part, (*itr)->m_Style);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case cCompositeChat::ptClientTranslated:
|
||||
{
|
||||
const cCompositeChat::cClientTranslatedPart & p = static_cast<const cCompositeChat::cClientTranslatedPart &>(**itr);
|
||||
@@ -436,7 +436,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
|
||||
AddChatPartStyle(Part, p.m_Style);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case cCompositeChat::ptUrl:
|
||||
{
|
||||
const cCompositeChat::cUrlPart & p = static_cast<const cCompositeChat::cUrlPart &>(**itr);
|
||||
@@ -448,7 +448,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
|
||||
AddChatPartStyle(Part, p.m_Style);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case cCompositeChat::ptSuggestCommand:
|
||||
case cCompositeChat::ptRunCommand:
|
||||
{
|
||||
@@ -470,7 +470,7 @@ AString cCompositeChat::CreateJsonString(bool a_ShouldUseChatPrefixes) const
|
||||
Json::Value Ach;
|
||||
Ach["action"] = "show_achievement";
|
||||
Ach["value"] = p.m_Text;
|
||||
|
||||
|
||||
Json::Value AchColourAndName;
|
||||
AchColourAndName["color"] = "green";
|
||||
AchColourAndName["translate"] = p.m_Text;
|
||||
@@ -514,35 +514,35 @@ void cCompositeChat::AddChatPartStyle(Json::Value & a_Value, const AString & a_P
|
||||
a_Value["bold"] = Json::Value(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 'i':
|
||||
{
|
||||
// italic
|
||||
a_Value["italic"] = Json::Value(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 'u':
|
||||
{
|
||||
// Underlined
|
||||
a_Value["underlined"] = Json::Value(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 's':
|
||||
{
|
||||
// strikethrough
|
||||
a_Value["strikethrough"] = Json::Value(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 'o':
|
||||
{
|
||||
// obfuscated
|
||||
a_Value["obfuscated"] = Json::Value(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case '@':
|
||||
{
|
||||
// Color, specified by the next char:
|
||||
|
||||
Reference in New Issue
Block a user