Makefile.fetch                                     |    1 
 RepositoryExternal.mk                              |   10 
 download.lst                                       |    5 
 external/Module_external.mk                        |    1 
 external/frozen/Module_frozen.mk                   |   16 
 external/frozen/README.md                          |    7 
 external/frozen/UnpackedTarball_frozen.mk          |   18 
 external/frozen/defines_h_constexpr_string.patch.0 |   11 
 svgio/Library_svgio.mk                             |    5 
 svgio/source/svgreader/svgtoken.cxx                |  538 ++++++++-------------
 10 files changed, 283 insertions(+), 329 deletions(-)

New commits:
commit 215454b5f9327093608aba5fc08ef1c27bf019df
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Mon Jul 25 15:38:24 2022 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sat Jun 17 12:31:17 2023 +0200

    svgio: use "frozen" for mapping between token strings and enums
    
    Change-Id: I2061606146cfcb34169dccf69b6f720727839d04
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153174
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/svgio/Library_svgio.mk b/svgio/Library_svgio.mk
index 6221cb141316..76c0e87123bb 100644
--- a/svgio/Library_svgio.mk
+++ b/svgio/Library_svgio.mk
@@ -25,7 +25,10 @@ $(eval $(call gb_Library_set_include,svgio,\
     -I$(SRCDIR)/svgio/inc \
 ))
 
-$(eval $(call gb_Library_use_external,svgio,boost_headers))
+$(eval $(call gb_Library_use_externals,svgio,\
+    boost_headers \
+    frozen \
+))
 
 $(eval $(call 
gb_Library_set_precompiled_header,svgio,svgio/inc/pch/precompiled_svgio))
 
diff --git a/svgio/source/svgreader/svgtoken.cxx 
b/svgio/source/svgreader/svgtoken.cxx
index 09ed13459b2e..45af658b1ebd 100644
--- a/svgio/source/svgreader/svgtoken.cxx
+++ b/svgio/source/svgreader/svgtoken.cxx
@@ -18,359 +18,241 @@
  */
 
 #include <svgtoken.hxx>
