summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2019-11-12 00:08:25 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2019-11-19 10:23:12 +0100
commit34a3afecaaab3dc4898b33e0981d8b231351fe37 (patch)
tree9bd4d25152d72f020f4d48d4337a6f9a5f35b660 /sd
parent08f2b7b167983bcb4d1f1f178c2c46c3d79f9958 (diff)
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>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/func/fupage.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index bad262357f47..7c2654e0bba0 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -36,6 +36,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>
@@ -387,6 +388,15 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
}
}
+ 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(