Kaydet (Commit) 7376a476 authored tarafından László Németh's avatar László Németh

tdf#92335 DOCX: fix multiplying of "ListLabel" styles

by removing the redundant export of the temporary
DOCX import character styles for bullets of bulleted lists.

Note: this commit will fix the older documents – sometimes
with thousands of unused styles – by the next export.

The problem was escalated from the commit
f9c8d97d
"tdf#95213 DOCX import: don't reuse list label styles"

Change-Id: I90590352c0c85a92dbad19a45e82339e1201f1e9
Reviewed-on: https://gerrit.libreoffice.org/73098
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst 86cab846
......@@ -1122,6 +1122,15 @@ DECLARE_OOXMLEXPORT_TEST(testFlipAndRotateCustomShape, "flip_and_rotate.odt")
#endif
}
DECLARE_OOXMLEXPORT_TEST(testTdf92335, "tdf92335.docx")
{
// Don't export redundant ListLabel character styles
xmlDocPtr pXmlStyles = parseExport("word/styles.xml");
if (!pXmlStyles)
return;
assertXPath(pXmlStyles, "//w:style[@w:styleId='ListLabel1']", 0);
}
CPPUNIT_PLUGIN_IMPLEMENT();
......
......@@ -618,6 +618,11 @@ void MSWordStyles::OutputStyle( SwFormat* pFormat, sal_uInt16 nPos )
aName = aBaseName + OUString::number(++nSuffix);
}
}
else if (!bFormatColl && m_rExport.m_pStyles->GetStyleId(nPos).startsWith("ListLabel"))
{
// tdf#92335 don't export redundant DOCX import style "ListLabel"
return;
}
m_rExport.AttrOutput().StartStyle( aName, (bFormatColl ? STYLE_TYPE_PARA : STYLE_TYPE_CHAR),
nBase, nWwNext, GetWWId( *pFormat ), nPos,
......
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