diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2023-04-20 17:16:32 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2023-04-21 15:03:14 +0200 |
commit | dccd82b5ac47f44ea0297d301dc894c70bc793a2 (patch) | |
tree | 71dad46c8e0fbd3b05363978f5554dfc32911276 /drawinglayer/source/tools | |
parent | 0293724d05953be608287629ed6178a7c05383a6 (diff) |
MCGR: Reduce diverse GradientStyle enums to single UNO API one
Change-Id: Ie0cd26a308a75ddead9451c53e874a39cc6eeb63
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150705
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer/source/tools')
-rw-r--r-- | drawinglayer/source/tools/primitive2dxmldump.cxx | 13 | ||||
-rw-r--r-- | drawinglayer/source/tools/wmfemfhelper.cxx | 38 |
2 files changed, 8 insertions, 43 deletions
diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx b/drawinglayer/source/tools/primitive2dxmldump.cxx index 31c88c6482ed..08f585a3638b 100644 --- a/drawinglayer/source/tools/primitive2dxmldump.cxx +++ b/drawinglayer/source/tools/primitive2dxmldump.cxx @@ -276,22 +276,23 @@ void writeSdrFillAttribute(::tools::XmlWriter& rWriter, rWriter.startElement("gradient"); switch (rGradient.getStyle()) { - case drawinglayer::attribute::GradientStyle::Linear: + default: // GradientStyle_MAKE_FIXED_SIZE + case css::awt::GradientStyle_LINEAR: rWriter.attribute("style", "Linear"); break; - case drawinglayer::attribute::GradientStyle::Axial: + case css::awt::GradientStyle_AXIAL: rWriter.attribute("style", "Axial"); break; - case drawinglayer::attribute::GradientStyle::Radial: + case css::awt::GradientStyle_RADIAL: rWriter.attribute("style", "Radial"); break; - case drawinglayer::attribute::GradientStyle::Elliptical: + case css::awt::GradientStyle_ELLIPTICAL: rWriter.attribute("style", "Elliptical"); break; - case drawinglayer::attribute::GradientStyle::Square: + case css::awt::GradientStyle_SQUARE: rWriter.attribute("style", "Square"); break; - case drawinglayer::attribute::GradientStyle::Rect: + case css::awt::GradientStyle_RECT: rWriter.attribute("style", "Rect"); break; } diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index e6eb401833c7..1b2b2d0a5abd 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -675,44 +675,8 @@ namespace wmfemfhelper aEnd = interpolate(aBlack, aEnd, static_cast<double>(nEndIntens) * 0.01); } - drawinglayer::attribute::GradientStyle aGradientStyle(drawinglayer::attribute::GradientStyle::Rect); - - switch(rGradient.GetStyle()) - { - case GradientStyle::Linear : - { - aGradientStyle = drawinglayer::attribute::GradientStyle::Linear; - break; - } - case GradientStyle::Axial : - { - aGradientStyle = drawinglayer::attribute::GradientStyle::Axial; - break; - } - case GradientStyle::Radial : - { - aGradientStyle = drawinglayer::attribute::GradientStyle::Radial; - break; - } - case GradientStyle::Elliptical : - { - aGradientStyle = drawinglayer::attribute::GradientStyle::Elliptical; - break; - } - case GradientStyle::Square : - { - aGradientStyle = drawinglayer::attribute::GradientStyle::Square; - break; - } - default : // GradientStyle::Rect - { - aGradientStyle = drawinglayer::attribute::GradientStyle::Rect; - break; - } - } - return drawinglayer::attribute::FillGradientAttribute( - aGradientStyle, + rGradient.GetStyle(), static_cast<double>(rGradient.GetBorder()) * 0.01, static_cast<double>(rGradient.GetOfsX()) * 0.01, static_cast<double>(rGradient.GetOfsY()) * 0.01, |