svgio/source/svgreader/svgtoken.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
New commits: commit 447268e5fad97b5a358cd49f01ec9431ae8226d8 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Jul 11 10:52:40 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Aug 3 21:11:36 2023 +0200 svgio: use frozen::make_unordered_map so no need to specify the count Change-Id: Id8400cba4c00439b4f4b888782d68531f7a64617 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154293 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155321 diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index 77303e65b9ce..24e24a5a31f7 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -25,7 +25,7 @@ namespace svgio::svgreader { -constexpr frozen::unordered_map<std::u16string_view, SVGToken, 146> aSVGTokenMapperList +constexpr auto aSVGTokenMapperList = frozen::make_unordered_map<std::u16string_view, SVGToken>( { { u"width", SVGToken::Width }, { u"height", SVGToken::Height }, @@ -179,11 +179,11 @@ constexpr frozen::unordered_map<std::u16string_view, SVGToken, 146> aSVGTokenMap { u"text", SVGToken::Text }, { u"baseline-shift", SVGToken::BaselineShift }, { u"flowRoot", SVGToken::FlowRoot } -}; +}); // The same elements as the map above but lowercase. CSS is case insensitive // TODO: create separate maps for css and xml elements -constexpr frozen::unordered_map<std::u16string_view, SVGToken, 146> aSVGLowerCaseTokenMapperList +constexpr auto aSVGLowerCaseTokenMapperList = frozen::make_unordered_map<std::u16string_view, SVGToken>( { { u"width", SVGToken::Width }, { u"height", SVGToken::Height }, @@ -337,7 +337,7 @@ constexpr frozen::unordered_map<std::u16string_view, SVGToken, 146> aSVGLowerCas { u"text", SVGToken::Text }, { u"baseline-shift", SVGToken::BaselineShift }, { u"flowroot", SVGToken::FlowRoot } -}; +}); static_assert(sizeof(aSVGTokenMapperList) == sizeof(aSVGLowerCaseTokenMapperList), "Number of elements in both maps must be the same");