summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-12-29 16:15:03 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-12-29 16:28:59 +0100
commite8d10f215e9da65617988a9a471be18775afad00 (patch)
treec37e10f7b723e918445653c70888758c6ca66461 /sw
parentf039d36ec5404f76c5472d04593e04096bf4252d (diff)
fdo#41109 RTF shape import: handle fBehindDocument property
Change-Id: I9bf24eb2d3087e855d54c0ee7aba4e98dc856cc2
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/background.rtf39
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx7
2 files changed, 46 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/background.rtf b/sw/qa/extras/rtfimport/data/background.rtf
new file mode 100644
index 000000000000..2dbe9fe5f10b
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/background.rtf
@@ -0,0 +1,39 @@
+{\rtf1
+{\shp
+{\*\shpinst\shpleft2633\shptop-97\shpright4853\shpbottom893\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt1\shpz1\shplid1027
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+{\sp
+{\sn fillColor}
+{\sv 5880731}
+}
+{\sp
+{\sn fFilled}
+{\sv 1}
+}
+{\sp
+{\sn fBehindDocument}
+{\sv 1}
+}
+}
+}
+{\shp
+{\*\shpinst\shpleft488\shptop-97\shpright2003\shpbottom743\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1026
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+{\sp
+{\sn fillColor}
+{\sv 5066944}
+}
+{\sp
+{\sn fFilled}
+{\sv 1}
+}
+}
+}
+First should be foreground, the second should be background.\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 3553bf97fc38..a5ab93d3df15 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1398,6 +1398,13 @@ DECLARE_RTFIMPORT_TEST(testShpzDhgt, "shpz-dhgt.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x00ff00), getProperty<sal_Int32>(getShape(2), "FillColor"));
}
+DECLARE_RTFIMPORT_TEST(testBackground, "background.rtf")
+{
+ // The first shape wasn't in the foreground.
+ CPPUNIT_ASSERT_EQUAL(true, bool(getProperty<sal_Bool>(getShape(1), "Opaque")));
+ CPPUNIT_ASSERT_EQUAL(false, bool(getProperty<sal_Bool>(getShape(2), "Opaque")));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */