starmath/inc/mathml/mathmlattr.hxx | 2 - starmath/source/mathml/mathmlattr.cxx | 40 +++++++++++++++++----------------- 2 files changed, 21 insertions(+), 21 deletions(-)
New commits: commit 0823d78fcebe0ac6eba98fdb36323bd8df117762 Author: Simon Chenery <[email protected]> AuthorDate: Sat Feb 14 17:42:38 2026 +0100 Commit: Mike Kaganski <[email protected]> CommitDate: Sun Feb 15 09:06:38 2026 +0100 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 <[email protected]> diff --git a/starmath/inc/mathml/mathmlattr.hxx b/starmath/inc/mathml/mathmlattr.hxx index b7d1160bb8ca..ce2f4eb5137d 100644 --- a/starmath/inc/mathml/mathmlattr.hxx +++ b/starmath/inc/mathml/mathmlattr.hxx @@ -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: */ diff --git a/starmath/source/mathml/mathmlattr.cxx b/starmath/source/mathml/mathmlattr.cxx index 5e54f0d92e3e..47413ab3cb2c 100644 --- a/starmath/source/mathml/mathmlattr.cxx +++ b/starmath/source/mathml/mathmlattr.cxx @@ -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);
