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>
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index bad2623..7c2654e 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(