diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2025-02-05 12:06:54 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2025-02-05 13:40:54 +0100 |
commit | 09a351281ad82a6b4fc0a5def77ad3df4a0f031a (patch) | |
tree | 806bd06403c390d081c3791c375fd22cf8a416be | |
parent | 6a680ef017e5a842113f4eb4b555acb51e921f20 (diff) |
tdf#156348: sw_uiwriter3: Add unittest
Change-Id: Icaf8ad315035018f6b9e009e486b00c1fc9deceb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181157
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf156348.odt | bin | 0 -> 9359 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 24 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf156348.odt b/sw/qa/extras/uiwriter/data/tdf156348.odt Binary files differnew file mode 100644 index 000000000000..c440822b65d1 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf156348.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index 852ccd4e3b13..9be08e248dfc 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -1341,6 +1341,30 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf139737) dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf156348) +{ + createSwDoc("tdf156348.odt"); + + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), + uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), xIndexAccess->getCount()); + + dispatchCommand(mxComponent, u".uno:SelectAll"_ustr, {}); + + uno::Sequence<beans::PropertyValue> aArgs( + comphelper::InitPropertySequence({ { "Delimiter", uno::Any(u"\t"_ustr) }, + { "WithHeader", uno::Any(false) }, + { "RepeatHeaderLines", uno::Any(sal_uInt16(0)) }, + { "WithBorder", uno::Any(false) }, + { "DontSplitTable", uno::Any(false) } })); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, u".uno:ConvertTextToTable"_ustr, aArgs); + + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xIndexAccess->getCount()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf150845) { createSwDoc(); |