diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-05 11:16:32 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-10 12:51:33 +0200 |
commit | 7b661ad44b81a200caaff0afaa0c822e3d635ee5 (patch) | |
tree | 7809fb1cef0a686623992e719ee8d8b0e1c467bd /sw/source/filter | |
parent | 333b62f36f3cf8feff4fed7cf2e6e1439f7c1d36 (diff) |
tdf#124470: Split export of table autostyles out from collection phase
This allows to call collectAutoStyles where required (e.g. when enumerating
used fonts), without side effect of writing table styles XML inside the call,
out of place.
Change-Id: Ida05e373eb8502590c43e2b0e85c3b0c1107c551
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100153
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 35021cd56b3b4e38035804087f215c80085564be)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100221
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100274
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexte.hxx | 6 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index bef72a6f5357..80d786d8d884 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -1140,6 +1140,13 @@ void SwXMLExport::ExportTable( const SwTableNode& rTableNd ) } } +void SwXMLTextParagraphExport::exportTableAutoStyles() { + for (const auto* pTableNode : maTableNodes) + { + static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles(*pTableNode); + } +} + void SwXMLTextParagraphExport::exportTable( const Reference < XTextContent > & rTextContent, bool bAutoStyles, bool _bProgress ) @@ -1177,7 +1184,7 @@ void SwXMLTextParagraphExport::exportTable( // ALL flags are set at the same time. const bool bExportStyles = bool( GetExport().getExportFlags() & SvXMLExportFlags::STYLES ); if ( bExportStyles || !pFormat->GetDoc()->IsInHeaderFooter( aIdx ) ) - static_cast<SwXMLExport&>(GetExport()).ExportTableAutoStyles( *pTableNd ); + maTableNodes.push_back(pTableNd); } else { diff --git a/sw/source/filter/xml/xmltexte.hxx b/sw/source/filter/xml/xmltexte.hxx index 8da021506c0d..4432e4ce0166 100644 --- a/sw/source/filter/xml/xmltexte.hxx +++ b/sw/source/filter/xml/xmltexte.hxx @@ -28,6 +28,7 @@ class SwXMLExport; class SvXMLAutoStylePoolP; class SwNoTextNode; +class SwTableNode; namespace com { namespace sun { namespace star { namespace style { class XStyle; } } } } @@ -38,6 +39,9 @@ class SwXMLTextParagraphExport : public XMLTextParagraphExport const SvGlobalName aPluginClassId; const SvGlobalName aIFrameClassId; + // Collected autostyles for use in exportTextAutoStyles + std::vector<const SwTableNode*> maTableNodes; + static SwNoTextNode *GetNoTextNode( const css::uno::Reference < css::beans::XPropertySet >& rPropSet ); @@ -52,6 +56,8 @@ protected: const css::uno::Reference< css::text::XTextContent > & rTextContent, bool bAutoStyles, bool bProgress ) override; + virtual void exportTableAutoStyles() override; + public: SwXMLTextParagraphExport( SwXMLExport& rExp, |