[Libreoffice-commits] core.git: sw/qa
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Nov 23 17:33:05 UTC 2018
sw/qa/extras/unowriter/unowriter.cxx | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
New commits:
commit d112ffd5f101a8533c48b2ce250951d8a1332252
Author: Thorsten Behrens <Thorsten.Behrens at CIB.de>
AuthorDate: Tue Aug 7 15:20:23 2018 +0200
Commit: Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Fri Nov 23 18:32:31 2018 +0100
Unit test for 0853b05b1fabb231a7d57d811c5a06ee542d3295
Change-Id: Iea6554448f7a3fcc621eac7248abcee9c4285688
Related: i#117783 and tdf#38443
Reviewed-on: https://gerrit.libreoffice.org/58687
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sw/qa/extras/unowriter/unowriter.cxx b/sw/qa/extras/unowriter/unowriter.cxx
index 933e17b928bb..96e29c303319 100644
--- a/sw/qa/extras/unowriter/unowriter.cxx
+++ b/sw/qa/extras/unowriter/unowriter.cxx
@@ -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: */
More information about the Libreoffice-commits
mailing list