Kaydet (Commit) d112ffd5 authored tarafından Thorsten Behrens's avatar Thorsten Behrens

Unit test for 0853b05b

Change-Id: Iea6554448f7a3fcc621eac7248abcee9c4285688
Related: i#117783 and tdf#38443
Reviewed-on: https://gerrit.libreoffice.org/58687
Tested-by: Jenkins
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 4cc18311
......@@ -320,6 +320,31 @@ DECLARE_UNOAPI_TEST(testXURI)
lang::IllegalArgumentException);
}
DECLARE_UNOAPI_TEST(testSetPagePrintSettings)
{
// Create an empty new document with a single char
loadURL("private:factory/swriter", nullptr);
uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
uno::Reference<text::XSimpleText> xBodyText(xTextDocument->getText(), uno::UNO_QUERY);
xBodyText->insertString(xBodyText->getStart(), "x", false);
uno::Reference<text::XPagePrintable> xPagePrintable(mxComponent, uno::UNO_QUERY);
// set some stuff, try to get it back
uno::Sequence<beans::PropertyValue> aProps(2);
aProps[0].Name = "PageColumns";
aProps[0].Value <<= sal_Int16(2);
aProps[1].Name = "IsLandscape";
aProps[1].Value <<= true;
xPagePrintable->setPagePrintSettings(aProps);
const comphelper::SequenceAsHashMap aMap(xPagePrintable->getPagePrintSettings());
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), aMap.getValue("PageColumns").get<short>());
CPPUNIT_ASSERT_EQUAL(true, aMap.getValue("IsLandscape").get<bool>());
}
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment