| 305 | } |
| 306 | |
| 307 | void SaveCategoryData(Writer & writer, CategoryData const & categoryData, std::string const & extendedServerId, |
| 308 | std::vector<CategoryData> const * compilationData) |
| 309 | { |
| 310 | if (compilationData) |
| 311 | { |
| 312 | for (uint8_t i = 0; i < base::Underlying(PredefinedColor::Count); ++i) |
| 313 | SaveStyle(writer, GetStyleForPredefinedColor(static_cast<PredefinedColor>(i)), kIndent0); |
| 314 | |
| 315 | // Use CDATA if we have special symbols in the name. |
| 316 | if (auto name = GetDefaultLanguage(categoryData.m_name)) |
| 317 | { |
| 318 | writer << kIndent2 << "<name>"; |
| 319 | SaveStringWithCDATA(writer, *name); |
| 320 | writer << "</name>\n"; |
| 321 | } |
| 322 | |
| 323 | if (auto const description = GetDefaultLanguage(categoryData.m_description)) |
| 324 | { |
| 325 | writer << kIndent2 << "<description>"; |
| 326 | SaveStringWithCDATA(writer, *description); |
| 327 | writer << "</description>\n"; |
| 328 | } |
| 329 | |
| 330 | writer << kIndent2 << "<visibility>" << (categoryData.m_visible ? "1" : "0") << "</visibility>\n"; |
| 331 | } |
| 332 | |
| 333 | SaveCategoryExtendedData(writer, categoryData, extendedServerId, compilationData); |
| 334 | } |
| 335 | |
| 336 | void SaveBookmarkExtendedData(Writer & writer, BookmarkData const & bookmarkData) |
| 337 | { |
no test coverage detected