summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA_GAN <ganzouri97@gmail.com>2020-05-17 00:51:09 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-05-29 09:09:58 +0200
commit4c48de44ad933ef6dd19777b3ebf1a51db5e14e3 (patch)
tree3c6089cea08528d59adeb4270c8d289e59b155ae
parentc05d3f377054f5a7d4f4fb7bc23b0398d6b19347 (diff)
Add blur attributies and definitons into shadow classes and properities
Change-Id: I365f4bcfc8d772ea77cec1e4ce139b9fc16d9d7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95000 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--drawinglayer/source/attribute/sdrshadowattribute.cxx14
-rw-r--r--include/drawinglayer/attribute/sdrshadowattribute.hxx2
-rw-r--r--include/editeng/unoprnms.hxx1
-rw-r--r--include/svx/svddef.hxx3
-rw-r--r--include/svx/unoshprp.hxx4
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx4
-rw-r--r--svx/source/svdraw/svdattr.cxx1
7 files changed, 25 insertions, 4 deletions
diff --git a/drawinglayer/source/attribute/sdrshadowattribute.cxx b/drawinglayer/source/attribute/sdrshadowattribute.cxx
index 01ff66162ea5..9e379acaae28 100644
--- a/drawinglayer/source/attribute/sdrshadowattribute.cxx
+++ b/drawinglayer/source/attribute/sdrshadowattribute.cxx
@@ -32,16 +32,19 @@ namespace drawinglayer::attribute
basegfx::B2DVector maOffset; // shadow offset 1/100th mm
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
basegfx::BColor maColor; // color of shadow
ImpSdrShadowAttribute(
const basegfx::B2DVector& rOffset,
const basegfx::B2DVector& rSize,
double fTransparence,
+ sal_Int32 nBlur,
const basegfx::BColor& rColor)
: maOffset(rOffset),
maSize(rSize),
mfTransparence(fTransparence),
+ mnBlur(nBlur),
maColor(rColor)
{
}
@@ -50,6 +53,7 @@ namespace drawinglayer::attribute
: maOffset(basegfx::B2DVector()),
maSize(basegfx::B2DVector()),
mfTransparence(0.0),
+ mnBlur(0),
maColor(basegfx::BColor())
{
}
@@ -58,6 +62,7 @@ namespace drawinglayer::attribute
const basegfx::B2DVector& getOffset() const { return maOffset; }
const basegfx::B2DVector& getSize() const { return maSize; }
double getTransparence() const { return mfTransparence; }
+ sal_Int32 getBlur() const { return mnBlur; }
const basegfx::BColor& getColor() const { return maColor; }
bool operator==(const ImpSdrShadowAttribute& rCandidate) const
@@ -65,6 +70,7 @@ namespace drawinglayer::attribute
return (getOffset() == rCandidate.getOffset()
&& getSize() == rCandidate.getSize()
&& getTransparence() == rCandidate.getTransparence()
+ && getBlur() == rCandidate.getBlur()
&& getColor() == rCandidate.getColor());
}
};
@@ -80,9 +86,10 @@ namespace drawinglayer::attribute
const basegfx::B2DVector& rOffset,
const basegfx::B2DVector& rSize,
double fTransparence,
+ sal_Int32 nBlur,
const basegfx::BColor& rColor)
: mpSdrShadowAttribute(ImpSdrShadowAttribute(
- rOffset, rSize, fTransparence, rColor))
+ rOffset, rSize, fTransparence,nBlur, rColor))
{
}
@@ -130,6 +137,11 @@ namespace drawinglayer::attribute
return mpSdrShadowAttribute->getTransparence();
}
+ sal_Int32 SdrShadowAttribute::getBlur() const
+ {
+ return mpSdrShadowAttribute->getBlur();
+ }
+
const basegfx::BColor& SdrShadowAttribute::getColor() const
{
return mpSdrShadowAttribute->getColor();
diff --git a/include/drawinglayer/attribute/sdrshadowattribute.hxx b/include/drawinglayer/attribute/sdrshadowattribute.hxx
index fc797dc9d0a0..789edd459706 100644
--- a/include/drawinglayer/attribute/sdrshadowattribute.hxx
+++ b/include/drawinglayer/attribute/sdrshadowattribute.hxx
@@ -54,6 +54,7 @@ namespace drawinglayer
const basegfx::B2DVector& rOffset,
const basegfx::B2DVector& rSize,
double fTransparence,
+ sal_Int32 nBlur,
const basegfx::BColor& rColor);
SdrShadowAttribute();
SdrShadowAttribute(const SdrShadowAttribute&);
@@ -72,6 +73,7 @@ namespace drawinglayer
const basegfx::B2DVector& getOffset() const;
const basegfx::B2DVector& getSize() const;
double getTransparence() const;
+ sal_Int32 getBlur() const;
const basegfx::BColor& getColor() const;
};
} // end of namespace attribute
diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 0fff0342400e..35355a2f3186 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -87,6 +87,7 @@
#define UNO_NAME_SHADOWSIZEX "ShadowSizeX"
#define UNO_NAME_SHADOWSIZEY "ShadowSizeY"
#define UNO_NAME_SHADOWTRANSPARENCE "ShadowTransparence"
+#define UNO_NAME_SHADOWBLUR "ShadowBlur"
#define UNO_NAME_EDGERADIUS "CornerRadius"
diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index 378ed9676f22..27d90b44165c 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -187,7 +187,8 @@ constexpr TypedWhichId<SfxVoidItem> SDRATTR_SHADOW3D (SDRATTR_SHADO
constexpr TypedWhichId<SfxVoidItem> SDRATTR_SHADOWPERSP (SDRATTR_SHADOW_FIRST+ 6); /* 1073 */ /* 1073 */ /* 1056 */ /* Pool V2 */
constexpr TypedWhichId<SdrMetricItem> SDRATTR_SHADOWSIZEX (SDRATTR_SHADOW_FIRST+ 7);
constexpr TypedWhichId<SdrMetricItem> SDRATTR_SHADOWSIZEY (SDRATTR_SHADOW_FIRST+ 8);
-constexpr sal_uInt16 SDRATTR_SHADOW_LAST (SDRATTR_SHADOWSIZEY); /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */
+constexpr TypedWhichId<SdrMetricItem> SDRATTR_SHADOWBLUR (SDRATTR_SHADOW_FIRST+ 9);
+constexpr sal_uInt16 SDRATTR_SHADOW_LAST (SDRATTR_SHADOWBLUR); /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */
constexpr sal_uInt16 SDRATTR_CAPTION_FIRST (SDRATTR_SHADOW_LAST + 1); /* 1080 */ /* 1080 */ /* 1063 */ /* Pool V1: 1041 */
constexpr TypedWhichId<SdrCaptionTypeItem> SDRATTR_CAPTIONTYPE (SDRATTR_CAPTION_FIRST+ 0); /* 1080 */ /* 1080 */ /* 1063 */
diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index d83b24014937..4b3a05c6b5f4 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -224,7 +224,9 @@
{ OUString(UNO_NAME_SHADOWXDIST), SDRATTR_SHADOWXDIST, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \
{ OUString(UNO_NAME_SHADOWYDIST), SDRATTR_SHADOWYDIST, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \
{ OUString(UNO_NAME_SHADOWSIZEX), SDRATTR_SHADOWSIZEX, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \
- { OUString(UNO_NAME_SHADOWSIZEY), SDRATTR_SHADOWSIZEY, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
+ { OUString(UNO_NAME_SHADOWSIZEY), SDRATTR_SHADOWSIZEY, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \
+ { OUString{UNO_NAME_SHADOWBLUR}, SDRATTR_SHADOWBLUR, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM},
+
#define LINE_PROPERTIES_DEFAULTS\
{ OUString(UNO_NAME_LINECAP), XATTR_LINECAP, ::cppu::UnoType<css::drawing::LineCap>::get(), 0, 0}, \
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index fbfa6ebaf67f..5696deeeb970 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -398,7 +398,9 @@ namespace drawinglayer::primitive2d
const Color aColor(rSet.Get(SDRATTR_SHADOWCOLOR).GetColorValue());
- return attribute::SdrShadowAttribute(aOffset, aSize, static_cast<double>(nTransparence) * 0.01, aColor.getBColor());
+ sal_Int32 nBlur(rSet.Get(SDRATTR_SHADOWBLUR).GetValue());
+
+ return attribute::SdrShadowAttribute(aOffset, aSize, static_cast<double>(nTransparence) * 0.01,nBlur, aColor.getBColor());
}
}
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index fddb2e89adc0..d0dd36a4d1a5 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -134,6 +134,7 @@ SdrItemPool::SdrItemPool(
rPoolDefaults[SDRATTR_SHADOWSIZEX -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWSIZEX, 100000);
rPoolDefaults[SDRATTR_SHADOWSIZEY -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWSIZEY, 100000);
rPoolDefaults[SDRATTR_SHADOWTRANSPARENCE-SDRATTR_START]=new SdrPercentItem(SDRATTR_SHADOWTRANSPARENCE, 0);
+ rPoolDefaults[SDRATTR_SHADOWBLUR -SDRATTR_START]=new SdrMetricItem(SDRATTR_SHADOWBLUR, 0);
rPoolDefaults[SDRATTR_SHADOW3D -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOW3D );
rPoolDefaults[SDRATTR_SHADOWPERSP -SDRATTR_START]=new SfxVoidItem(SDRATTR_SHADOWPERSP );
rPoolDefaults[SDRATTR_CAPTIONTYPE -SDRATTR_START]=new SdrCaptionTypeItem ;