diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-28 13:31:52 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-28 16:43:05 +0100 |
commit | 552361aaad740e55fcfa7993b4111aba354f863f (patch) | |
tree | 404e58340d40ca54a9485c5a5f7f52ed1e00f5d3 /desktop/qa | |
parent | 13ebef097dbbf1e8663bcb3649daba4ee8295a40 (diff) |
sw: add AnchorType parameter to .uno:Paste
Which allows not hardcoding as-char for LOK.
Change-Id: I3b2987abbaf1f259c614b7b2a8709f15048d362d
Diffstat (limited to 'desktop/qa')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index 84fca2b51488..705fa2439333 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -455,6 +455,17 @@ void DesktopLOKTest::testPasteWriterJPEG() // This was text::TextContentAnchorType_AT_PARAGRAPH. CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>()); + // Delete the pasted picture, and paste again with a custom anchor type. + uno::Reference<lang::XComponent>(xShape, uno::UNO_QUERY)->dispose(); + uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence( + { + {"AnchorType", uno::makeAny(static_cast<sal_uInt16>(text::TextContentAnchorType_AT_CHARACTER))}, + })); + comphelper::dispatchCommand(".uno:Paste", aPropertyValues); + xShape.set(xDrawPage->getByIndex(0), uno::UNO_QUERY); + // This was text::TextContentAnchorType_AS_CHARACTER, AnchorType argument was ignored. + CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, xShape->getPropertyValue("AnchorType").get<text::TextContentAnchorType>()); + comphelper::LibreOfficeKit::setActive(false); } |