summaryrefslogtreecommitdiff
path: root/drawinglayer/source/attribute/sdrshadowattribute.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer/source/attribute/sdrshadowattribute.cxx')
-rw-r--r--drawinglayer/source/attribute/sdrshadowattribute.cxx32
1 files changed, 21 insertions, 11 deletions
diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx
index 9e379acaae28..1eb1b3ea687c 100644
--- a/drawinglayer/source/attribute/sdrshadowattribute.cxx
+++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx
@@ -20,7 +20,7 @@
#include <drawinglayer/attribute/sdrshadowattribute.hxx>
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/color/bcolor.hxx>
-#include <rtl/instance.hxx>
+#include <docmodel/theme/FormatScheme.hxx>
namespace drawinglayer::attribute
@@ -33,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(
@@ -40,21 +41,20 @@ 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)
{
}
ImpSdrShadowAttribute()
- : maOffset(basegfx::B2DVector()),
- maSize(basegfx::B2DVector()),
- mfTransparence(0.0),
- mnBlur(0),
- maColor(basegfx::BColor())
+ : mfTransparence(0.0),
+ mnBlur(0)
{
}
@@ -71,14 +71,18 @@ namespace drawinglayer::attribute
&& getSize() == rCandidate.getSize()
&& getTransparence() == rCandidate.getTransparence()
&& getBlur() == rCandidate.getBlur()
+ && meAlignment == rCandidate.meAlignment
&& getColor() == rCandidate.getColor());
}
};
namespace
{
- struct theGlobalDefault :
- public rtl::Static< SdrShadowAttribute::ImplType, theGlobalDefault > {};
+ SdrShadowAttribute::ImplType& theGlobalDefault()
+ {
+ static SdrShadowAttribute::ImplType SINGLETON;
+ return SINGLETON;
+ }
}
@@ -87,14 +91,15 @@ 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))
{
}
SdrShadowAttribute::SdrShadowAttribute()
- : mpSdrShadowAttribute(theGlobalDefault::get())
+ : mpSdrShadowAttribute(theGlobalDefault())
{
}
@@ -106,7 +111,7 @@ namespace drawinglayer::attribute
bool SdrShadowAttribute::isDefault() const
{
- return mpSdrShadowAttribute.same_object(theGlobalDefault::get());
+ return mpSdrShadowAttribute.same_object(theGlobalDefault());
}
SdrShadowAttribute& SdrShadowAttribute::operator=(const SdrShadowAttribute&) = default;
@@ -142,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();