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-07-11 16:44:07 +0200
commitcf07373d84b0ad6d0110b62966705b3e101785b5 (patch)
tree6951a3da18bace5d7880c812ddf66b7008030773 /svgio
parent92b6ffcd9f687cc54a0fc3801ca85c7e4d77512f (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>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/source/svgreader/svgtoken.cxx8
-rw-r--r--svgio/source/svgreader/svgtools.cxx4
2 files changed, 6 insertions, 6 deletions
diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx
index 0d77ca901ee8..d5222a2df125 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, 145> aSVGTokenMapperList
+constexpr auto aSVGTokenMapperList = frozen::make_unordered_map<std::u16string_view, SVGToken>(
{
{ u"width", SVGToken::Width },
{ u"height", SVGToken::Height },
@@ -178,11 +178,11 @@ constexpr frozen::unordered_map<std::u16string_view, SVGToken, 145> 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, 145> aSVGLowerCaseTokenMapperList
+constexpr auto aSVGLowerCaseTokenMapperList = frozen::make_unordered_map<std::u16string_view, SVGToken>(
{
{ u"width", SVGToken::Width },
{ u"height", SVGToken::Height },
@@ -335,7 +335,7 @@ constexpr frozen::unordered_map<std::u16string_view, SVGToken, 145> 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");
diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx
index ce8b4f99bd62..e76d8ae4b448 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -32,7 +32,7 @@
namespace svgio::svgreader
{
- constexpr frozen::unordered_map<std::u16string_view, Color, 147> aColorTokenMapperList
+ constexpr auto aColorTokenMapperList = frozen::make_unordered_map<std::u16string_view, Color>(
{
{ u"aliceblue", Color(240, 248, 255) },
{ u"antiquewhite", Color(250, 235, 215) },
@@ -181,7 +181,7 @@ namespace svgio::svgreader
{ u"whitesmoke", Color(245, 245, 245) },
{ u"yellow", Color(255, 255, 0) },
{ u"yellowgreen", Color(154, 205, 50) }
- };
+ });
basegfx::B2DHomMatrix SvgAspectRatio::createLinearMapping(const basegfx::B2DRange& rTarget, const basegfx::B2DRange& rSource)
{