From 7879b89da30025c8efb812bb31a88f9e382b42a5 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Tue, 10 May 2016 09:16:17 +0200 Subject: tdf#96275 RTF import: fix anchor of shapes inside tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Table text is buffered, so buffer the shape import as well, otherwise the anchor will precede the buffered text -> incorrect anchor position. (cherry picked from commit 015fd55c94b7b650ed8e572cafaf3b0f903b01b9) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx Change-Id: I527b898e2cd5fafaf122a20e11df66ba8d3185cf Reviewed-on: https://gerrit.libreoffice.org/24937 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/qa/extras/rtfimport/rtfimport.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'sw/qa/extras/rtfimport/rtfimport.cxx') diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index dfbc21d52b0d..ae7af23b3ee0 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2559,6 +2559,15 @@ DECLARE_RTFIMPORT_TEST(testTdf95707, "tdf95707.rtf") CPPUNIT_ASSERT(getProperty(getShape(1), "GraphicURL") != "vnd.sun.star.GraphicObject:0000000000000000000000000000000000000000"); } +DECLARE_RTFIMPORT_TEST(testTdf96275, "tdf96275.rtf") +{ + uno::Reference xTable(getParagraphOrTable(1), uno::UNO_QUERY); + uno::Reference xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + uno::Reference 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(getRun(xParagraph, 1), "TextPortionType")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3