summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2021-05-20 14:37:10 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-05-21 00:34:30 +0200
commitaa6e9cceddfb154c2207ab316cb7625655452953 (patch)
tree799fd96d1a4ced9baca9cc44535f974de1a0f90a /sw
parent301278b656e76b6f42af5cf8a6f5c6c02acfffeb (diff)
tdf#142157: sw_uiwriter: Add unittest
Change-Id: I2dbc2f09d61220100fb616c28a8f2557c84f460f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115871 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/uiwriter/data/tdf142157.odtbin0 -> 10242 bytes
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf142157.odt b/sw/qa/extras/uiwriter/data/tdf142157.odt
new file mode 100644
index 000000000000..072c86889335
--- /dev/null
+++ b/sw/qa/extras/uiwriter/data/tdf142157.odt
Binary files differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index e7d9e38153ab..8ef3de9d6a60 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -346,6 +346,7 @@ public:
void testMsWordCompTrailingBlanks();
void testCreateDocxAnnotation();
void testTdf107976();
+ void testTdf142157();
void testTdf108524();
void testRhbz1810732();
void testTableInSection();
@@ -577,6 +578,7 @@ public:
CPPUNIT_TEST(testMsWordCompTrailingBlanks);
CPPUNIT_TEST(testCreateDocxAnnotation);
CPPUNIT_TEST(testTdf107976);
+ CPPUNIT_TEST(testTdf142157);
CPPUNIT_TEST(testTdf108524);
CPPUNIT_TEST(testRhbz1810732);
CPPUNIT_TEST(testTableInSection);
@@ -6739,6 +6741,23 @@ void SwUiWriterTest::testRhbz1810732()
}
}
+void SwUiWriterTest::testTdf142157()
+{
+ mxComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument");
+
+ const OUString insertFileid = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf142157.odt";
+ uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence({ { "Name", uno::makeAny(insertFileid) } }));
+ dispatchCommand(mxComponent, ".uno:InsertDoc", aPropertyValues);
+
+ uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+
+ // Without the fix in place, this test would have failed with
+ // - Expected: 1
+ // - Actual : 0
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xSections->getCount());
+}
+
void SwUiWriterTest::testTdf108524()
{
createDoc("tdf108524.odt");