| 1130 | } |
| 1131 | |
| 1132 | void MyXMLVisitor::textHandler(void* /*ctx*/, const char* str, size_t len) |
| 1133 | { |
| 1134 | std::string text(str, len); |
| 1135 | auto color = getColor(); |
| 1136 | auto face = getFace(); |
| 1137 | auto fontSize = getFontSize(); |
| 1138 | auto italics = getItalics(); |
| 1139 | auto underline = getUnderline(); |
| 1140 | auto strikethrough = getStrikethrough(); |
| 1141 | auto bold = getBold(); |
| 1142 | auto url = getURL(); |
| 1143 | auto outline = getOutline(); |
| 1144 | auto shadow = getShadow(); |
| 1145 | auto glow = getGlow(); |
| 1146 | auto name = getName(); |
| 1147 | |
| 1148 | uint32_t flags = 0; |
| 1149 | if (italics) |
| 1150 | flags |= RichElementText::ITALICS_FLAG; |
| 1151 | if (bold) |
| 1152 | flags |= RichElementText::BOLD_FLAG; |
| 1153 | if (underline) |
| 1154 | flags |= RichElementText::UNDERLINE_FLAG; |
| 1155 | if (strikethrough) |
| 1156 | flags |= RichElementText::STRIKETHROUGH_FLAG; |
| 1157 | if (!url.empty()) |
| 1158 | flags |= RichElementText::URL_FLAG; |
| 1159 | if (std::get<0>(outline)) |
| 1160 | flags |= RichElementText::OUTLINE_FLAG; |
| 1161 | if (std::get<0>(shadow)) |
| 1162 | flags |= RichElementText::SHADOW_FLAG; |
| 1163 | if (std::get<0>(glow)) |
| 1164 | flags |= RichElementText::GLOW_FLAG; |
| 1165 | |
| 1166 | auto element = RichElementText::create(0, color, 255, text, face, fontSize, flags, url, std::get<1>(outline), |
| 1167 | std::get<2>(outline), std::get<1>(shadow), std::get<2>(shadow), |
| 1168 | std::get<3>(shadow), std::get<1>(glow), name); |
| 1169 | _richText->pushBackElement(element); |
| 1170 | } |
| 1171 | |
| 1172 | void MyXMLVisitor::pushBackFontElement(const MyXMLVisitor::Attributes& attribs) |
| 1173 | { |
nothing calls this directly
no test coverage detected