summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-05-18 07:38:32 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-05-18 07:47:20 +0200
commitcbe79789a0fc9b80b2fd14a5abfe0973a2cb69dc (patch)
tree11b1f41d7a05a6787513b0ef2efb3f2ce9085465 /sw
parent3aebc670e1816a8f4f0759e97d8f39b6aab05044 (diff)
tdf#86814 RTF import: fix sometimes lost bold style
The problem was that commit 76c0d0abc89cd8948706083c2660b71a2dad670c (RTF import: adapt getProperties() to createStyleProperties(), 2014-09-07) only made the character style sprms/attributes a flat list, but not the paragraph style ones. Fixing that inconsistency avoids the tokenizer adding unwanted default sprms, which cause the bold sprms go away in the bugdoc. Change-Id: I86bd1b26af18cd968375c9b39be9c8e71d51271f
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/tdf86814.rtf8
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf86814.rtf b/sw/qa/extras/rtfimport/data/tdf86814.rtf
new file mode 100644
index 000000000000..6fb394e1a153
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf86814.rtf
@@ -0,0 +1,8 @@
+{\rtf1
+{\stylesheet
+{\s0 Normal;}
+{\s23\sbasedon0\snext23\sl288\slmult1\ql\widctlpar\faauto\li0\ri0\lin0\rin0\fi0\sb100\sa100\ltrpar\b\dbch\af10\langfe1049\dbch\af11\afs20\alang1025\ab\loch\f5\fs20\lang1049 Style 23;}
+}
+\pard\plain \s23\sl288\slmult1\ql\widctlpar\faauto\li0\ri0\lin0\rin0\fi0\sb100\sa100\ltrpar\b\dbch\af10\langfe1049\dbch\af11\afs20\alang1025\ab\loch\f5\fs20\lang1049\ql\widctlpar\faauto\li0\ri0\lin0\rin0\fi0
+{\b\langfe1049\dbch\af11\afs20\alang1025\ab\rtlch \ltrch\loch\fs20\lang1049 hello}
+\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 1a4dbfe286c4..e74d69401687 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2286,6 +2286,12 @@ DECLARE_RTFIMPORT_TEST(testTdf90260Par, "hello.rtf")
CPPUNIT_ASSERT_EQUAL(2, getParagraphs());
}
+DECLARE_RTFIMPORT_TEST(testTdf86814, "tdf86814.rtf")
+{
+ // This was awt::FontWeight::NORMAL, i.e. the first run wasn't bold, when it should be bold (applied paragraph style with direct formatting).
+ CPPUNIT_ASSERT_EQUAL(awt::FontWeight::BOLD, getProperty<float>(getRun(getParagraph(1), 1), "CharWeight"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */