summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/drviews7.cxx
diff options
context:
space:
mode:
authorPranam Lashkari <lpranam@collabora.com>2020-04-21 18:19:44 +0530
committerSzymon Kłos <szymon.klos@collabora.com>2020-04-23 13:22:16 +0200
commit23a3727dc6bdb1a3266f71a58cca0bea8f70ac04 (patch)
tree5791a06489d170175630a13acf7c0544a566c0b8 /sd/source/ui/view/drviews7.cxx
parent24a90870991d2629014b60435e3ca98a64dd3043 (diff)
Added parameter to FillPageGradient command
Change-Id: Ife435fc25e8e3114e66461af22ac9e0ef8c9d011 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92235 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sd/source/ui/view/drviews7.cxx')
-rw-r--r--sd/source/ui/view/drviews7.cxx24
1 files changed, 17 insertions, 7 deletions
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 3b65b9a62108..a0841616946f 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1804,15 +1804,25 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
case SID_ATTR_PAGE_GRADIENT:
{
- XFillGradientItem aGradientItem( pArgs->Get( XATTR_FILLGRADIENT ) );
+ 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()) );
+ rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
+ rPageProperties.PutItem( aGradient );
+ }
+ else
+ {
+ XFillGradientItem aGradientItem( pArgs->Get( XATTR_FILLGRADIENT ) );
- // 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() );
+ // 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.PutItemSet( *pTempSet );
- rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
+ rPageProperties.PutItemSet( *pTempSet );
+ rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
+ }
}
break;