svgio/inc/svgtoken.hxx | 3 --- svgio/source/svgreader/svgdocumenthandler.cxx | 9 +-------- svgio/source/svgreader/svgtoken.cxx | 17 ++--------------- 3 files changed, 3 insertions(+), 26 deletions(-)
New commits: commit cf874ef8bb0df0528163c347aa4fc079572a59de Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Wed Jul 5 16:37:58 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Thu Jul 6 16:31:54 2023 +0200 svgio: simplify code Change-Id: Ieaf0430cd0e84d861f108ec33bf98ff2870ba2df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154067 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154131 diff --git a/svgio/inc/svgtoken.hxx b/svgio/inc/svgtoken.hxx index 61abd28f11e8..cec89241903a 100644 --- a/svgio/inc/svgtoken.hxx +++ b/svgio/inc/svgtoken.hxx @@ -195,9 +195,6 @@ namespace svgio::svgreader SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent); OUString SVGTokenToStr(const SVGToken& rToken); - OUString getStrTitle(); - OUString getStrDesc(); - } // end of namespace svgio::svgreader /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx index d95690e6f5d7..e0d835700659 100644 --- a/svgio/source/svgreader/svgdocumenthandler.cxx +++ b/svgio/source/svgreader/svgdocumenthandler.cxx @@ -525,14 +525,7 @@ namespace if(!aText.isEmpty()) { - if(SVGToken::Title == aSVGToken) - { - mpTarget->parseAttribute(getStrTitle(), aSVGToken, aText); - } - else // if(SVGTokenDesc == aSVGToken) - { - mpTarget->parseAttribute(getStrDesc(), aSVGToken, aText); - } + mpTarget->parseAttribute(SVGTokenToStr(aSVGToken), aSVGToken, aText); } } diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index 6af6a1f5856e..1e2d3d7486da 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -25,9 +25,6 @@ namespace svgio::svgreader { -constexpr const std::u16string_view constToken_Title = u"title"; -constexpr const std::u16string_view constToken_Desc = u"desc"; - constexpr frozen::unordered_map<std::u16string_view, SVGToken, 145> aSVGTokenMapperList { { u"width", SVGToken::Width }, @@ -110,8 +107,8 @@ constexpr frozen::unordered_map<std::u16string_view, SVGToken, 145> aSVGTokenMap { u"patternTransform", SVGToken::PatternTransform }, { u"opacity", SVGToken::Opacity }, { u"visibility", SVGToken::Visibility }, - { constToken_Title, SVGToken::Title }, - { constToken_Desc, SVGToken::Desc }, + { u"title", SVGToken::Title }, + { u"desc", SVGToken::Desc }, { u"preserveAspectRatio", SVGToken::PreserveAspectRatio }, { u"defer", SVGToken::Defer }, { u"none", SVGToken::None }, @@ -262,16 +259,6 @@ OUString SVGTokenToStr(const SVGToken& rToken) return OUString(); } -OUString getStrTitle() -{ - return OUString(constToken_Title); -} - -OUString getStrDesc() -{ - return OUString(constToken_Desc); -} - } // end of namespace svgio /* vim:set shiftwidth=4 softtabstop=4 expandtab: */