summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-09-07 09:22:52 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-09-07 09:50:12 +0200
commit76c0d0abc89cd8948706083c2660b71a2dad670c (patch)
tree809f5698168f9ab03686cc3322d02df02454a9cb /sw/qa/extras/rtfimport
parented75aa271956824c89b7c9df2c06e4ad09a74734 (diff)
RTF import: adapt getProperties() to createStyleProperties()
Change-Id: I8561aa1532a863bf7f8dd44fbd40e8e0187e4967
Diffstat (limited to 'sw/qa/extras/rtfimport')
-rw-r--r--sw/qa/extras/rtfimport/data/cs-bold.rtf12
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/cs-bold.rtf b/sw/qa/extras/rtfimport/data/cs-bold.rtf
new file mode 100644
index 000000000000..8be0f2702fee
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/cs-bold.rtf
@@ -0,0 +1,12 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0
+{\stylesheet
+{\ql \li0\ri0\sl240\slmult0\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f40\fs18\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+\snext0 \sqformat \spriority14 \styrsid11343869 Normal;}
+{\*\cs73 \additive \rtlch\fcs1 \ab\af0 \ltrch\fcs0 \b
+\sbasedon10 \sqformat \spriority22 \styrsid12276622 Strong;}
+}
+\pard
+{\rtlch\fcs1 \ab\af40\afs18 \ltrch\fcs0
+\cs73\b\f41\fs18\lang9\langfe1033\langnp9\insrsid12276622\charrsid12797106 bold}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index ec58d4ca6c03..acd78d0461fe 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1926,6 +1926,12 @@ DECLARE_RTFIMPORT_TEST(testFdo82078, "fdo82078.rtf")
CPPUNIT_ASSERT_EQUAL(awt::FontWeight::NORMAL, getProperty<float>(getRun(getParagraph(1), 2), "CharWeight"));
}
+DECLARE_RTFIMPORT_TEST(testCsBold, "cs-bold.rtf")
+{
+ // This was awt::FontWeight::NORMAL, i.e. the first run was bold, when it should be bold (applied character style without 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: */