diff options
author | Vinaya Mandke <vinaya.mandke@synerzip.com> | 2014-06-06 14:12:48 +0530 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-07-07 22:38:31 +0200 |
commit | 933545f9bee6ed8d791ee4026cc0986702417ed8 (patch) | |
tree | fd54e81048dc388a74fb67f757c442eeb7eafffa | |
parent | b863a201c2a39751539e4a5d53897c41e67efec3 (diff) |
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
Signed-off-by: Michael Stahl <mstahl@redhat.com>
Conflicts:
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Reviewed on:
https://gerrit.libreoffice.org/9668
Change-Id: I8cc143805a38613908d2e2cb4827882d4cf40a78
(cherry picked from commit e49d2b31fb2020d065b4ad940d1031d07b10f32b)
Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/fdo78939.docx | bin | 0 -> 73680 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 12 | ||||
-rw-r--r-- | writerfilter/source/dmapper/NumberingManager.cxx | 8 |
3 files changed, 13 insertions, 7 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo78939.docx b/sw/qa/extras/ooxmlimport/data/fdo78939.docx Binary files differnew file mode 100644 index 000000000000..2fc3198630cd --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/fdo78939.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index f2051faac7d5..b55c64d5278f 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -2051,6 +2051,18 @@ DECLARE_OOXMLIMPORT_TEST(testFdo75722vml, "fdo75722-vml.docx") CPPUNIT_ASSERT_EQUAL(sal_Int64(3100), nRot); } +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")); +} + DECLARE_OOXMLIMPORT_TEST(testFdo75722dml, "fdo75722-dml.docx") { uno::Reference<drawing::XShape> xShape = getShape(1); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 547c7b062d0b..57159b987ec6 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -647,13 +647,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 ) ); @@ -666,6 +659,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 ); |