summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/list.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-01-13 11:03:17 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2021-01-21 16:59:44 +0100
commit31d6684c9a0e366f82b7cc92e43576f4495aaef6 (patch)
tree118b27a16399e391d2f1dee1752a1fb1574ca1c7 /sw/source/core/doc/list.cxx
parentbfc53a1d1fd99fef142ad040263a03734583e611 (diff)
tdf#135014 sw: fix crash exporting numbering to DOCX
It can happen that the default SwNumRule of a SwList isn't used by anything directly, but there are other SwNumRule associated with that SwList and then the DOCX export needs to export it as an abstract numbering definition. (regression from 632ee9aae6d5f3cf08b6d6b2789310c20db713b7) Change-Id: I6b1851980464aaa95bf731a60b7d11ab91cec7b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109303 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit cd1c9f5167e797807d6726219f06190657f58372) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109335 Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit e0be320cc790856df4d9a102d15de08aa16217fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109336 Tested-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/source/core/doc/list.cxx')
-rw-r--r--sw/source/core/doc/list.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx
index c81eef636ff1..3651e706f4b7 100644
--- a/sw/source/core/doc/list.cxx
+++ b/sw/source/core/doc/list.cxx
@@ -39,6 +39,8 @@ class SwListImpl
const OUString& GetDefaultListStyleName() const { return msDefaultListStyleName;}
+ bool HasNodes() const;
+
void InsertListItem( SwNodeNum& rNodeNum, bool isHiddenRedlines,
const int nLevel );
static void RemoveListItem( SwNodeNum& rNodeNum );
@@ -122,6 +124,18 @@ SwListImpl::~SwListImpl() COVERITY_NOEXCEPT_FALSE
}
}
+bool SwListImpl::HasNodes() const
+{
+ for (auto const& rNumberTree : maListTrees)
+ {
+ if (rNumberTree.pRoot->GetChildCount() != 0)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
void SwListImpl::InsertListItem( SwNodeNum& rNodeNum, bool const isHiddenRedlines,
const int nLevel )
{
@@ -225,6 +239,11 @@ SwList::~SwList()
{
}
+bool SwList::HasNodes() const
+{
+ return mpListImpl->HasNodes();
+}
+
const OUString & SwList::GetListId() const
{
return mpListImpl->GetListId();