-#include <unordered_map>
+#include <frozen/bits/defines.h>
+#include <frozen/bits/elsa_std.h>
+#include <frozen/unordered_map.h>
 
 namespace svgio::svgreader
 {
-        const char aSVGStrWidth[] = "width";
-        const char aSVGStrHeight[] = "height";
-        const char aSVGStrViewBox[] = "viewBox";
-        const char aSVGStrTransform[] = "transform";
-        const char aSVGStrStyle[] = "style";
-        const char aSVGStrDisplay[] = "display"; // #i121656#
-        const char aSVGStrD[] = "d";
-        const char aSVGStrX[] = "x";
-        const char aSVGStrY[] = "y";
-        const char aSVGStrXmlns[] = "xmlns";
-        const char aSVGStrVersion[] = "version";
-        const char aSVGStrId[] = "id";
-        const char aSVGStrIn[] = "in";
-        const char aSVGStrRx[] = "rx";
-        const char aSVGStrRy[] = "ry";
-        const char aSVGStrPoints[] = "points";
-        const char aSVGStrDx[] = "dx";
-        const char aSVGStrDy[] = "dy";
-        const char aSVGStrRotate[] = "rotate";
-        const char aSVGStrTextLength[] = "textLength";
-        const char aSVGStrLengthAdjust[] = "lengthAdjust";
-        const char aSVGStrFont[] = "font";
-        const char aSVGStrFontFamily[] = "font-family";
-        const char aSVGStrFontSize[] = "font-size";
-        const char aSVGStrFontSizeAdjust[] = "font-size-adjust";
-        const char aSVGStrFontStretch[] = "font-stretch";
-        const char aSVGStrFontStyle[] = "font-style";
-        const char aSVGStrFontVariant[] = "font-variant";
-        const char aSVGStrFontWeight[] = "font-weight";
-        const char aSVGStrDirection[] = "direction";
-        const char aSVGStrLetterSpacing[] = "letter-spacing";
-        const char aSVGStrTextDecoration[] = "text-decoration";
-        const char aSVGStrUnicodeBidi[] = "unicode-bidi";
-        const char aSVGStrWordSpacing[] = "word-spacing";
-        const char aSVGStrTspan[] = "tspan";
-        const char aSVGStrTref[] = "tref";
-        const char aSVGStrTextPath[] = "textPath";
-        const char aSVGStrStartOffset[] = "startOffset";
-        const char aSVGStrMethod[] = "method";
-        const char aSVGStrSpacing[] = "spacing";
-        const char aSVGStrStdDeviation[] = "stdDeviation";
-        const char aSVGStrTextAlign[] = "text-align";
-        const char aSVGStrPathLength[] = "pathLength";
-        const char aSVGStrType[] = "type";
-        const char aSVGStrClass[] = "class";
-        const char aSVGStrTextAnchor[] = "text-anchor";
-        const char aSVGStrXmlSpace[] = "xml:space";
-        const char aSVGStrColor[] = "color";
-        const char aSVGStrClipPathNode[] = "clipPath";
-        const char aSVGStrClipPathProperty[] = "clip-path";
-        const char aSVGStrFeGaussianBlur[] = "feGaussianBlur";
-        const char aSVGStrFeColorMatrix[] = "feColorMatrix";
-        const char aSVGStrFilter[] = "filter";
-        const char aSVGStrMask[] = "mask";
-        const char aSVGStrClipPathUnits[] = "clipPathUnits";
-        const char aSVGStrMaskUnits[] = "maskUnits";
-        const char aSVGStrMaskContentUnits[] = "maskContentUnits";
-        const char aSVGStrClipRule[] = "clip-rule";
-        const char aSVGStrMarker[] = "marker";
-        const char aSVGStrMarkerStart[] = "marker-start";
-        const char aSVGStrMarkerMid[] = "marker-mid";
-        const char aSVGStrMarkerEnd[] = "marker-end";
-        const char aSVGStrRefX[] = "refX";
-        const char aSVGStrRefY[] = "refY";
-        const char aSVGStrMarkerUnits[] = "markerUnits";
-        const char aSVGStrMarkerWidth[] = "markerWidth";
-        const char aSVGStrMarkerHeight[] = "markerHeight";
-        const char aSVGStrOrient[] = "orient";
-        const char aSVGStrPattern[] = "pattern";
-        const char aSVGStrPatternUnits[] = "patternUnits";
-        const char aSVGStrPatternContentUnits[] = "patternContentUnits";
-        const char aSVGStrPatternTransform[] = "patternTransform";
-        const char aSVGStrOpacity[] = "opacity";
-        const char aSVGStrVisibility[] = "visibility";
-        constexpr OUStringLiteral aSVGStrTitle = u"title";
-        constexpr OUStringLiteral aSVGStrDesc = u"desc";
 
-        const char aSVGStrPreserveAspectRatio[] = "preserveAspectRatio";
-        const char aSVGStrDefer[] = "defer";
-        const char aSVGStrNone[] = "none";
-        const char aSVGStrXMinYMin[] = "xMinYMin";
-        const char aSVGStrXMidYMin[] = "xMidYMin";
-        const char aSVGStrXMaxYMin[] = "xMaxYMin";
-        const char aSVGStrXMinYMid[] = "xMinYMid";
-        const char aSVGStrXMidYMid[] = "xMidYMid";
-        const char aSVGStrXMaxYMid[] = "xMaxYMid";
-        const char aSVGStrXMinYMax[] = "xMinYMax";
-        const char aSVGStrXMidYMax[] = "xMidYMax";
-        const char aSVGStrXMaxYMax[] = "xMaxYMax";
-        const char aSVGStrMeet[] = "meet";
-        const char aSVGStrSlice[] = "slice";
-        const char aSVGStrValues[] = "values";
+constexpr const std::u16string_view constToken_Title = u"title";
+constexpr const std::u16string_view constToken_Desc = u"desc";
 
-        const char aSVGStrDefs[] = "defs";
-        const char aSVGStrG[] = "g";
-        const char aSVGStrSvg[] = "svg";
-        const char aSVGStrSymbol[] = "symbol";
-        const char aSVGStrUse[] = "use";
-        const char aSVGStrA[] = "a";
-
-        const char aSVGStrCircle[] = "circle";
-        const char aSVGStrEllipse[] = "ellipse";
-        const char aSVGStrLine[] = "line";
-        const char aSVGStrPath[] = "path";
-        const char aSVGStrPolygon[] = "polygon";
-        const char aSVGStrPolyline[] = "polyline";
-        const char aSVGStrRect[] = "rect";
-        const char aSVGStrImage[] = "image";
-
-        const char aSVGStrLinearGradient[] = "linearGradient";
-        const char aSVGStrRadialGradient[] = "radialGradient";
-        const char aSVGStrStop[] = "stop";
-        const char aSVGStrOffset[] = "offset";
-        const char aSVGStrX1[] = "x1";
-        const char aSVGStrY1[] = "y1";
-        const char aSVGStrX2[] = "x2";
-        const char aSVGStrY2[] = "y2";
-        const char aSVGStrCx[] = "cx";
-        const char aSVGStrCy[] = "cy";
-        const char aSVGStrFx[] = "fx";
-        const char aSVGStrFy[] = "fy";
-        const char aSVGStrR[] = "r";
-        const char aSVGStrGradientUnits[] = "gradientUnits";
-        const char aSVGStrGradientTransform[] = "gradientTransform";
-        const char aSVGStrSpreadMethod[] = "spreadMethod";
-        const char aSVGStrHref[] = "href";
-        const char aSVGStrXlinkHref[] = "xlink:href";
-        const char aSVGStrStopColor[] = "stop-color";
-        const char aSVGStrStopOpacity[] = "stop-opacity";
-
-        const char aSVGStrFill[] = "fill";
-        const char aSVGStrFillOpacity[] = "fill-opacity";
-        const char aSVGStrFillRule[] = "fill-rule";
-
-        const char aSVGStrStroke[] = "stroke";
-        const char aSVGStrStrokeDasharray[] = "stroke-dasharray";
-        const char aSVGStrStrokeDashoffset[] = "stroke-dashoffset";
-        const char aSVGStrStrokeLinecap[] = "stroke-linecap";
-        const char aSVGStrStrokeLinejoin[] = "stroke-linejoin";
-        const char aSVGStrStrokeMiterlimit[] = "stroke-miterlimit";
-        const char aSVGStrStrokeOpacity[] = "stroke-opacity";
-        const char aSVGStrStrokeWidth[] = "stroke-width";
+constexpr frozen::unordered_map<std::u16string_view, SVGToken, 139> 
aSVGTokenMapperList
+{
+    { u"width", SVGToken::Width },
+    { u"height", SVGToken::Height },
+    { u"viewBox", SVGToken::ViewBox },
+    { u"transform", SVGToken::Transform },
+    { u"style", SVGToken::Style },
+    { u"display", SVGToken::Display }, // #i121656#
+    { u"d", SVGToken::D },
+    { u"x", SVGToken::X },
+    { u"y", SVGToken::Y },
+    { u"xmlns", SVGToken::Xmlns },
+    { u"version", SVGToken::Version },
+    { u"id", SVGToken::Id },
+    { u"in", SVGToken::In },
+    { u"rx", SVGToken::Rx },
+    { u"ry", SVGToken::Ry },
+    { u"points", SVGToken::Points },
+    { u"dx", SVGToken::Dx },
+    { u"dy", SVGToken::Dy },
+    { u"rotate", SVGToken::Rotate },
+    { u"textLength", SVGToken::TextLength },
+    { u"lengthAdjust", SVGToken::LengthAdjust },
+    { u"font", SVGToken::Font },
+    { u"font-family", SVGToken::FontFamily },
+    { u"font-size", SVGToken::FontSize },
+    { u"font-size-adjust", SVGToken::FontSizeAdjust },
+    { u"font-stretch", SVGToken::FontStretch },
+    { u"font-style", SVGToken::FontStyle },
+    { u"font-variant", SVGToken::FontVariant },
+    { u"font-weight", SVGToken::FontWeight },
+    { u"direction", SVGToken::Direction },
+    { u"letter-spacing", SVGToken::LetterSpacing },
+    { u"text-decoration", SVGToken::TextDecoration },
+    { u"unicode-bidi", SVGToken::UnicodeBidi },
+    { u"word-spacing", SVGToken::WordSpacing },
+    { u"tspan", SVGToken::Tspan },
+    { u"tref", SVGToken::Tref },
+    { u"textPath", SVGToken::TextPath },
+    { u"startOffset", SVGToken::StartOffset },
+    { u"method", SVGToken::Method },
+    { u"spacing", SVGToken::Spacing },
+    { u"stdDeviation", SVGToken::StdDeviation },
+    { u"text-align", SVGToken::TextAlign },
+    { u"pathLength", SVGToken::PathLength },
+    { u"type", SVGToken::Type },
+    { u"class", SVGToken::Class },
+    { u"text-anchor", SVGToken::TextAnchor },
+    { u"xml:space", SVGToken::XmlSpace },
+    { u"color", SVGToken::Color },
+    { u"clipPath", SVGToken::ClipPathNode },
+    { u"clip-path", SVGToken::ClipPathProperty },
+    { u"feGaussianBlur", SVGToken::FeGaussianBlur },
+    { u"feColorMatrix", SVGToken::FeColorMatrix },
+    { u"filter", SVGToken::Filter },
+    { u"mask", SVGToken::Mask },
+    { u"clipPathUnits", SVGToken::ClipPathUnits },
+    { u"maskUnits", SVGToken::MaskUnits },
+    { u"maskContentUnits", SVGToken::MaskContentUnits },
+    { u"clip-rule", SVGToken::ClipRule },
+    { u"marker", SVGToken::Marker },
+    { u"marker-start", SVGToken::MarkerStart },
+    { u"marker-mid", SVGToken::MarkerMid },
+    { u"marker-end", SVGToken::MarkerEnd },
+    { u"refX", SVGToken::RefX },
+    { u"refY", SVGToken::RefY },
+    { u"markerUnits", SVGToken::MarkerUnits },
+    { u"markerWidth", SVGToken::MarkerWidth },
+    { u"markerHeight", SVGToken::MarkerHeight },
+    { u"orient", SVGToken::Orient },
+    { u"pattern", SVGToken::Pattern },
+    { u"patternUnits", SVGToken::PatternUnits },
+    { u"patternContentUnits", SVGToken::PatternContentUnits },
+    { u"patternTransform", SVGToken::PatternTransform },
+    { u"opacity", SVGToken::Opacity },
+    { u"visibility", SVGToken::Visibility },
+    { constToken_Title, SVGToken::Title },
+    { constToken_Desc, SVGToken::Desc },
+    { u"preserveAspectRatio", SVGToken::PreserveAspectRatio },
+    { u"defer", SVGToken::Defer },
+    { u"none", SVGToken::None },
+    { u"xMinYMin", SVGToken::XMinYMin },
+    { u"xMidYMin", SVGToken::XMidYMin },
+    { u"xMaxYMin", SVGToken::XMaxYMin },
+    { u"xMinYMid", SVGToken::XMinYMid },
+    { u"xMidYMid", SVGToken::XMidYMid },
+    { u"xMaxYMid", SVGToken::XMaxYMid },
+    { u"xMinYMax", SVGToken::XMinYMax },
+    { u"xMidYMax", SVGToken::XMidYMax },
+    { u"xMaxYMax", SVGToken::XMaxYMax },
+    { u"meet", SVGToken::Meet },
+    { u"slice", SVGToken::Slice },
+    { u"values", SVGToken::Values },
 
-        const char aSVGStrText[] = "text";
-        const char aSVGStrBaselineShift[] = "baseline-shift";
+    { u"defs", SVGToken::Defs },
+    { u"g", SVGToken::G },
+    { u"svg", SVGToken::Svg },
+    { u"symbol", SVGToken::Symbol },
+    { u"use", SVGToken::Use },
+    { u"a", SVGToken::A },
 
-        const char aSVGStrFlowRoot[] = "flowRoot";
+    { u"circle", SVGToken::Circle },
+    { u"ellipse", SVGToken::Ellipse },
+    { u"line", SVGToken::Line },
+    { u"path", SVGToken::Path },
+    { u"polygon", SVGToken::Polygon },
+    { u"polyline", SVGToken::Polyline },
+    { u"rect", SVGToken::Rect },
+    { u"image", SVGToken::Image },
 
-        SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent)
-        {
-            typedef std::unordered_map< OUString, SVGToken > SVGTokenMapper;
-            typedef std::pair< OUString, SVGToken > SVGTokenValueType;
-            static SVGTokenMapper aSVGTokenMapperList {
-                { aSVGStrWidth, SVGToken::Width },
-                { aSVGStrHeight, SVGToken::Height },
-                { aSVGStrViewBox, SVGToken::ViewBox },
-                { aSVGStrTransform, SVGToken::Transform },
-                { aSVGStrStyle, SVGToken::Style },
-                { aSVGStrDisplay, SVGToken::Display }, // #i121656#
-                { aSVGStrD, SVGToken::D },
-                { aSVGStrX, SVGToken::X },
-                { aSVGStrY, SVGToken::Y },
-                { aSVGStrXmlns, SVGToken::Xmlns },
-                { aSVGStrVersion, SVGToken::Version },
-                { aSVGStrId, SVGToken::Id },
-                { aSVGStrIn, SVGToken::In },
-                { aSVGStrRx, SVGToken::Rx },
-                { aSVGStrRy, SVGToken::Ry },
-                { aSVGStrPoints, SVGToken::Points },
-                { aSVGStrDx, SVGToken::Dx },
-                { aSVGStrDy, SVGToken::Dy },
-                { aSVGStrRotate, SVGToken::Rotate },
-                { aSVGStrTextLength, SVGToken::TextLength },
-                { aSVGStrLengthAdjust, SVGToken::LengthAdjust },
-                { aSVGStrFont, SVGToken::Font },
-                { aSVGStrFontFamily, SVGToken::FontFamily },
-                { aSVGStrFontSize, SVGToken::FontSize },
-                { aSVGStrFontSizeAdjust, SVGToken::FontSizeAdjust },
-                { aSVGStrFontStretch, SVGToken::FontStretch },
-                { aSVGStrFontStyle, SVGToken::FontStyle },
-                { aSVGStrFontVariant, SVGToken::FontVariant },
-                { aSVGStrFontWeight, SVGToken::FontWeight },
-                { aSVGStrDirection, SVGToken::Direction },
-                { aSVGStrLetterSpacing, SVGToken::LetterSpacing },
-                { aSVGStrTextDecoration, SVGToken::TextDecoration },
-                { aSVGStrUnicodeBidi, SVGToken::UnicodeBidi },
-                { aSVGStrWordSpacing, SVGToken::WordSpacing },
-                { aSVGStrTspan, SVGToken::Tspan },
-                { aSVGStrTref, SVGToken::Tref },
-                { aSVGStrTextPath, SVGToken::TextPath },
-                { aSVGStrStartOffset, SVGToken::StartOffset },
-                { aSVGStrMethod, SVGToken::Method },
-                { aSVGStrSpacing, SVGToken::Spacing },
-                { aSVGStrStdDeviation, SVGToken::StdDeviation },
-                { aSVGStrTextAlign, SVGToken::TextAlign },
-                { aSVGStrPathLength, SVGToken::PathLength },
-                { aSVGStrType, SVGToken::Type },
-                { aSVGStrClass, SVGToken::Class },
-                { aSVGStrTextAnchor, SVGToken::TextAnchor },
-                { aSVGStrXmlSpace, SVGToken::XmlSpace },
-                { aSVGStrColor, SVGToken::Color },
-                { aSVGStrClipPathNode, SVGToken::ClipPathNode },
-                { aSVGStrClipPathProperty, SVGToken::ClipPathProperty },
-                { aSVGStrFeGaussianBlur, SVGToken::FeGaussianBlur },
-                { aSVGStrFeColorMatrix, SVGToken::FeColorMatrix },
-                { aSVGStrFilter, SVGToken::Filter },
-                { aSVGStrMask, SVGToken::Mask },
-                { aSVGStrClipPathUnits, SVGToken::ClipPathUnits },
-                { aSVGStrMaskUnits, SVGToken::MaskUnits },
-                { aSVGStrMaskContentUnits, SVGToken::MaskContentUnits },
-                { aSVGStrClipRule, SVGToken::ClipRule },
-                { aSVGStrMarker, SVGToken::Marker },
-                { aSVGStrMarkerStart, SVGToken::MarkerStart },
-                { aSVGStrMarkerMid, SVGToken::MarkerMid },
-                { aSVGStrMarkerEnd, SVGToken::MarkerEnd },
-                { aSVGStrRefX, SVGToken::RefX },
-                { aSVGStrRefY, SVGToken::RefY },
-                { aSVGStrMarkerUnits, SVGToken::MarkerUnits },
-                { aSVGStrMarkerWidth, SVGToken::MarkerWidth },
-                { aSVGStrMarkerHeight, SVGToken::MarkerHeight },
-                { aSVGStrOrient, SVGToken::Orient },
-                { aSVGStrPattern, SVGToken::Pattern },
-                { aSVGStrPatternUnits, SVGToken::PatternUnits },
-                { aSVGStrPatternContentUnits, SVGToken::PatternContentUnits },
-                { aSVGStrPatternTransform, SVGToken::PatternTransform },
-                { aSVGStrOpacity, SVGToken::Opacity },
-                { aSVGStrVisibility, SVGToken::Visibility },
-                { aSVGStrTitle, SVGToken::Title },
-                { aSVGStrDesc, SVGToken::Desc },
+    { u"linearGradient", SVGToken::LinearGradient },
+    { u"radialGradient", SVGToken::RadialGradient },
+    { u"stop", SVGToken::Stop },
+    { u"offset", SVGToken::Offset },
+    { u"x1", SVGToken::X1 },
+    { u"y1", SVGToken::Y1 },
+    { u"x2", SVGToken::X2 },
+    { u"y2", SVGToken::Y2 },
+    { u"cx", SVGToken::Cx },
+    { u"cy", SVGToken::Cy },
+    { u"fx", SVGToken::Fx },
+    { u"fy", SVGToken::Fy },
+    { u"r", SVGToken::R },
+    { u"gradientUnits", SVGToken::GradientUnits },
+    { u"gradientTransform", SVGToken::GradientTransform },
+    { u"spreadMethod", SVGToken::SpreadMethod },
+    { u"href", SVGToken::Href },
+    { u"xlink:href", SVGToken::XlinkHref },
+    { u"stop-color", SVGToken::StopColor },
+    { u"stop-opacity", SVGToken::StopOpacity },
 
-                { aSVGStrPreserveAspectRatio, SVGToken::PreserveAspectRatio },
-                { aSVGStrDefer, SVGToken::Defer },
-                { aSVGStrNone, SVGToken::None },
-                { aSVGStrXMinYMin, SVGToken::XMinYMin },
-                { aSVGStrXMidYMin, SVGToken::XMidYMin },
-                { aSVGStrXMaxYMin, SVGToken::XMaxYMin },
-                { aSVGStrXMinYMid, SVGToken::XMinYMid },
-                { aSVGStrXMidYMid, SVGToken::XMidYMid },
-                { aSVGStrXMaxYMid, SVGToken::XMaxYMid },
-                { aSVGStrXMinYMax, SVGToken::XMinYMax },
-                { aSVGStrXMidYMax, SVGToken::XMidYMax },
-                { aSVGStrXMaxYMax, SVGToken::XMaxYMax },
-                { aSVGStrMeet, SVGToken::Meet },
-                { aSVGStrSlice, SVGToken::Slice },
-                { aSVGStrValues, SVGToken::Values },
+    { u"fill", SVGToken::Fill },
+    { u"fill-opacity", SVGToken::FillOpacity },
+    { u"fill-rule", SVGToken::FillRule },
 
-                { aSVGStrDefs, SVGToken::Defs },
-                { aSVGStrG, SVGToken::G },
-                { aSVGStrSvg, SVGToken::Svg },
-                { aSVGStrSymbol, SVGToken::Symbol },
-                { aSVGStrUse, SVGToken::Use },
-                { aSVGStrA, SVGToken::A },
+    { u"stroke", SVGToken::Stroke },
+    { u"stroke-dasharray", SVGToken::StrokeDasharray },
+    { u"stroke-dashoffset", SVGToken::StrokeDashoffset },
+    { u"stroke-linecap", SVGToken::StrokeLinecap },
+    { u"stroke-linejoin", SVGToken::StrokeLinejoin },
+    { u"stroke-miterlimit", SVGToken::StrokeMiterlimit },
+    { u"stroke-opacity", SVGToken::StrokeOpacity },
+    { u"stroke-width", SVGToken::StrokeWidth },
 
-                { aSVGStrCircle, SVGToken::Circle },
-                { aSVGStrEllipse, SVGToken::Ellipse },
-                { aSVGStrLine, SVGToken::Line },
-                { aSVGStrPath, SVGToken::Path },
-                { aSVGStrPolygon, SVGToken::Polygon },
-                { aSVGStrPolyline, SVGToken::Polyline },
-                { aSVGStrRect, SVGToken::Rect },
-                { aSVGStrImage, SVGToken::Image },
+    { u"text", SVGToken::Text },
+    { u"baseline-shift", SVGToken::BaselineShift },
+    { u"flowRoot", SVGToken::FlowRoot }
+};
 
-                { aSVGStrLinearGradient, SVGToken::LinearGradient },
-                { aSVGStrRadialGradient, SVGToken::RadialGradient },
-                { aSVGStrStop, SVGToken::Stop },
-                { aSVGStrOffset, SVGToken::Offset },
-                { aSVGStrX1, SVGToken::X1 },
-                { aSVGStrY1, SVGToken::Y1 },
-                { aSVGStrX2, SVGToken::X2 },
-                { aSVGStrY2, SVGToken::Y2 },
-                { aSVGStrCx, SVGToken::Cx },
-                { aSVGStrCy, SVGToken::Cy },
-                { aSVGStrFx, SVGToken::Fx },
-                { aSVGStrFy, SVGToken::Fy },
-                { aSVGStrR, SVGToken::R },
-                { aSVGStrGradientUnits, SVGToken::GradientUnits },
-                { aSVGStrGradientTransform, SVGToken::GradientTransform },
-                { aSVGStrSpreadMethod, SVGToken::SpreadMethod },
-                { aSVGStrHref, SVGToken::Href },
-                { aSVGStrXlinkHref, SVGToken::XlinkHref },
-                { aSVGStrStopColor, SVGToken::StopColor },
-                { aSVGStrStopOpacity, SVGToken::StopOpacity },
-
-                { aSVGStrFill, SVGToken::Fill },
-                { aSVGStrFillOpacity, SVGToken::FillOpacity },
-                { aSVGStrFillRule, SVGToken::FillRule },
+constexpr frozen::unordered_map<std::u16string_view, SVGToken, 32> 
aLowerCaseList
+{
+    { u"viewbox", SVGToken::ViewBox },
+    { u"textlength", SVGToken::TextLength },
+    { u"lengthadjust", SVGToken::LengthAdjust },
+    { u"textpath", SVGToken::TextPath },
+    { u"startoffset", SVGToken::StartOffset },
+    { u"pathlength", SVGToken::PathLength },
+    { u"clippath", SVGToken::ClipPathNode },
+    { u"clippathunits", SVGToken::ClipPathUnits },
+    { u"maskunits", SVGToken::MaskUnits },
+    { u"maskcontentunits", SVGToken::MaskContentUnits },
+    { u"markerunits", SVGToken::MarkerUnits },
+    { u"markerwidth", SVGToken::MarkerWidth },
+    { u"markerheight", SVGToken::MarkerHeight },
+    { u"patternunits", SVGToken::PatternUnits },
+    { u"patterncontentunits", SVGToken::PatternContentUnits },
+    { u"patterntransform", SVGToken::PatternTransform },
+    { u"preserveaspectratio", SVGToken::PreserveAspectRatio },
+    { u"xminymin", SVGToken::XMinYMin },
+    { u"xmidymin", SVGToken::XMidYMin },
+    { u"xmaxymin", SVGToken::XMaxYMin },
+    { u"xminymid", SVGToken::XMinYMid },
+    { u"xmidymid", SVGToken::XMidYMid },
+    { u"xmaxymid", SVGToken::XMaxYMid },
+    { u"xminymax", SVGToken::XMinYMax },
+    { u"xmidymax", SVGToken::XMidYMax },
+    { u"xmaxymax", SVGToken::XMaxYMax },
+    { u"lineargradient", SVGToken::LinearGradient },
+    { u"radialgradient", SVGToken::RadialGradient },
+    { u"gradientunits", SVGToken::GradientUnits },
+    { u"gradienttransform", SVGToken::GradientTransform },
+    { u"spreadmethod", SVGToken::SpreadMethod },
+    { u"flowroot", SVGToken::FlowRoot }
+};
 
-                { aSVGStrStroke, SVGToken::Stroke },
-                { aSVGStrStrokeDasharray, SVGToken::StrokeDasharray },
-                { aSVGStrStrokeDashoffset, SVGToken::StrokeDashoffset },
-                { aSVGStrStrokeLinecap, SVGToken::StrokeLinecap },
-                { aSVGStrStrokeLinejoin, SVGToken::StrokeLinejoin },
-                { aSVGStrStrokeMiterlimit, SVGToken::StrokeMiterlimit },
-                { aSVGStrStrokeOpacity, SVGToken::StrokeOpacity },
-                { aSVGStrStrokeWidth, SVGToken::StrokeWidth },
+SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent)
+{
+    OUString aSearchString = rStr.startsWith("svg:") ? rStr.copy(4) : rStr;
 
-                { aSVGStrText, SVGToken::Text },
-                { aSVGStrBaselineShift, SVGToken::BaselineShift },
-                { aSVGStrFlowRoot, SVGToken::FlowRoot }
-            };
+    auto const aResult = aSVGTokenMapperList.find(aSearchString);
 
-            const SVGTokenMapper::const_iterator 
aResult(aSVGTokenMapperList.find(rStr.startsWith("svg:") ? rStr.copy(4) : 
rStr));
+    if (aResult == aSVGTokenMapperList.end())
+    {
+        if (bCaseIndependent)
+        {
+            auto const 
aResultLowerCase(aLowerCaseList.find(rStr.toAsciiLowerCase()));
 
-            if(aResult == aSVGTokenMapperList.end())
+            if (aResultLowerCase == aLowerCaseList.end())
             {
-                if(bCaseIndependent)
-                {
-                    static SVGTokenMapper aCaseLindependentSVGTokenMapperList;
-
-                    if(aCaseLindependentSVGTokenMapperList.empty())
-                    {
-                        for(const auto& rCurrent : aSVGTokenMapperList)
-                        {
-                            aCaseLindependentSVGTokenMapperList.insert(
-                                SVGTokenValueType(
-                                    rCurrent.first.toAsciiLowerCase(),
-                                    rCurrent.second));
-                        }
-                    }
-
-                    const SVGTokenMapper::const_iterator 
aResult2(aCaseLindependentSVGTokenMapperList.find(rStr.toAsciiLowerCase()));
-
-                    if(aResult2 == aCaseLindependentSVGTokenMapperList.end())
-                    {
-                        return SVGToken::Unknown;
-                    }
-                    else
-                    {
-                        return aResult2->second;
-                    }
-                }
-
                 return SVGToken::Unknown;
             }
             else
             {
-                return aResult->second;
+                return aResultLowerCase->second;
             }
         }
 
-        OUString getStrTitle()
-        {
-            return aSVGStrTitle;
-        }
+        return SVGToken::Unknown;
+    }
+    else
+    {
+        return aResult->second;
+    }
+}
+
+OUString getStrTitle()
+{
+    return OUString(constToken_Title);
+}
+
+OUString getStrDesc()
+{
+    return OUString(constToken_Desc);
+}
 
