Kaydet (Commit) 8e9e705d authored tarafından Justin Luth's avatar Justin Luth Kaydeden (comit) Miklos Vajna

tdf#76817 ooxmlexport: only use stylename for Outline list

In LibreOffice, the special, built-in, Outline numbering style
("Chapter Numbering") is connected via the paragraph style
to control the numbering.

Thus, only the ParaStyleName should be written to
the paragraph properties, and not the direct numbering properties.
Both MSO and LO get confused when there are multiple definitions
for outline numbering.

Change-Id: I1af54fdea164d68e5e156c256b478e518daa5e99
Reviewed-on: https://gerrit.libreoffice.org/47828Reviewed-by: 's avatarJustin Luth <justin_luth@sil.org>
Tested-by: 's avatarJustin Luth <justin_luth@sil.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 66d0e154
......@@ -688,7 +688,7 @@ DECLARE_OOXMLEXPORT_TEST(testOOxmlOutlineNumberTypes, "outline-number-types.odt"
DECLARE_OOXMLEXPORT_TEST(testNumParentStyle, "num-parent-style.docx")
{
//CPPUNIT_ASSERT_EQUAL(OUString("Outline"), getProperty<OUString>(getParagraph(4), "NumberingStyleName"));
CPPUNIT_ASSERT_EQUAL(OUString("Outline"), getProperty<OUString>(getParagraph(4), "NumberingStyleName"));
}
DECLARE_OOXMLEXPORT_TEST(testNumOverrideLvltext, "num-override-lvltext.docx")
......
......@@ -7763,14 +7763,22 @@ void DocxAttributeOutput::ParaHyphenZone( const SvxHyphenZoneItem& rHyphenZone )
FSEND );
}
void DocxAttributeOutput::ParaNumRule_Impl( const SwTextNode* /*pTextNd*/, sal_Int32 nLvl, sal_Int32 nNumId )
void DocxAttributeOutput::ParaNumRule_Impl( const SwTextNode* pTextNd, sal_Int32 nLvl, sal_Int32 nNumId )
{
if ( USHRT_MAX != nNumId )
{
m_pSerializer->startElementNS( XML_w, XML_numPr, FSEND );
m_pSerializer->singleElementNS( XML_w, XML_ilvl, FSNS( XML_w, XML_val ), OString::number( nLvl).getStr(), FSEND );
m_pSerializer->singleElementNS( XML_w, XML_numId, FSNS( XML_w, XML_val ), OString::number( nNumId).getStr(), FSEND );
m_pSerializer->endElementNS( XML_w, XML_numPr );
const sal_Int32 nTableSize = m_rExport.m_pUsedNumTable ? m_rExport.m_pUsedNumTable->size() : 0;
const SwNumRule* pRule = nNumId > 0 && nNumId <= nTableSize ? (*m_rExport.m_pUsedNumTable)[nNumId-1] : nullptr;
const bool bOutlineRule = pRule && pRule->IsOutlineRule();
// Do not export outline rules (Chapter Numbering) as paragraph properties, only as style properties.
if ( !pTextNd || !bOutlineRule )
{
m_pSerializer->startElementNS( XML_w, XML_numPr, FSEND );
m_pSerializer->singleElementNS( XML_w, XML_ilvl, FSNS( XML_w, XML_val ), OString::number( nLvl).getStr(), FSEND );
m_pSerializer->singleElementNS( XML_w, XML_numId, FSNS( XML_w, XML_val ), OString::number( nNumId).getStr(), FSEND );
m_pSerializer->endElementNS( XML_w, XML_numPr );
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment