summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-07-05 16:37:58 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-07-05 22:46:42 +0200
commitd378a44b4aa917d1f000f6ed2aa682009c544b6f (patch)
treeda55a21a5d623e13c3b0d5dc5e1f9eba11507690 /svgio
parentef049c4d10023f866173ea344d13e5d99d485066 (diff)
svgio: simplify code
Change-Id: Ieaf0430cd0e84d861f108ec33bf98ff2870ba2df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154067 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio')
-rw-r--r--svgio/inc/svgtoken.hxx3
-rw-r--r--svgio/source/svgreader/svgdocumenthandler.cxx9
-rw-r--r--svgio/source/svgreader/svgtoken.cxx17
3 files changed, 3 insertions, 26 deletions
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 46d938a7c31e..99ca832a34f5 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: */