summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-12-05 19:48:36 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2020-12-18 10:30:30 +0100
commit6b161f615712f6daa11f66d0dfe45eef0877c860 (patch)
treecff285380f088ccaae2be52feb61de1ef614eddf /sd
parentf5331b17cb71096ee6f149db841b7802efa0c4c4 (diff)
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 <xiscofauli@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 0c37e164dbbff89ecac843e1b182fdbce70cda34) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107898
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 3779feec3f82..6d44b70d5a9d 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -37,6 +37,7 @@
#include <svx/xflbstit.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xflgrit.hxx>
+#include <svx/xflhtit.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <svx/sdr/properties/properties.hxx>
@@ -394,6 +395,15 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc);
}
+ const XFillHatchItem* pTempHatchItem = pTempSet->GetItem<XFillHatchItem>(XATTR_FILLHATCH);
+ if (pTempHatchItem && pTempHatchItem->GetName().isEmpty())
+ {
+ // MigrateItemSet guarantees unique hatch names
+ SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items<XATTR_FILLHATCH, XATTR_FILLHATCH>{} );
+ aMigrateSet.Put( XFillHatchItem("hatch", pTempHatchItem->GetHatchValue()) );
+ SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc);
+ }
+
if( !mbMasterPage && bChanges && mbPageBckgrdDeleted )
{
mpBackgroundObjUndoAction.reset( new SdBackgroundObjUndoAction(