From 6b161f615712f6daa11f66d0dfe45eef0877c860 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Sat, 5 Dec 2020 19:48:36 +0300 Subject: tdf#137729 sd UI: unique hatch names in slide/page area dlg A custom hatch on a page background was not getting a name, so it was exported referring to an empty string, which was implemented as using the first available hatch. Ensuring that a name exists causes the hatch to be exported in the styles, and thus can be referred to in content.xml All praise goes to Katarina since this just copies her similar fix for grandients in tdf#125449. Too bad it took me a whole day to find that. Unfortunately, Katarina didn't provide any unit tests for me to copycat as well. Change-Id: If2be0830b521946fb1b88b247319a7e6c2c61c3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107258 Tested-by: Jenkins Reviewed-by: Xisco Fauli Reviewed-by: Justin Luth (cherry picked from commit 0c37e164dbbff89ecac843e1b182fdbce70cda34) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107898 --- sd/source/ui/func/fupage.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sd') diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 3779feec3f82..6d44b70d5a9d 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -394,6 +395,15 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest& SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc); } + const XFillHatchItem* pTempHatchItem = pTempSet->GetItem(XATTR_FILLHATCH); + if (pTempHatchItem && pTempHatchItem->GetName().isEmpty()) + { + // MigrateItemSet guarantees unique hatch names + SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items{} ); + aMigrateSet.Put( XFillHatchItem("hatch", pTempHatchItem->GetHatchValue()) ); + SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc); + } + if( !mbMasterPage && bChanges && mbPageBckgrdDeleted ) { mpBackgroundObjUndoAction.reset( new SdBackgroundObjUndoAction( -- cgit