[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sw/qa writerfilter/source

Vinaya Mandke vinaya.mandke at synerzip.com
Mon Jul 7 13:53:27 PDT 2014


 sw/qa/extras/ooxmlimport/data/fdo78939.docx      |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx         |   12 ++++++++++++
 writerfilter/source/dmapper/NumberingManager.cxx |    8 +-------
 3 files changed, 13 insertions(+), 7 deletions(-)

New commits:
commit 933545f9bee6ed8d791ee4026cc0986702417ed8
Author: Vinaya Mandke <vinaya.mandke at synerzip.com>
Date:   Fri Jun 6 14:12:48 2014 +0530

    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 at 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 at redhat.com>

diff --git a/sw/qa/extras/ooxmlimport/data/fdo78939.docx b/sw/qa/extras/ooxmlimport/data/fdo78939.docx
new file mode 100644
index 0000000..2fc3198
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 f2051fa..b55c64d 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 547c7b0..57159b9 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 );


More information about the Libreoffice-commits mailing list