diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-08-27 13:13:45 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-08-27 14:00:12 +0200 |
commit | 9ea594ffcf4f807306440e4628eecca8c75be8ee (patch) | |
tree | 5d219b28e546eb9be3b8c063b11a678b186e8c51 /sw/source/filter/ww8/docxattributeoutput.cxx | |
parent | c56178f0daf69abb362e6216f51b6e1f5aff1777 (diff) |
tdf#137363 DOCX filter: don't loose <w:ilvl w:val="..."> of paragraph styles
This adds doc model, UNO API and DOCX import/export for this feature.
The rest is not yet implemented (i.e. no layout, UI, etc.)
An alternative would be to grab-bag the list level of paragraph styles,
putting it to the doc model directly has the benefit that this is a step
in the right direction.
Change-Id: Idf7157e8a4177b4c2286d3cfb3d5acf2df845076
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121141
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index c447bf7a60c8..b9cfa3c6bd37 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -8829,6 +8829,19 @@ void DocxAttributeOutput::ParaNumRule_Impl( const SwTextNode* pTextNd, sal_Int32 return; } + if (!pTextNd && nLvl == 0) + { + // This is a paragraph style and the level would be zero. Then see if the importer set a + // custom numbering level. + const SfxItemSet* pSet = m_rExport.m_pISet; + if (pSet && pSet->HasItem(RES_PARATR_LIST_LEVEL)) + { + // It did, so use that level. + const SfxPoolItem* pItem = pSet->GetItem(RES_PARATR_LIST_LEVEL); + nLvl = pItem->StaticWhichCast(RES_PARATR_LIST_LEVEL).GetValue(); + } + } + m_pSerializer->startElementNS(XML_w, XML_numPr); m_pSerializer->singleElementNS(XML_w, XML_ilvl, FSNS(XML_w, XML_val), OString::number(nLvl)); m_pSerializer->singleElementNS(XML_w, XML_numId, FSNS(XML_w, XML_val), OString::number(nNumId)); |