diff --git a/sw/qa/extras/ooxmlimport/data/fdo78939.docx b/sw/qa/extras/ooxmlimport/data/fdo78939.docx new file mode 100644 index 000000000000..2fc3198630cd Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo78939.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index ea1910ba20b0..1102c29a71da 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -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(getParagraph(1), "NumberingStyleName")); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 65f6a669b321..66e9d65b4bc6 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -643,13 +643,6 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper, aLvlProps[sal::static_int_cast(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(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(aLvlProps.getLength()) - 1] = MAKE_PROPVAL( PROP_HEADING_STYLE_NAME, pParaStyle->sConvertedStyleName );