fdo#78939 [DOCX] Hang while opening due to incorrect modification of Style
http://opengrok.libreoffice.org/xref/core/sw/source/core/unocore/unosett.cxx#1884 Modifies the refernced style of the numbering rule to use the current numbering rule. Actually the refernced style is not supposed to be modified. As the numbering level formatonly uses that properties particular style, which may or may not be a numbering style For this Particular document the numbering format refers the "Default Style" (Normal). Almost all of the styles in style.xml are based on it. Normal was modified, and as a result the whole document was bulletized; Which caused the hang while opening Removed the addition of style as a PARA_STYLE, as the properties of the refernced style are already added in ListLevel::AddParaProperties Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Reviewed on: https://gerrit.libreoffice.org/9668 Change-Id: I8cc143805a38613908d2e2cb4827882d4cf40a78
This commit is contained in:
parent
f3160a7eff
commit
e49d2b31fb
BIN
sw/qa/extras/ooxmlimport/data/fdo78939.docx
Normal file
BIN
sw/qa/extras/ooxmlimport/data/fdo78939.docx
Normal file
Binary file not shown.
@ -2198,6 +2198,18 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeTrackedchanges, "groupshape-trackedchange
|
||||
CPPUNIT_ASSERT_EQUAL(OUString(" Inserted"), xShape->getString());
|
||||
}
|
||||
|
||||
DECLARE_OOXMLIMPORT_TEST(testFdo78939, "fdo78939.docx")
|
||||
{
|
||||
// fdo#78939 : LO hanged while opening issue document
|
||||
|
||||
// Whenever a para-style was applied to a Numbering format level,
|
||||
// LO incorrectly also changed the para-style..
|
||||
|
||||
// check that file opens and does not hang while opening and also
|
||||
// check that an incorrect numbering style is not applied ...
|
||||
CPPUNIT_ASSERT_EQUAL(OUString(), getProperty<OUString>(getParagraph(1), "NumberingStyleName"));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||
|
@ -643,13 +643,6 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
|
||||
aLvlProps[sal::static_int_cast<sal_uInt32>(aLvlProps.getLength()) - 1] = MAKE_PROPVAL( PROP_POSITION_AND_SPACE_MODE,
|
||||
sal_Int16( text::PositionAndSpaceMode::LABEL_ALIGNMENT ) );
|
||||
|
||||
StyleSheetEntryPtr pParaStyle = pAbsLevel->GetParaStyle( );
|
||||
if( pParaStyle.get())
|
||||
{
|
||||
aLvlProps.realloc( aLvlProps.getLength() + 1 );
|
||||
aLvlProps[sal::static_int_cast<sal_uInt32>(aLvlProps.getLength()) - 1] = MAKE_PROPVAL( PROP_PARAGRAPH_STYLE_NAME,
|
||||
pParaStyle->sConvertedStyleName );
|
||||
}
|
||||
|
||||
// Replace the numbering rules for the level
|
||||
m_xNumRules->replaceByIndex( nLevel, uno::makeAny( aLvlProps ) );
|
||||
@ -662,6 +655,7 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
|
||||
uno::Reference< container::XIndexReplace > xOutlineRules =
|
||||
xOutlines->getChapterNumberingRules( );
|
||||
|
||||
StyleSheetEntryPtr pParaStyle = pAbsLevel->GetParaStyle( );
|
||||
aLvlProps.realloc( aLvlProps.getLength() + 1 );
|
||||
aLvlProps[sal::static_int_cast<sal_uInt32>(aLvlProps.getLength()) - 1] = MAKE_PROPVAL( PROP_HEADING_STYLE_NAME,
|
||||
pParaStyle->sConvertedStyleName );
|
||||
|
Loading…
x
Reference in New Issue
Block a user