[Libreoffice-commits] core.git: sw/qa sw/source

Miklos Vajna vmiklos at suse.cz
Tue Jun 11 06:45:45 PDT 2013


 sw/qa/core/data/rtf/README           |    3 +++
 sw/qa/core/data/rtf/pass/abi3241.rtf |    9 +++++++++
 sw/qa/core/filters-test.cxx          |    5 +++++
 sw/source/core/txtnode/ndtxt.cxx     |    2 +-
 4 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit a1762795e7c758bc55cfba039e280273a4f26cc5
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Tue Jun 11 15:24:40 2013 +0200

    abi#3241 fix crash on RTF import
    
    The problem was that SwTxtFmtColl::IsAssignedToListLevelOfOutlineStyle()
    returned true, because the style name started with "header". However,
    there were no real assignment, so
    SwTxtFmtColl::GetAssignedOutlineStyleLevel() returned -1 later, which
    resulted in a (valid) assertion failure.
    
    Fix this by handling -1 outline level as not assigned.
    
    Change-Id: I522f75002cf064ce7bc4da949683ac4e5ff4ec72

diff --git a/sw/qa/core/data/rtf/README b/sw/qa/core/data/rtf/README
new file mode 100644
index 0000000..cd109d3
--- /dev/null
+++ b/sw/qa/core/data/rtf/README
@@ -0,0 +1,3 @@
+Put RTF crash-test files here only in case the crash is in Writer core. If the
+crash is in the RTF import itself, use the writerfilter RTF testsuite instead,
+that's faster.
diff --git a/sw/qa/core/data/rtf/fail/.gitignore b/sw/qa/core/data/rtf/fail/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sw/qa/core/data/rtf/indeterminate/.gitignore b/sw/qa/core/data/rtf/indeterminate/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/sw/qa/core/data/rtf/pass/abi3241.rtf b/sw/qa/core/data/rtf/pass/abi3241.rtf
new file mode 100644
index 0000000..5bfec3d
--- /dev/null
+++ b/sw/qa/core/data/rtf/pass/abi3241.rtf
@@ -0,0 +1,9 @@
+{\rtf1
+{\stylesheet
+{\sa120 Normal;}
+{\s6\sbasedon0 \snext0 heading 6;}
+}
+\pard\plain \s6
+If more than one reaction channel is to be considered, use the keyword
+\par
+}
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 26fcd58..e5ba36b 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -112,6 +112,11 @@ void SwFiltersTest::testCVEs()
             getURLFromSrc("/sw/qa/core/data/ooxml/"),
             OUString(),
             SFX_FILTER_STARONEFILTER);
+
+    testDir(OUString("Rich Text Format"),
+            getURLFromSrc("/sw/qa/core/data/rtf/"),
+            OUString(),
+            SFX_FILTER_STARONEFILTER);
 }
 
 void SwFiltersTest::setUp()
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 07f36ef..8d4cdaf 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1067,7 +1067,7 @@ void SwTxtNode::_ChgTxtCollUpdateNum( const SwTxtFmtColl *pOldColl,
     const int nNewLevel = pNewColl && pNewColl->IsAssignedToListLevelOfOutlineStyle() ?
                      pNewColl->GetAssignedOutlineStyleLevel() : MAXLEVEL;
 
-    if ( MAXLEVEL != nNewLevel )
+    if ( MAXLEVEL != nNewLevel && -1 != nNewLevel )
     {
         SetAttrListLevel(nNewLevel);
     }


More information about the Libreoffice-commits mailing list