diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2023-03-15 19:25:03 +0300 |
---|---|---|
committer | Sarper Akdemir <sarper.akdemir@collabora.com> | 2023-04-18 17:43:18 +0200 |
commit | c27946fb157fe46fbfaefbe93f2c6794b1af4411 (patch) | |
tree | 0ddcaa0e4439713835d8e6b80121336adaf056e5 /drawinglayer | |
parent | be7ce49f33035fcd289a5ffc7a2307bd9a566780 (diff) |
tdf#150020 pptx import: handle algn for outerShdw
Introduces RectangleAlignmentItem that holds a value of the enum
model::RectangleAlignment.
Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow.
Implements import of algn for outerShdw.
Makes the alignment considered while the shadow is being scaled.
Also adds a unit test that covers this.
Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/attribute/sdrshadowattribute.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx index 6e046f1f07c7..1eb1b3ea687c 100644 --- a/drawinglayer/source/attribute/sdrshadowattribute.cxx +++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx @@ -20,6 +20,7 @@ #include <drawinglayer/attribute/sdrshadowattribute.hxx> #include <basegfx/vector/b2dvector.hxx> #include <basegfx/color/bcolor.hxx> +#include <docmodel/theme/FormatScheme.hxx> namespace drawinglayer::attribute @@ -32,6 +33,7 @@ namespace drawinglayer::attribute basegfx::B2DVector maSize; // [0.0 .. 2.0] double mfTransparence; // [0.0 .. 1.0], 0.0==no transp. sal_Int32 mnBlur; // [0 .. 180], radius of the blur + model::RectangleAlignment meAlignment{model::RectangleAlignment::Unset}; // alignment of the shadow basegfx::BColor maColor; // color of shadow ImpSdrShadowAttribute( @@ -39,11 +41,13 @@ namespace drawinglayer::attribute const basegfx::B2DVector& rSize, double fTransparence, sal_Int32 nBlur, + model::RectangleAlignment eAlignment, const basegfx::BColor& rColor) : maOffset(rOffset), maSize(rSize), mfTransparence(fTransparence), mnBlur(nBlur), + meAlignment(eAlignment), maColor(rColor) { } @@ -67,6 +71,7 @@ namespace drawinglayer::attribute && getSize() == rCandidate.getSize() && getTransparence() == rCandidate.getTransparence() && getBlur() == rCandidate.getBlur() + && meAlignment == rCandidate.meAlignment && getColor() == rCandidate.getColor()); } }; @@ -86,9 +91,10 @@ namespace drawinglayer::attribute const basegfx::B2DVector& rSize, double fTransparence, sal_Int32 nBlur, + model::RectangleAlignment eAlignment, const basegfx::BColor& rColor) : mpSdrShadowAttribute(ImpSdrShadowAttribute( - rOffset, rSize, fTransparence,nBlur, rColor)) + rOffset, rSize, fTransparence, nBlur, eAlignment, rColor)) { } @@ -141,6 +147,11 @@ namespace drawinglayer::attribute return mpSdrShadowAttribute->getBlur(); } + model::RectangleAlignment SdrShadowAttribute::getAlignment() const + { + return mpSdrShadowAttribute->meAlignment; + } + const basegfx::BColor& SdrShadowAttribute::getColor() const { return mpSdrShadowAttribute->getColor(); |