From 20888958b52bcb6598cdba20829e59f750b10f0f Mon Sep 17 00:00:00 2001 From: Manfred Blume Date: Tue, 26 Sep 2017 12:00:16 +0200 Subject: tdf#112025 add unit test Change-Id: I897201d8ffa3386a13885b1e21f49ab57534039d Reviewed-on: https://gerrit.libreoffice.org/42795 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- sw/qa/extras/uiwriter/data/fdo112025-insert.docx | Bin 0 -> 4090 bytes sw/qa/extras/uiwriter/data/fdo112025.odt | Bin 0 -> 8836 bytes sw/qa/extras/uiwriter/uiwriter.cxx | 24 +++++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100755 sw/qa/extras/uiwriter/data/fdo112025-insert.docx create mode 100755 sw/qa/extras/uiwriter/data/fdo112025.odt diff --git a/sw/qa/extras/uiwriter/data/fdo112025-insert.docx b/sw/qa/extras/uiwriter/data/fdo112025-insert.docx new file mode 100755 index 000000000000..f915806e42cb Binary files /dev/null and b/sw/qa/extras/uiwriter/data/fdo112025-insert.docx differ diff --git a/sw/qa/extras/uiwriter/data/fdo112025.odt b/sw/qa/extras/uiwriter/data/fdo112025.odt new file mode 100755 index 000000000000..6d20370189c0 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/fdo112025.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index f78125e3b8bf..2b2f04eff480 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -258,6 +258,7 @@ public: void testTdf105625(); void testTdf106736(); void testTdf58604(); + void testTdf112025(); void testMsWordCompTrailingBlanks(); void testCreateDocxAnnotation(); void testTdf107976(); @@ -416,6 +417,7 @@ public: CPPUNIT_TEST(testTdf105625); CPPUNIT_TEST(testTdf106736); CPPUNIT_TEST(testTdf58604); + CPPUNIT_TEST(testTdf112025); CPPUNIT_TEST(testMsWordCompTrailingBlanks); CPPUNIT_TEST(testCreateDocxAnnotation); CPPUNIT_TEST(testTdf107976); @@ -5096,6 +5098,28 @@ void SwUiWriterTest::testTdf58604() #endif } +void SwUiWriterTest::testTdf112025() +{ + load(DATA_DIRECTORY, "fdo112025.odt"); + const int numberOfParagraphs = getParagraphs(); + CPPUNIT_ASSERT_EQUAL(1, numberOfParagraphs); + + // get a page cursor + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToEndOfPage(); + + OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "fdo112025-insert.docx"; + uno::Sequence aPropertyValues(comphelper::InitPropertySequence({{ "Name", uno::makeAny(insertFileid) }})); + lcl_dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues); + // something has been inserted + an additional paragraph + CPPUNIT_ASSERT_GREATER(numberOfParagraphs, getParagraphs()); + + uno::Reference xStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, getProperty(xStyle, "IsLandscape")); +} + void SwUiWriterTest::testTdf108524() { createDoc("tdf108524.odt"); -- cgit v1.2.3