summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-04-19 09:08:46 +0200
committerAndras Timar <andras.timar@collabora.com>2017-04-24 19:23:02 +0200
commit18f9273a66dc147eb94e638f0c46eb405aa13dfc (patch)
tree22b24e749559b0e204bb1a78490b4be924b30208 /sw
parent02a1f6fc3ec690d1b63522a9a2d8375826a58090 (diff)
tdf#107116 RTF import: fix missing upper and lower borders around text
See commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17) for the context. Here the problem was that various details of the top border were removed during the style deduplication, but not the top border sprm itself. That was interpreted (correctly) by dmapper as "no border", rather than "inherit from style". (cherry picked from commit e9f0d8d02885eca619552b19eab30c1eade9e7ef) Change-Id: I3dec8df789fc7b75fccfff91ce66f457fecd2f6e Reviewed-on: https://gerrit.libreoffice.org/36692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit c8c90854506cc7f1c3d7084ab97c156aead003e2)
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/tdf107116.rtf10
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
2 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf107116.rtf b/sw/qa/extras/rtfimport/data/tdf107116.rtf
new file mode 100644
index 000000000000..17c2f5b61a59
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf107116.rtf
@@ -0,0 +1,10 @@
+{\rtf1\ansi\ansicpg1252\uc1 \deff0\deflang1033\deflangfe1033
+{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;
+\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}
+{\stylesheet
+{\s15\brdrt\brdrs\brdrw15\brsp120\brdrcf15 \brdrb\brdrs\brdrw15\brsp120\brdrcf15 \snext15 style;}
+}
+\pard\plain before\par
+\pard\plain \s15\brdrt\brdrs\brdrw15\brsp120\brdrcf15 \brdrb\brdrs\brdrw15\brsp120\brdrcf15 border \par
+\pard\plain after\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8fee2ab2fcd1..ca696d9c84f8 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2760,6 +2760,12 @@ DECLARE_RTFIMPORT_TEST(testTdf106694, "tdf106694.rtf")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(14605), aTabs[0].Position);
}
+DECLARE_RTFIMPORT_TEST(testTdf107116, "tdf107116.rtf")
+{
+ // This was 0, upper border around text (and its distance) was missing.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(convertTwipToMm100(120)), getProperty<sal_Int32>(getParagraph(2), "TopBorderDistance"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */