summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir@collabora.com>2023-03-15 19:25:03 +0300
committerSarper Akdemir <sarper.akdemir@collabora.com>2023-05-12 12:27:35 +0200
commit1b9fa684374d056b04b6b8019bd0be2b603b3d95 (patch)
treef90678056e1b5d3be8a67ba0c9fa335066a64fd8 /drawinglayer
parent57c7a776df80931c505bd39c7539ddb0f6270c2c (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151643 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/attribute/sdrshadowattribute.cxx13
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();