summaryrefslogtreecommitdiff
path: root/sw/qa/extras/odfimport/odfimport.cxx
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-05-17 11:16:17 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2017-05-17 12:55:51 +0200
commit6952d696439981962ad378aa28b0d16ea6e48f0e (patch)
treebc57f960da87507551b1121c5872b4b6fe71fe4f /sw/qa/extras/odfimport/odfimport.cxx
parent848ce52063cd611413e508b59e400d8ecd4c63d4 (diff)
tdf#100033: Frames with the same name are removed
Allow to have frames with the same name. For removing real duplicated frames (generated by LO earlier) check other things also next to the frame name: position, size or whether the two frames are anchored to the same position. Change-Id: I191ae5128d0228eb85f78f065b44b1f0b3ba6dcf Reviewed-on: https://gerrit.libreoffice.org/37702 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/qa/extras/odfimport/odfimport.cxx')
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index ce4a69b7b369..06f2bf7f8a9c 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -784,5 +784,21 @@ DECLARE_ODFIMPORT_TEST(testTdf107392, "tdf107392.odt")
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(getShapeByName("SVG"), "ZOrder"));
}
+DECLARE_ODFIMPORT_TEST(testTdf100033_1, "tdf100033_1.odt")
+{
+ // Test document have three duplicated frames with the same name and position/size -> import one frame
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount());
+}
+
+DECLARE_ODFIMPORT_TEST(testTdf100033_2, "tdf100033_2.odt")
+{
+ // Test document have three different frames anchored to different paragraphs -> import all frames
+ uno::Reference<text::XTextFramesSupplier> xTextFramesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextFramesSupplier->getTextFrames(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), xIndexAccess->getCount());
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */