diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-09-07 16:36:24 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-09-07 16:49:58 +0200 |
commit | 93067f37cf22aa119db5878c4345fea500cbbb42 (patch) | |
tree | f8660673667e6addc9b08b2e76350cbac469ddee /svl | |
parent | 110dc43d97d559b6369bca308f9dd39fd02e751e (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)
Change-Id: Id6ee30ea467fc24c991547a4c23a9ce14fdd86c7
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/style.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx index 5e9e5246004c..930bf92ca77c 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 */ |