summaryrefslogtreecommitdiff
path: root/svx/source/sdr/primitive2d
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-01 08:55:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-01 09:54:18 +0100
commit535359269ed23e2faead8e9e905d57cc6121e269 (patch)
treeae4834fdb175b1764ff656687f0276ed347d3bac /svx/source/sdr/primitive2d
parentca3e12d5b560d27615aeac986f9dbc1258993e65 (diff)
use SfxItemSet::GetItemIfSet in svx
Change-Id: I7a56c9452102cf7f6524296219209aef05383d81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130736 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr/primitive2d')
-rw-r--r--svx/source/sdr/primitive2d/sdrattributecreator.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 1b4f0abbac97..65245509440f 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -423,12 +423,12 @@ namespace drawinglayer::primitive2d
if(100 != nTransparence)
{
// need to check XFillFloatTransparence, object fill may still be completely transparent
- const SfxPoolItem* pGradientItem;
+ const XFillFloatTransparenceItem* pGradientItem;
- if(SfxItemState::SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem)
- && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled())
+ if((pGradientItem = rSet.GetItemIfSet(XATTR_FILLFLOATTRANSPARENCE, true))
+ && pGradientItem->IsEnabled())
{
- const XGradient& rGradient = static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->GetGradientValue();
+ const XGradient& rGradient = pGradientItem->GetGradientValue();
const sal_uInt8 nStartLuminance(rGradient.GetStartColor().GetLuminance());
const sal_uInt8 nEndLuminance(rGradient.GetEndColor().GetLuminance());
const bool bCompletelyTransparent(0xff == nStartLuminance && 0xff == nEndLuminance);
@@ -618,13 +618,13 @@ namespace drawinglayer::primitive2d
attribute::FillGradientAttribute createNewTransparenceGradientAttribute(const SfxItemSet& rSet)
{
- const SfxPoolItem* pGradientItem;
+ const XFillFloatTransparenceItem* pGradientItem;
- if(SfxItemState::SET == rSet.GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem)
- && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled())
+ if((pGradientItem = rSet.GetItemIfSet(XATTR_FILLFLOATTRANSPARENCE))
+ && pGradientItem->IsEnabled())
{
// test if float transparence is completely transparent
- const XGradient& rGradient = static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->GetGradientValue();
+ const XGradient& rGradient = pGradientItem->GetGradientValue();
const sal_uInt8 nStartLuminance(rGradient.GetStartColor().GetLuminance());
const sal_uInt8 nEndLuminance(rGradient.GetEndColor().GetLuminance());
const bool bCompletelyTransparent(0xff == nStartLuminance && 0xff == nEndLuminance);