summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-04-22 12:53:24 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-04-22 13:10:57 +0200
commit8e8f9388c323ad3c32cef3f91609ad19386b7d56 (patch)
tree2a04abe4e8a447b9d8cf8bda2b590126cf0ed83f /sw/qa/extras/rtfimport
parent88c3b4bbf005299203370efecbc09dd9d9d26a72 (diff)
Related: fdo#77600 RTF import: RTFValue::equals: compare attribute content
Previously only the number of nested sprms / attributes was compared. With this, the font of the bugdoc is correctly Arial, not Times. Change-Id: I351de414b6734336b31c1334dbd2349072f16002
Diffstat (limited to 'sw/qa/extras/rtfimport')
-rw-r--r--sw/qa/extras/rtfimport/data/font-override.rtf28
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
2 files changed, 34 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/font-override.rtf b/sw/qa/extras/rtfimport/data/font-override.rtf
new file mode 100644
index 000000000000..a41d2ab90e28
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/font-override.rtf
@@ -0,0 +1,28 @@
+{\rtf1\ansi\deff4\adeflang1025
+{\fonttbl
+{\f0\froman\fprq2\fcharset0 Times New Roman;}
+{\f1\froman\fprq2\fcharset2 Symbol;}
+{\f2\fswiss\fprq2\fcharset0 Arial;}
+{\f3\froman\fprq2\fcharset0 Liberation Serif
+{\*\falt Times New Roman}
+;}
+{\f4\froman\fprq2\fcharset0 Times New Roman;}
+{\f5\fswiss\fprq2\fcharset0 Liberation Sans
+{\*\falt Arial}
+;}
+{\f6\froman\fprq2\fcharset0 Tahoma;}
+{\f7\froman\fprq2\fcharset0 Arial;}
+{\f8\fnil\fprq2\fcharset0 Droid Sans Fallback;}
+{\f9\fnil\fprq2\fcharset0 Lucida Sans;}
+{\f10\fswiss\fprq0\fcharset1 Lucida Sans;}
+{\f11\fnil\fprq2\fcharset0 Arial;}
+}
+{\colortbl;\red0\green0\blue0;\red5\green99\blue193;\red128\green128\blue128;\red0\green0\blue10;}
+{\stylesheet
+{\s0\snext0\ql\widctlpar\ltrpar
+\cf0\kerning1\dbch\af12\langfe1033\dbch\af12\afs20\alang1025\fs24\loch\f4\lang1033 Normal;}
+}
+\pard\plain\s0
+{\af11\f7
+This should be Arial.}
+\par }
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 1e3ad95c6a01..54450023ada0 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1663,6 +1663,12 @@ DECLARE_RTFIMPORT_TEST(testFdo75735, "fdo75735.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty< uno::Sequence<style::TabStop> >(getParagraph(2), "ParaTabStops").getLength());
}
+DECLARE_RTFIMPORT_TEST(testFontOverride, "font-override.rtf")
+{
+ // This was "Times New Roman".
+ CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */