summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-05-10 09:16:17 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-05-10 10:33:41 +0000
commit015fd55c94b7b650ed8e572cafaf3b0f903b01b9 (patch)
treeeee92115bd9040e1916a27f6e16aaf43c745e731 /sw
parentf6fb8a152797de4c5339b2fa5a3adf0e2ee0c349 (diff)
tdf#96275 RTF import: fix anchor of shapes inside tables
Table text is buffered, so buffer the shape import as well, otherwise the anchor will precede the buffered text -> incorrect anchor position. Change-Id: I527b898e2cd5fafaf122a20e11df66ba8d3185cf Reviewed-on: https://gerrit.libreoffice.org/24822 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/tdf96275.rtf18
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx9
2 files changed, 27 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/tdf96275.rtf b/sw/qa/extras/rtfimport/data/tdf96275.rtf
new file mode 100644
index 000000000000..aec13d195206
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf96275.rtf
@@ -0,0 +1,18 @@
+{\rtf1
+\ltrrow\trowd \cellx4703\cellx9514\pard\plain \intbl
+{A
+\par B
+\par }
+{\shp
+{\*\shpinst\shpleft1418\shptop104\shpright2903\shpbottom629\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0
+{\sp
+{\sn shapeType}
+{\sv 3}
+}
+}
+}
+{C\cell \cell }
+\pard\plain \intbl
+{\row}
+\pard\plain\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 4fae9dab7b06..21ce04cca4ad 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2590,6 +2590,15 @@ DECLARE_RTFIMPORT_TEST(testTdf95707, "tdf95707.rtf")
CPPUNIT_ASSERT(getProperty<OUString>(getShape(1), "GraphicURL") != "vnd.sun.star.GraphicObject:0000000000000000000000000000000000000000");
}
+DECLARE_RTFIMPORT_TEST(testTdf96275, "tdf96275.rtf")
+{
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xParagraph = getParagraphOfText(3, xCell->getText());
+ // This was text: the shape's frame was part of the 1st paragraph instead of the 3rd one.
+ CPPUNIT_ASSERT_EQUAL(OUString("Frame"), getProperty<OUString>(getRun(xParagraph, 1), "TextPortionType"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */