summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinaya Mandke <vinaya.mandke@synerzip.com>2014-06-06 14:12:48 +0530
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-06-10 09:57:45 +0200
commite49d2b31fb2020d065b4ad940d1031d07b10f32b (patch)
tree56afea072f3fd643a6edcda182fc756af2f969db
parentf3160a7effe70f10c669b085c840bfc77b8ef671 (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 Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Reviewed on: https://gerrit.libreoffice.org/9668 Change-Id: I8cc143805a38613908d2e2cb4827882d4cf40a78
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo78939.docxbin0 -> 73680 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx12
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx8
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
new file mode 100644
index 000000000000..2fc3198630cd
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo78939.docx
Binary files 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<OUString>(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<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 );