summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/source/ui/view/drviews7.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index a1da9aa4226b..dc4b959fd39d 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1807,9 +1807,15 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
if (SfxItemState::SET == pArgs->GetItemState(SID_FILL_GRADIENT_JSON, false, &pItem))
{
const SfxStringItem* pJSON = static_cast<const SfxStringItem*>(pItem);
- XFillGradientItem aGradient( XGradient::fromJSON(pJSON->GetValue()) );
+ XFillGradientItem aGradientItem( XGradient::fromJSON(pJSON->GetValue()) );
+
+ // MigrateItemSet guarantees unique gradient names
+ SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>{} );
+ aMigrateSet.Put( aGradientItem );
+ SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDrawView->GetModel() );
+
rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
- rPageProperties.PutItem( aGradient );
+ rPageProperties.PutItemSet( *pTempSet );
}
else
{
@@ -1820,8 +1826,8 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
aMigrateSet.Put( aGradientItem );
SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDrawView->GetModel() );
- rPageProperties.PutItemSet( *pTempSet );
rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
+ rPageProperties.PutItemSet( *pTempSet );
}
}
break;