summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-12-05 19:48:36 +0300
committerJustin Luth <justin_luth@sil.org>2020-12-17 18:41:51 +0100
commit0c37e164dbbff89ecac843e1b182fdbce70cda34 (patch)
treeee87297465c1cfd66bd5dc2e3e7b4bf17db25dec
parent554949d5cacaff2d0080b3e4f6124f8c5b045d6e (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>
-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(