summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-06-11 15:24:40 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-06-11 15:45:23 +0200
commita1762795e7c758bc55cfba039e280273a4f26cc5 (patch)
treebd04706bc759c397100dde8e9d304ea8bd3966a1 /sw
parenteb5e3e3a4e82a55abfb1894dead6a1fb3c10bb41 (diff)
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
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/data/rtf/README3
-rw-r--r--sw/qa/core/data/rtf/fail/.gitignore0
-rw-r--r--sw/qa/core/data/rtf/indeterminate/.gitignore0
-rw-r--r--sw/qa/core/data/rtf/pass/abi3241.rtf9
-rw-r--r--sw/qa/core/filters-test.cxx5
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx2
6 files changed, 18 insertions, 1 deletions
diff --git a/sw/qa/core/data/rtf/README b/sw/qa/core/data/rtf/README
new file mode 100644
index 000000000000..cd109d3fa13a
--- /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 000000000000..e69de29bb2d1
--- /dev/null
+++ b/sw/qa/core/data/rtf/fail/.gitignore
diff --git a/sw/qa/core/data/rtf/indeterminate/.gitignore b/sw/qa/core/data/rtf/indeterminate/.gitignore
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/sw/qa/core/data/rtf/indeterminate/.gitignore
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 000000000000..5bfec3d0ce92
--- /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 26fcd58049af..e5ba36b31c90 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 07f36ef82d06..8d4cdaf2f831 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);
}