diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-07-03 14:05:05 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-07-03 16:34:19 +0200 |
commit | 86fd893e32ef7a737b2c4b60e0938146b102fc07 (patch) | |
tree | 7e54b236e4d3159a2683f6cc2f4c34d8543b180a /sw/qa | |
parent | 5cee586a97a11c23dd252accc42099bd5e9b4187 (diff) |
sw comments on frames: delete comment of frame when deleting frame
Also group the two actions together, so only 1 undo action is visible to
the user, not 2.
Change-Id: Idba5a63b1653e96db4f9567a38b3f4ca740eb1df
Reviewed-on: https://gerrit.libreoffice.org/75045
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter2.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter2.cxx b/sw/qa/extras/uiwriter/uiwriter2.cxx index 8c07b9d11094..04b2c4df88ba 100644 --- a/sw/qa/extras/uiwriter/uiwriter2.cxx +++ b/sw/qa/extras/uiwriter/uiwriter2.cxx @@ -29,6 +29,7 @@ #include <xmloff/odffields.hxx> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> +#include <svl/stritem.hxx> #include <txtfrm.hxx> #include <redline.hxx> #include <view.hxx> @@ -1586,6 +1587,18 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest2, testImageCommentAtChar) getProperty<OUString>(getRun(xPara, 4), "TextPortionType")); CPPUNIT_ASSERT_EQUAL(OUString("Text"), getProperty<OUString>(getRun(xPara, 5), "TextPortionType")); + + // Insert content to the comment, and select the image again. + SfxStringItem aItem(FN_INSERT_STRING, "x"); + pView->GetViewFrame()->GetDispatcher()->ExecuteList(FN_INSERT_STRING, SfxCallMode::SYNCHRON, + { &aItem }); + pView->GetViewFrame()->GetDispatcher()->Execute(FN_CNTNT_TO_NEXT_FRAME, SfxCallMode::SYNCHRON); + // Now delete the image. + pView->GetViewFrame()->GetDispatcher()->Execute(SID_DELETE, SfxCallMode::SYNCHRON); + // Without the accompanying fix in place, this test would have failed with 'Expected: 0; Actual: + // 1', i.e. the comment of the image was not deleted when the image was deleted. + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), + pDoc->getIDocumentMarkAccess()->getAnnotationMarksCount()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |