diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-17 21:50:33 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2021-01-17 23:26:14 +0100 |
commit | 6bdfee076d7aea02f5ac3ea180d384974ed1ae58 (patch) | |
tree | ee76c8a4adb5c102d2743a5054b66bfbfe74c2bf /sw/qa/extras | |
parent | b6f574ad86316956cf27efec61af9cbda273e054 (diff) |
tdf#132597: sw: Move UItest to CppUnitTest
Change-Id: I0409e22571fa2bb6a9fbf3eb7f6e81b544886aa0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109488
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw/qa/extras')
-rw-r--r-- | sw/qa/extras/uiwriter/data3/tdf132597.odt | bin | 0 -> 132875 bytes | |||
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter3.cxx | 31 |
2 files changed, 31 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/data3/tdf132597.odt b/sw/qa/extras/uiwriter/data3/tdf132597.odt Binary files differnew file mode 100644 index 000000000000..68e9c9dffc77 --- /dev/null +++ b/sw/qa/extras/uiwriter/data3/tdf132597.odt diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx b/sw/qa/extras/uiwriter/uiwriter3.cxx index e7eeee81d266..6ba92153fb7d 100644 --- a/sw/qa/extras/uiwriter/uiwriter3.cxx +++ b/sw/qa/extras/uiwriter/uiwriter3.cxx @@ -375,6 +375,37 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135056) CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pWrtShell->GetTOXCount()); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf132597) +{ + load(DATA_DIRECTORY, "tdf132597.odt"); + + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); + + dispatchCommand(mxComponent, ".uno:SelectAll", {}); + + SwWrtShell* pWrtShell = pTextDoc->GetDocShell()->GetWrtShell(); + rtl::Reference<SwTransferable> xTransfer = new SwTransferable(*pWrtShell); + xTransfer->Copy(); + + // Paste special as RTF + uno::Sequence<beans::PropertyValue> aPropertyValues = comphelper::InitPropertySequence( + { { "SelectedFormat", uno::makeAny(static_cast<sal_uInt32>(SotClipboardFormatId::RTF)) } }); + + dispatchCommand(mxComponent, ".uno:ClipboardFormatItems", aPropertyValues); + Scheduler::ProcessEventsToIdle(); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:Undo", {}); + Scheduler::ProcessEventsToIdle(); + + CPPUNIT_ASSERT_EQUAL(1, getShapes()); + CPPUNIT_ASSERT_EQUAL(1, getPages()); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf126626) { load(DATA_DIRECTORY, "tdf126626.docx"); |