summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-07-11 10:52:40 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-08-03 21:11:36 +0200
commit447268e5fad97b5a358cd49f01ec9431ae8226d8 (patch)
tree08f664a509a79da95541d0e455fcd78e899c8771 /svgio
parentd3a8c3d5a6db298d427999b84a474c982c26e6dd (diff)
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 <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155321
Diffstat (limited to 'svgio')
-rw-r--r--svgio/source/svgreader/svgtoken.cxx8
1 files changed, 4 insertions, 4 deletions
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");