-        OUString getStrDesc()
-        {
-            return aSVGStrDesc;
-        }
 } // end of namespace svgio
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 472fec1b45db7cad7d9e87426a6e8c216174f9f7
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Sat Jul 16 12:17:20 2022 +0200
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Sat Jun 17 12:31:07 2023 +0200

    Add frozen library support - for compile-time dict, set support
    
    Change-Id: I8fa02569ba02048cc3ef02b349aafba1c0cbebb4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153173
    Reviewed-by: Taichi Haradaguchi <20001...@ymail.ne.jp>
    Tested-by: Jenkins
    Reviewed-by: Tomaž Vajngerl <qui...@gmail.com>

diff --git a/Makefile.fetch b/Makefile.fetch
index c8c5c91941f2..625e781dc36a 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -125,6 +125,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk 
$(SRCDIR)/download.lst $(S
                $(call fetch_Optional,FONTCONFIG,FONTCONFIG_TARBALL) \
                $(call fetch_Optional,FREEHAND,FREEHAND_TARBALL) \
                $(call fetch_Optional,FREETYPE,FREETYPE_TARBALL) \
+               FROZEN_TARBALL \
                $(call fetch_Optional,EPOXY,EPOXY_TARBALL) \
                $(call fetch_Optional,GLM,GLM_TARBALL) \
                $(call fetch_Optional,GPGMEPP,GPGME_TARBALL) \
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 3ec3cd924395..631466f0001a 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -4297,4 +4297,14 @@ endif # ENABLE_ZXING
 
 endif # SYSTEM_ZXING
 
+
+define gb_LinkTarget__use_frozen
+$(call gb_LinkTarget_use_unpacked,$(1),frozen)
+$(call gb_LinkTarget_set_include,$(1),\
+       -I$(call gb_UnpackedTarball_get_dir,frozen/include/)\
+       $$(INCLUDE) \
+)
+endef
+
+
 # vim: set noet sw=4 ts=4:
diff --git a/download.lst b/download.lst
index 80edf6a84a49..b0cfdf278d08 100644
--- a/download.lst
+++ b/download.lst
@@ -202,6 +202,11 @@ FREETYPE_TARBALL := freetype-2.13.0.tar.xz
 # three static lines
 # so that git cherry-pick
 # will not run into conflicts
+FROZEN_SHA256SUM := 
f7c7075750e8fceeac081e9ef01944f221b36d9725beac8681cbd2838d26be45
+FROZEN_TARBALL := frozen-1.1.1.tar.gz
+# three static lines
+# so that git cherry-pick
+# will not run into conflicts
 GLM_SHA256SUM := 
6bba5f032bed47c73ad9397f2313b9acbfb56253d0d0576b5873d3dcb25e99ad
 GLM_TARBALL := glm-0.9.9.8.zip
 # three static lines
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 73d6530ac10f..cd9c5924d71d 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Module_add_moduledirs,external,\
        $(call gb_Helper_optional,FONTCONFIG,fontconfig) \
        $(call gb_Helper_optional,FREEHAND,libfreehand) \
        $(call gb_Helper_optional,FREETYPE,freetype) \
+       frozen \
        $(call gb_Helper_optional,GLM,glm) \
        $(call gb_Helper_optional,GPGMEPP,gpgmepp) \
        $(call gb_Helper_optional,GRAPHITE,graphite) \
diff --git a/external/frozen/Module_frozen.mk b/external/frozen/Module_frozen.mk
new file mode 100644
index 000000000000..10fa0997e0ed
--- /dev/null
+++ b/external/frozen/Module_frozen.mk
@@ -0,0 +1,16 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 
100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Module_Module,frozen))
+
+$(eval $(call gb_Module_add_targets,frozen,\
+    UnpackedTarball_frozen \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/frozen/README.md b/external/frozen/README.md
new file mode 100644
index 000000000000..56b011a771b6
--- /dev/null
+++ b/external/frozen/README.md
@@ -0,0 +1,7 @@
+External header only library frozen
+
+Header-only library that provides 0 cost initialization for immutable 
containers, fixed-size containers, and various algorithms.
+
+https://github.com/serge-sans-paille/frozen
+
+Release archives at: https://github.com/serge-sans-paille/frozen/tags
diff --git a/external/frozen/UnpackedTarball_frozen.mk 
b/external/frozen/UnpackedTarball_frozen.mk
new file mode 100644
index 000000000000..41ddb0fed85a
--- /dev/null
+++ b/external/frozen/UnpackedTarball_frozen.mk
@@ -0,0 +1,18 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t; fill-column: 
100 -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_UnpackedTarball_UnpackedTarball,frozen))
+
+$(eval $(call gb_UnpackedTarball_set_tarball,frozen,$(FROZEN_TARBALL)))
+
+$(eval $(call gb_UnpackedTarball_add_patches,frozen,\
+       external/frozen/defines_h_constexpr_string.patch.0 \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/external/frozen/defines_h_constexpr_string.patch.0 
b/external/frozen/defines_h_constexpr_string.patch.0
new file mode 100644
index 000000000000..d911ce3f9fa5
--- /dev/null
+++ b/external/frozen/defines_h_constexpr_string.patch.0
@@ -0,0 +1,11 @@
+--- include/frozen/bits/defines.h
++++ include/frozen/bits/defines.h
+@@ -59,7 +59,7 @@
+   #define FROZEN_LETITGO_HAS_DEDUCTION_GUIDES
+ #endif
+
+-#if __cpp_lib_constexpr_string >= 201907L
++#if defined(__cpp_lib_constexpr_string) && __cpp_lib_constexpr_string >= 
201907L
+   #define FROZEN_LETITGO_HAS_CONSTEXPR_STRING
+ #endif
+

Reply via email to