summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2021-09-10 16:48:47 +0200
committerMiklos Vajna <vmiklos@collabora.com>2021-09-13 08:53:08 +0200
commitf76f2fc99dcb4a6a250835ec1d52e7c3f6a73321 (patch)
treef3b74caa62af81061008d23bca32515f03681c98
parentf3993912ec4b526aa57cb4bfb4745d7298a4da82 (diff)
tdf#137363 DOC export: don't lose sprmPIlvl of para style
Move the DOCX code so that it provides the style's level to all three formats. (RTF just returns when no text node, so there is no impact in that case). Change-Id: Iadeb3e6d9f4e3f0d86222cb3f6bfef84d87d87f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121909 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx13
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx9
2 files changed, 9 insertions, 13 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index d4067db3703b..c2aa3880ece0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -8829,19 +8829,6 @@ 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));
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 0783784cce46..8d5710e2b1cd 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3745,6 +3745,15 @@ void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
{
if ( pC && pC->IsAssignedToListLevelOfOutlineStyle() )
nLvl = static_cast< sal_uInt8 >( pC->GetAssignedOutlineStyleLevel() );
+ else
+ {
+ const SfxItemSet* pSet = GetExport().m_pISet;
+ if (pSet && pSet->HasItem(RES_PARATR_LIST_LEVEL))
+ {
+ const SfxPoolItem* pItem = pSet->GetItem(RES_PARATR_LIST_LEVEL);
+ nLvl = pItem->StaticWhichCast(RES_PARATR_LIST_LEVEL).GetValue();
+ }
+ }
}
if ( nLvl >= WW8ListManager::nMaxLevel )