diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-08-21 00:15:29 +0300 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2020-09-23 13:35:43 +0200 |
commit | 63fba1ef338f14e2451baf039e0ae30d992b6743 (patch) | |
tree | 2ce3746f592071aeee30f9e59a112a3c93978009 /sw/source/filter | |
parent | def6e51cd56814aad3cbb8c1035da71c47927854 (diff) |
tdf#135942: avoid collecting autostyles during writing them
This modifies the container over which iteration is performed.
Additionally, make sure that all nested table autostyles are
collected on the first phase.
Change-Id: I74c0bb1aaacad095226c21e6bf51cc8668133bb3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101096
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit f0286ad82465152b29bba01ab2edeb97291397fa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101069
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 0273675e7dde577077ccca17571846a0942f2630)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102311
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 80d786d8d884..6a4fa1c9902b 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -1183,8 +1183,27 @@ void SwXMLTextParagraphExport::exportTable( // During the flat XML export (used e.g. by .sdw-export) // ALL flags are set at the same time. const bool bExportStyles = bool( GetExport().getExportFlags() & SvXMLExportFlags::STYLES ); - if ( bExportStyles || !pFormat->GetDoc()->IsInHeaderFooter( aIdx ) ) + if (!isAutoStylesCollected() + && (bExportStyles || !pFormat->GetDoc()->IsInHeaderFooter(aIdx))) + { maTableNodes.push_back(pTableNd); + // Collect all tables inside cells of this table, too + const auto aCellNames = pXTable->getCellNames(); + for (const OUString& rCellName : aCellNames) + { + css::uno::Reference<css::container::XEnumerationAccess> xCell( + pXTable->getCellByName(rCellName), css::uno::UNO_QUERY); + if (!xCell) + continue; + auto xEnumeration = xCell->createEnumeration(); + while (xEnumeration->hasMoreElements()) + { + if (css::uno::Reference<css::text::XTextTable> xInnerTable{ + xEnumeration->nextElement(), css::uno::UNO_QUERY }) + exportTable(xInnerTable, bAutoStyles, _bProgress); + } + } + } } else { |