diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2018-07-12 16:37:18 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-07-12 21:08:03 +0200 |
commit | 1a8435a23e84f3ceeee580eb9d4404a738d98888 (patch) | |
tree | 4f69a838844886417bd491f9cfd4dfc5b074151a /sw/source/filter/xml/xmlfmte.cxx | |
parent | 68d3a44bc96041982cb38c140c0f9628dc8547c5 (diff) |
tdf#65353 separate autostyle collection and export
To be able to look which fonts are in use, we need to collect the
autostyles which contains all styles that are used in a document.
Previously the autostyles were collected in the same process as
they were expoted, so with this commit we separate collaction and
export. First we collacte the auto styles, then e can use them in
embedded fonts export, the last we export the auto styles
themselves.
Change-Id: Ib939f1119f4af00a1e5d66fcd2e04b9d2add6881
Reviewed-on: https://gerrit.libreoffice.org/57348
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/filter/xml/xmlfmte.cxx')
-rw-r--r-- | sw/source/filter/xml/xmlfmte.cxx | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/sw/source/filter/xml/xmlfmte.cxx b/sw/source/filter/xml/xmlfmte.cxx index 6c2d08571f14..d099a91c9e12 100644 --- a/sw/source/filter/xml/xmlfmte.cxx +++ b/sw/source/filter/xml/xmlfmte.cxx @@ -169,12 +169,16 @@ void SwXMLExport::ExportStyles_( bool bUsed ) GetPageExport()->exportDefaultStyle(); } -void SwXMLExport::ExportAutoStyles_() +void SwXMLExport::collectAutoStyles() { + SvXMLExport::collectAutoStyles(); + + if (mbAutoStylesCollected) + return; + // The order in which styles are collected *MUST* be the same as // the order in which they are exported. Otherwise, caching will // fail. - if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) ) { if( !(getExportFlags() & SvXMLExportFlags::CONTENT) ) @@ -190,17 +194,10 @@ void SwXMLExport::ExportAutoStyles_() if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES ) GetPageExport()->collectAutoStyles( false ); - // if we don't export styles (i.e. in content stream only, but not - // in single-stream case), then we can save ourselves a bit of - // work and memory by not collecting field masters - if( !(getExportFlags() & SvXMLExportFlags::STYLES) ) - GetTextParagraphExport()->exportUsedDeclarations(); // exported in ExportContent_ if( getExportFlags() & SvXMLExportFlags::CONTENT ) { - GetTextParagraphExport()->exportTrackedChanges( true ); - // collect form autostyle // (do this before collectTextAutoStyles, 'cause the shapes need the results of the work // done by examineForms) @@ -215,6 +212,25 @@ void SwXMLExport::ExportAutoStyles_() GetTextParagraphExport()->collectTextAutoStylesOptimized( m_bShowProgress ); } + mbAutoStylesCollected = true; +} + +void SwXMLExport::ExportAutoStyles_() +{ + collectAutoStyles(); + + // if we don't export styles (i.e. in content stream only, but not + // in single-stream case), then we can save ourselves a bit of + // work and memory by not collecting field masters + if( !(getExportFlags() & SvXMLExportFlags::STYLES) ) + GetTextParagraphExport()->exportUsedDeclarations(); + + // exported in ExportContent_ + if( getExportFlags() & SvXMLExportFlags::CONTENT ) + { + GetTextParagraphExport()->exportTrackedChanges( true ); + } + GetTextParagraphExport()->exportTextAutoStyles(); GetShapeExport()->exportAutoStyles(); if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES ) |