diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2019-11-12 00:08:25 +0100 |
---|---|---|
committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | 2019-11-20 23:46:06 +0100 |
commit | 308249b43f8d62967f7bfa974f3e4f3f6182a010 (patch) | |
tree | 85e8278a2ef2aebd94ecd711d10a73acc116f465 | |
parent | tdf#125449 Fix custom gradient fill settings being lost (diff) | |
download | core-308249b43f8d62967f7bfa974f3e4f3f6182a010.tar.gz core-308249b43f8d62967f7bfa974f3e4f3f6182a010.zip |
tdf#125449 follow-up: unique gradient names in Impress area dlg
as seen in tdf#94300 chart prefers to name anonymous (non-preset)
gradients all by itself
However tdf#99908 shows that ODF import doesn't like anonymous
gradients. This is a bug in xmloff style import and should eventually
be fixed there. Here we implement the same band-aid solution
tdf#99908 implements for Impress sidebar
Change-Id: Ia39f581aee875ac95faa5c502a3479ed5d7974d8
Reviewed-on: https://gerrit.libreoffice.org/82522
Tested-by: Jenkins
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
(cherry picked from commit 34a3afecaaab3dc4898b33e0981d8b231351fe37)
Reviewed-on: https://gerrit.libreoffice.org/83185
Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
(cherry picked from commit c00775925325b04b3d707df0d494464f864f6fc0)
Reviewed-on: https://gerrit.libreoffice.org/83286
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index ba77b29c54ef..b5d73efa4367 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -33,6 +33,7 @@ #include <svx/xbtmpit.hxx> #include <svx/xflbstit.hxx> #include <svx/xflbmtit.hxx> +#include <svx/xflgrit.hxx> #include <editeng/ulspitem.hxx> #include <editeng/lrspitem.hxx> #include <svx/sdr/properties/properties.hxx> @@ -347,6 +348,15 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent) ( aMergedAttr.GetItem<XFillStyleItem>( XATTR_FILLSTYLE )->GetValue() == drawing::FillStyle_NONE ) ) ) mbPageBckgrdDeleted = true; + const XFillGradientItem* pTempGradItem = pTempSet->GetItem<XFillGradientItem>(XATTR_FILLGRADIENT); + if (pTempGradItem && pTempGradItem->GetName().isEmpty()) + { + // MigrateItemSet guarantees unique gradient names + SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>{} ); + aMigrateSet.Put( XFillGradientItem("gradient", pTempGradItem->GetGradientValue()) ); + SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc); + } + if( !mbMasterPage && bChanges && mbPageBckgrdDeleted ) { mpBackgroundObjUndoAction.reset( new SdBackgroundObjUndoAction( |