summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-07 16:36:24 +0200
committerAndras Timar <andras.timar@collabora.com>2015-09-18 10:10:29 +0200
commit90b145d07fee5e3efc8fedebdd0941f2d5b5387c (patch)
tree521385e01c13592077c19a293d00cae3304a17bd /svl
parent87290520a724fc359d70d961f1ee80f16a2cf1c0 (diff)
tdf#91383: sw: prevent style preview from actually creating styles
The dialog/sidebar should not actually create styles that don't exist yet, because it messes up Undo and the (unused) styles are then unnecessarily exported to documents. Due to Writer's ... unusual SwDocStyleSheet class this is a bit tricky. Add a new function GetItemSetForPreview() and use it from the style preview code. The implementation does not use FillPhysical so will temporarily create and then delete any non-existing styles. Skip page and numbering styles for now since they don't have a useful preview. (regression from ca95307638207db5d662059aa61594151a13e927) (cherry picked from commit 93067f37cf22aa119db5878c4345fea500cbbb42) -Werror,-Wreturn-type (cherry picked from commit 0ed64030f17849ea943800343003c5ec3f4f1388) Change-Id: Id6ee30ea467fc24c991547a4c23a9ce14fdd86c7 Reviewed-on: https://gerrit.libreoffice.org/18381 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/style.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index bbbd45ede5e2..01da088c0ed4 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -284,6 +284,11 @@ SfxItemSet& SfxStyleSheetBase::GetItemSet()
return *pSet;
}
+std::unique_ptr<SfxItemSet> SfxStyleSheetBase::GetItemSetForPreview()
+{
+ return std::unique_ptr<SfxItemSet>(new SfxItemSet(GetItemSet()));
+}
+
/**
* Set help file and ID and return it
*/