summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-01 13:45:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-01 17:53:43 +0100
commit6df85675378a5a90b0d89d712015e010f6893c9f (patch)
treea54e4d21583ddb9175d1c7bed4cecad7b7de3fe6 /sd
parent0d29394598db2e336a9982cbb7041ea407b2bf6d (diff)
fix assert when changing fill on impress shape
reverts part of commit 31e7845339b30a69f06a04619660398fe4267268 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Thu Feb 17 12:19:49 2022 +0200 use more SfxItemSet::CloneAsValue Change-Id: I5f385525adcdb73199a6eb4b057e275341fb85b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130765 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviews2.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 1cd427e8b6f8..bef73c1726d3 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -543,12 +543,12 @@ public:
}
};
- void lcl_convertStringArguments(sal_uInt16 nSlot, SfxItemSet& rArgs)
+ void lcl_convertStringArguments(sal_uInt16 nSlot, const std::unique_ptr<SfxItemSet>& pArgs)
{
Color aColor;
const SfxPoolItem* pItem = nullptr;
- if (SfxItemState::SET == rArgs.GetItemState(SID_ATTR_LINE_WIDTH_ARG, false, &pItem))
+ if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_LINE_WIDTH_ARG, false, &pItem))
{
double fValue = static_cast<const SvxDoubleItem*>(pItem)->GetValue();
// FIXME: different units...
@@ -556,9 +556,9 @@ public:
int nValue = fValue * nPow;
XLineWidthItem aItem(nValue);
- rArgs.Put(aItem);
+ pArgs->Put(aItem);
}
- if (SfxItemState::SET == rArgs.GetItemState(SID_ATTR_COLOR_STR, false, &pItem))
+ if (SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pItem))
{
OUString sColor = static_cast<const SfxStringItem*>(pItem)->GetValue();
@@ -572,26 +572,26 @@ public:
case SID_ATTR_LINE_COLOR:
{
XLineColorItem aLineColorItem(OUString(), aColor);
- rArgs.Put(aLineColorItem);
+ pArgs->Put(aLineColorItem);
break;
}
case SID_ATTR_FILL_COLOR:
{
XFillColorItem aFillColorItem(OUString(), aColor);
- rArgs.Put(aFillColorItem);
+ pArgs->Put(aFillColorItem);
break;
}
}
}
- if (SfxItemState::SET == rArgs.GetItemState(SID_FILL_GRADIENT_JSON, false, &pItem))
+ if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, false, &pItem))
{
const SfxStringItem* pJSON = static_cast<const SfxStringItem*>(pItem);
if (pJSON)
{
XGradient aGradient = XGradient::fromJSON(pJSON->GetValue());
XFillGradientItem aItem(aGradient);
- rArgs.Put(aItem);
+ pArgs->Put(aItem);
}
}
}
@@ -683,9 +683,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
if( rReq.GetArgs() )
{
- SfxItemSet aNewArgs = rReq.GetArgs()->CloneAsValue();
- lcl_convertStringArguments(rReq.GetSlot(), aNewArgs);
- mpDrawView->SetAttributes(aNewArgs);
+ std::unique_ptr<SfxItemSet> pNewArgs = rReq.GetArgs()->Clone();
+ lcl_convertStringArguments(rReq.GetSlot(), pNewArgs);
+ mpDrawView->SetAttributes(*pNewArgs);
rReq.Done();
}
else