tdf#158068 Use UTF-16 literals and std::u16string_view in mathmlattr.cxx

Change-Id: I45249164d7410bb4c68d26b7bc6f599836252583
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199378
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Simon Chenery
2026-02-15 09:06:38 +01:00
committed by Mike Kaganski
parent 3eb2871aef
commit 0823d78fce
2 changed files with 21 additions and 21 deletions
+1 -1
View File
@@ -74,6 +74,6 @@ enum class MathMLMathvariantValue
Stretched
};
bool GetMathMLMathvariantValue(const OUString& rStr, MathMLMathvariantValue& rV);
bool GetMathMLMathvariantValue(std::u16string_view rStr, MathMLMathvariantValue& rV);
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
+20 -20
View File
@@ -130,27 +130,27 @@ bool ParseMathMLAttributeLengthValue(std::u16string_view rStr, MathMLAttributeLe
return true;
}
bool GetMathMLMathvariantValue(const OUString& rStr, MathMLMathvariantValue& rV)
bool GetMathMLMathvariantValue(std::u16string_view rStr, MathMLMathvariantValue& rV)
{
static const std::unordered_map<OUString, MathMLMathvariantValue> aMap{
{ "normal", MathMLMathvariantValue::Normal },
{ "bold", MathMLMathvariantValue::Bold },
{ "italic", MathMLMathvariantValue::Italic },
{ "bold-italic", MathMLMathvariantValue::BoldItalic },
{ "double-struck", MathMLMathvariantValue::DoubleStruck },
{ "bold-fraktur", MathMLMathvariantValue::BoldFraktur },
{ "script", MathMLMathvariantValue::Script },
{ "bold-script", MathMLMathvariantValue::BoldScript },
{ "fraktur", MathMLMathvariantValue::Fraktur },
{ "sans-serif", MathMLMathvariantValue::SansSerif },
{ "bold-sans-serif", MathMLMathvariantValue::BoldSansSerif },
{ "sans-serif-italic", MathMLMathvariantValue::SansSerifItalic },
{ "sans-serif-bold-italic", MathMLMathvariantValue::SansSerifBoldItalic },
{ "monospace", MathMLMathvariantValue::Monospace },
{ "initial", MathMLMathvariantValue::Initial },
{ "tailed", MathMLMathvariantValue::Tailed },
{ "looped", MathMLMathvariantValue::Looped },
{ "stretched", MathMLMathvariantValue::Stretched }
static const std::unordered_map<std::u16string_view, MathMLMathvariantValue> aMap{
{ u"normal", MathMLMathvariantValue::Normal },
{ u"bold", MathMLMathvariantValue::Bold },
{ u"italic", MathMLMathvariantValue::Italic },
{ u"bold-italic", MathMLMathvariantValue::BoldItalic },
{ u"double-struck", MathMLMathvariantValue::DoubleStruck },
{ u"bold-fraktur", MathMLMathvariantValue::BoldFraktur },
{ u"script", MathMLMathvariantValue::Script },
{ u"bold-script", MathMLMathvariantValue::BoldScript },
{ u"fraktur", MathMLMathvariantValue::Fraktur },
{ u"sans-serif", MathMLMathvariantValue::SansSerif },
{ u"bold-sans-serif", MathMLMathvariantValue::BoldSansSerif },
{ u"sans-serif-italic", MathMLMathvariantValue::SansSerifItalic },
{ u"sans-serif-bold-italic", MathMLMathvariantValue::SansSerifBoldItalic },
{ u"monospace", MathMLMathvariantValue::Monospace },
{ u"initial", MathMLMathvariantValue::Initial },
{ u"tailed", MathMLMathvariantValue::Tailed },
{ u"looped", MathMLMathvariantValue::Looped },
{ u"stretched", MathMLMathvariantValue::Stretched }
};
auto it = aMap.find(rStr);