summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-09-07 16:36:24 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-09-08 08:42:17 +0000
commit19347304b2594f28fadf7cefe6aab4fdb5c9047f (patch)
tree46c9bb3301ee54a64691282d8f4d7a36dc4ea944 /include
parent4b9c51bd265908e8bf65cb2a462dd8fd9a88904f (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 'include')
-rw-r--r--include/svl/style.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/svl/style.hxx b/include/svl/style.hxx
index 5798b4936285..79eadf62cc7a 100644
--- a/include/svl/style.hxx
+++ b/include/svl/style.hxx
@@ -143,6 +143,11 @@ public:
virtual void SetHelpId( const OUString& r, sal_uLong nId );
virtual SfxItemSet& GetItemSet();
+ /// Due to writer's usual lack of sanity this is a separate function for
+ /// preview only; it shall not create the style in case it does not exist.
+ /// If the style has parents, it is _not_ required that the returned item
+ /// set has parents (i.e. use it for display purposes only).
+ virtual std::unique_ptr<SfxItemSet> GetItemSetForPreview();
};
/* Class to iterate and search on a SfxStyleSheetBasePool */