diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-06-15 10:34:41 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-06-15 15:47:01 +0200 |
commit | 7db19db341608ba2059543a3c8d61cd458470602 (patch) | |
tree | 7aede16cd30399219b057b68cdae34ad2af255d2 /sw/source | |
parent | 694c9da5076006275a10373e42a1c6ee4e0dbbeb (diff) |
ODF export: simplify restart handling to skip list id where possible
This continues to minimize cases where random ids are written, helping
to make the output more deterministic; it builds upon commits
8f48f91009caa86d896f247059874242ed18bf39 (ODT export: omit unreferenced
<text:list xml:id="...">, 2022-03-10), and
82bbf63582bdf28e7918e58ebf6657a9144bc9f3 (tdf#155823: Improve the check
if the list id is not required, 2023-06-14).
The previous code used to write 'text:continue-list' when the list is
restarted. It is unnecessary when there is no other condition requiring
such a reference (like style change, or interleaving lists); so relax
the conditions allowing to put simple 'text:continue-numbering="true"'.
This also allows to simplify a bit the code around 'ShouldSkipListId'.
Change-Id: Idf8be455953d08fd578266bda22f3a55d7b9ee23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153104
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 51c777ee47da..e68d468e3fff 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1974,8 +1974,8 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) // A hack to avoid writing random list ids to ODF when they are not referred later // see XMLTextParagraphExport::DocumentListNodes ctor - // Sequence of nodes, each of them represented by four-element sequence: - // [ index, styleIntPtr, list_id, isRestart ] + // Sequence of nodes, each of them represented by three-element sequence: + // [ index, styleIntPtr, list_id ] std::vector<css::uno::Sequence<css::uno::Any>> nodes; const SwDoc& rDoc = *m_pDocShell->GetDoc(); @@ -1989,9 +1989,8 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) { css::uno::Any index(pTextNode->GetIndex().get()); css::uno::Any list_id(pTextNode->GetListId()); - css::uno::Any isRestart(pTextNode->IsListRestart()); - nodes.push_back({ index, styleIntPtr, list_id, isRestart }); + nodes.push_back({ index, styleIntPtr, list_id }); } } return css::uno::Any(comphelper::containerToSequence(nodes)); |