summaryrefslogtreecommitdiff
path: root/sw/inc/istyleaccess.hxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-03-20 14:49:15 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-03-20 16:28:39 +0100
commiteb128a7d6bbc27b4dbbf9461c81c90e40203b114 (patch)
tree594c5ccfadd78b58cef53668b5dd6c92b11d6ced /sw/inc/istyleaccess.hxx
parent0fb66ff74cbe2e767b91f05b123c782f59ac39ab (diff)
sw: make ODT export of paragraph auto-styles deterministic
If a complex enough document is loaded into Writer and saved as ODT, then the content.xml's automatic paragraph styles (P<num>) are re-ordered on each save, which leads to unnecessary noise. The actual random order is created during import by the time we convert direct formatting (e.g. from HTML import) to autostyles, as StylePoolImpl::maRoot stores autostyles in a map that orders autostyle parents based on their pointer address. This has benefits like automatic ordering of item sets and fast comparison, so don't change that, but extend the svl API to also track the name of those parents. This way by the time StylePool::createIterator() would iterate over those autostyles, it can order the parents by their name, so two import->export runs will result in the same autostyle ordering. (This appears to be the only indeterminism in content.xml for a test HTML input, while meta.xml and settings.xml still changes all the time.) Change-Id: I1cfcae2c664a5c5c3dee48be733046979c1593ed Reviewed-on: https://gerrit.libreoffice.org/69469 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/inc/istyleaccess.hxx')
-rw-r--r--sw/inc/istyleaccess.hxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/inc/istyleaccess.hxx b/sw/inc/istyleaccess.hxx
index 88de8512a7ad..7bb832f08cdb 100644
--- a/sw/inc/istyleaccess.hxx
+++ b/sw/inc/istyleaccess.hxx
@@ -36,7 +36,8 @@ public:
virtual ~IStyleAccess() {}
virtual std::shared_ptr<SfxItemSet> getAutomaticStyle( const SfxItemSet& rSet,
- SwAutoStyleFamily eFamily ) = 0;
+ SwAutoStyleFamily eFamily,
+ const OUString* pParentName = nullptr ) = 0;
virtual void getAllStyles( std::vector<std::shared_ptr<SfxItemSet>> &rStyles,
SwAutoStyleFamily eFamily ) = 0;
/** It's slow to iterate through a stylepool looking for a special name, but if