diff options
author | Oliver Specht <oliver.specht@cib.de> | 2024-10-07 15:14:10 +0200 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2024-10-10 01:19:45 +0200 |
commit | 2321626477d4ff930d8bc392efa6ea84e8825171 (patch) | |
tree | d5399125cf7b31b927862a66c4d86d3418d53ed9 /sw/qa/extras | |
parent | fe9dab32a3083059f46aba1ba5eab5840c2d07b5 (diff) |
tdf#163340 replace list on paste
Pasting paragraph with list should apply the source list to the target
paragraph if the target is empty or completely selected.
Change-Id: I27d462f121c03b6c5625f8c0967bc975d3ac2f88
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174606
Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/uiwriter/data/tdf163340.odt | bin | 0 -> 20151 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter9.cxx | 28 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data/tdf163340.odt b/sw/qa/extras/uiwriter/data/tdf163340.odt Binary files differnew file mode 100644 index 000000000000..cae622e5b5f3 --- /dev/null +++ b/sw/qa/extras/uiwriter/data/tdf163340.odt diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index 30e4d60481d9..f97d5a572d4d 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -798,6 +798,34 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf162326_Character) CPPUNIT_ASSERT_EQUAL(short(1), getProperty<short>(getRun(getParagraph(3), 2), u"CharUnderline"_ustr)); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf163340) +{ + createSwDoc("tdf163340.odt"); + uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference<text::XText> xText = xTextDocument->getText(); + uno::Reference<view::XSelectionSupplier> xSelSupplier(xModel->getCurrentController(), + uno::UNO_QUERY_THROW); + uno::Reference<text::XParagraphCursor> xParaCursor(xTextDocument->getText()->createTextCursor(), + uno::UNO_QUERY); + + for (int i = 0; i < 14; i++) + xParaCursor->gotoNextParagraph(false); + xParaCursor->gotoEndOfParagraph(true); + xSelSupplier->select(uno::Any(xParaCursor)); + + CPPUNIT_ASSERT_EQUAL(u"A."_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); + dispatchCommand(mxComponent, u".uno:Copy"_ustr, {}); + + xParaCursor = uno::Reference<text::XParagraphCursor>(xText->createTextCursor(), uno::UNO_QUERY); + for (int i = 0; i < 3; i++) + xParaCursor->gotoNextParagraph(false); + xParaCursor->gotoEndOfParagraph(true); + CPPUNIT_ASSERT_EQUAL(u"1."_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); + xSelSupplier->select(uno::Any(xParaCursor)); + dispatchCommand(mxComponent, u".uno:Paste"_ustr, {}); + CPPUNIT_ASSERT_EQUAL(u"A."_ustr, getProperty<OUString>(xParaCursor, u"ListLabelString"_ustr)); +} } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); |