From 28d67b792724a23015dec32fb0278b729f676736 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 26 Aug 2019 20:57:10 +0200 Subject: tdf#107776 sw ODF shape import: make is-textbox check more strict Regression from commit 9835a5823e0f559aabbc0e15ea126c82229c4bc7 (sw textboxes: reimplement ODF import/export, 2014-10-04), the problem was that we assumed graphic autostyles look like: for simple (non-text-box) content, and look like: for complex (text-box) content. Turns out it's valid to have other parent styles as well, e.g. Graphics, which should not be imported as sw textboxes. With this, the arrow at the bottom of page 3 of the bugdoc is now again on top of the image, i.e. layout compatibility is restored. Change-Id: Icbba8a23c5f66e63090f90e6581ebc98948cb80b Reviewed-on: https://gerrit.libreoffice.org/78155 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sw/qa/extras/odfimport/data/tdf107776.fodt | 29 +++++++++++++++++++++++++++++ sw/qa/extras/odfimport/odfimport.cxx | 6 ++++++ 2 files changed, 35 insertions(+) create mode 100644 sw/qa/extras/odfimport/data/tdf107776.fodt (limited to 'sw') diff --git a/sw/qa/extras/odfimport/data/tdf107776.fodt b/sw/qa/extras/odfimport/data/tdf107776.fodt new file mode 100644 index 000000000000..b59f1261778c --- /dev/null +++ b/sw/qa/extras/odfimport/data/tdf107776.fodt @@ -0,0 +1,29 @@ + + + + + + + + + + + Simple content. + + + + + + + + + + + + + + + + + + diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index cf55296e0555..629a7f194e62 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -663,6 +663,12 @@ DECLARE_ODFIMPORT_TEST(testSpellmenuRedline, "spellmenu-redline.odt") CPPUNIT_ASSERT_EQUAL(OString("prev"), rMenu.GetItemIdent(rMenu.GetItemId(rMenu.GetItemCount() - 1))); } +DECLARE_ODFIMPORT_TEST(testTdf107776, "tdf107776.fodt") +{ + // Shape with a Graphics parent style name was imported as textbox. + CPPUNIT_ASSERT(!getProperty(getShape(1), "TextBox")); +} + DECLARE_ODFIMPORT_TEST(testAnnotationFormatting, "annotation-formatting.odt") { uno::Reference xTextField = getProperty< uno::Reference >(getRun(getParagraph(1), 1), "TextField"); -- cgit