diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-07 08:46:27 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-09 07:08:24 +0200 |
commit | 4d82c1d8a3160719f694df98a4db6b9b8c7664bd (patch) | |
tree | 2e0fd754bd15d74171f07b77dbd4a00612d13f7c /filter/source | |
parent | a5ba8d94e6c36a7d79276416cc5acad9a1f6e54e (diff) |
Simplify SvXMLExport::AddAttribute overloads
Remove overloads taking const char* which were not needed, because
every their use eventually took a string literal convertible to
OUString directly.
Many other literals were converted to OUStringLiterals.
Change-Id: Ia1e742a8087776cd20bf5094dc415dafd9a8834a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123155
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/svg/svgwriter.cxx | 78 | ||||
-rw-r--r-- | filter/source/svg/svgwriter.hxx | 2 |
2 files changed, 40 insertions, 40 deletions
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 9d4e885ef269..a386ad935fb4 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -49,43 +49,43 @@ #include <memory> -const char aPrefixClipPathId[] = "clip_path_"; - -const char aXMLElemG[] = "g"; -const char aXMLElemDefs[] = "defs"; -const char aXMLElemText[] = "text"; -const char aXMLElemTspan[] = "tspan"; -const char aXMLElemLinearGradient[] = "linearGradient"; -const char aXMLElemStop[] = "stop"; - -const char aXMLAttrTransform[] = "transform"; -const char aXMLAttrStyle[] = "style"; -const char aXMLAttrId[] = "id"; -const char aXMLAttrX[] = "x"; -const char aXMLAttrY[] = "y"; -const char aXMLAttrX1[] = "x1"; -const char aXMLAttrY1[] = "y1"; -const char aXMLAttrX2[] = "x2"; -const char aXMLAttrY2[] = "y2"; -const char aXMLAttrCX[] = "cx"; -const char aXMLAttrCY[] = "cy"; -const char aXMLAttrRX[] = "rx"; -const char aXMLAttrRY[] = "ry"; -const char aXMLAttrWidth[] = "width"; -const char aXMLAttrHeight[] = "height"; -const char aXMLAttrStrokeWidth[] = "stroke-width"; -const char aXMLAttrFill[] = "fill"; -const char aXMLAttrFontFamily[] = "font-family"; -const char aXMLAttrFontSize[] = "font-size"; -const char aXMLAttrFontStyle[] = "font-style"; -const char aXMLAttrFontWeight[] = "font-weight"; -const char aXMLAttrTextDecoration[] = "text-decoration"; -const char aXMLAttrXLinkHRef[] = "xlink:href"; -const char aXMLAttrGradientUnits[] = "gradientUnits"; -const char aXMLAttrOffset[] = "offset"; -const char aXMLAttrStopColor[] = "stop-color"; -const char aXMLAttrStrokeLinejoin[] = "stroke-linejoin"; -const char aXMLAttrStrokeLinecap[] = "stroke-linecap"; +constexpr OUStringLiteral aPrefixClipPathId = u"clip_path_"; + +constexpr OUStringLiteral aXMLElemG = u"g"; +constexpr OUStringLiteral aXMLElemDefs = u"defs"; +constexpr OUStringLiteral aXMLElemText = u"text"; +constexpr OUStringLiteral aXMLElemTspan = u"tspan"; +constexpr OUStringLiteral aXMLElemLinearGradient = u"linearGradient"; +constexpr OUStringLiteral aXMLElemStop = u"stop"; + +constexpr OUStringLiteral aXMLAttrTransform = u"transform"; +constexpr OUStringLiteral aXMLAttrStyle = u"style"; +constexpr OUStringLiteral aXMLAttrId = u"id"; +constexpr OUStringLiteral aXMLAttrX = u"x"; +constexpr OUStringLiteral aXMLAttrY = u"y"; +constexpr OUStringLiteral aXMLAttrX1 = u"x1"; +constexpr OUStringLiteral aXMLAttrY1 = u"y1"; +constexpr OUStringLiteral aXMLAttrX2 = u"x2"; +constexpr OUStringLiteral aXMLAttrY2 = u"y2"; +constexpr OUStringLiteral aXMLAttrCX = u"cx"; +constexpr OUStringLiteral aXMLAttrCY = u"cy"; +constexpr OUStringLiteral aXMLAttrRX = u"rx"; +constexpr OUStringLiteral aXMLAttrRY = u"ry"; +constexpr OUStringLiteral aXMLAttrWidth = u"width"; +constexpr OUStringLiteral aXMLAttrHeight = u"height"; +constexpr OUStringLiteral aXMLAttrStrokeWidth = u"stroke-width"; +constexpr OUStringLiteral aXMLAttrFill = u"fill"; +constexpr OUStringLiteral aXMLAttrFontFamily = u"font-family"; +constexpr OUStringLiteral aXMLAttrFontSize = u"font-size"; +constexpr OUStringLiteral aXMLAttrFontStyle = u"font-style"; +constexpr OUStringLiteral aXMLAttrFontWeight = u"font-weight"; +constexpr OUStringLiteral aXMLAttrTextDecoration = u"text-decoration"; +constexpr OUStringLiteral aXMLAttrXLinkHRef = u"xlink:href"; +constexpr OUStringLiteral aXMLAttrGradientUnits = u"gradientUnits"; +constexpr OUStringLiteral aXMLAttrOffset = u"offset"; +constexpr OUStringLiteral aXMLAttrStopColor = u"stop-color"; +constexpr OUStringLiteral aXMLAttrStrokeLinejoin = u"stroke-linejoin"; +constexpr OUStringLiteral aXMLAttrStrokeLinecap = u"stroke-linecap"; vcl::PushFlags SVGContextHandler::getPushFlags() const @@ -172,8 +172,8 @@ void SVGAttributeWriter::ImplGetColorStr( const Color& rColor, OUString& rColorS } -void SVGAttributeWriter::AddColorAttr( const char* pColorAttrName, - const char* pColorOpacityAttrName, +void SVGAttributeWriter::AddColorAttr( const OUString& pColorAttrName, + const OUString& pColorOpacityAttrName, const Color& rColor ) { OUString aColor, aColorOpacity; diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index e3fd2558498b..f37246bf2edb 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -144,7 +144,7 @@ public: SVGAttributeWriter( SVGExport& rExport, SVGFontExport& rFontExport, SVGState& rCurState ); ~SVGAttributeWriter(); - void AddColorAttr( const char* pColorAttrName, const char* pColorOpacityAttrName, const Color& rColor ); + void AddColorAttr( const OUString& pColorAttrName, const OUString& pColorOpacityAttrName, const Color& rColor ); void AddGradientDef( const tools::Rectangle& rObjRect,const Gradient& rGradient, OUString& rGradientId ); void AddPaintAttr( const Color& rLineColor, const Color& rFillColor, const tools::Rectangle* pObjBoundRect = nullptr, const Gradient* pFillGradient = nullptr ); |