diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-03 12:32:03 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-11-03 14:39:48 +0100 |
commit | a30f969432a451ade87b93e3077836a849b8f11b (patch) | |
tree | 52da861cd70eaca8567bfa1b83d05b3c366627d2 /sw | |
parent | b75468d7439e66b70d2a1ab2e3f77f5c46af7be3 (diff) |
svx: add missing ~CONVERT_TWIPS mask in SvxPageItem::PutValue()
With this, it's possible to use AttributePage.* keys in macros.
Change-Id: I3f0b1ea8fb6274e7c18511c2e80774205206a2ba
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/uiwriter/uiwriter.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index b37a6c4d0e42..e58093f4c870 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -94,6 +94,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <sfx2/viewfrm.hxx> #include <sfx2/dispatch.hxx> +#include <comphelper/propertyvalue.hxx> #include <config_features.h> static const char* DATA_DIRECTORY = "/sw/qa/extras/uiwriter/data/"; @@ -211,6 +212,7 @@ public: void testTdf78727(); void testRedlineTimestamp(); void testCursorWindows(); + void testLandscape(); CPPUNIT_TEST_SUITE(SwUiWriterTest); CPPUNIT_TEST(testReplaceForward); @@ -320,6 +322,7 @@ public: CPPUNIT_TEST(testTdf78727); CPPUNIT_TEST(testRedlineTimestamp); CPPUNIT_TEST(testCursorWindows); + CPPUNIT_TEST(testLandscape); CPPUNIT_TEST_SUITE_END(); private: @@ -4027,6 +4030,25 @@ void SwUiWriterTest::testCursorWindows() CPPUNIT_ASSERT_EQUAL(aText.getLength(), pShellCursor2->Start()->nContent.GetIndex()); } +void SwUiWriterTest::testLandscape() +{ + // Set page orientation to landscape. + SwDoc* pDoc = createDoc(); + uno::Sequence<beans::PropertyValue> aPropertyValues = + { + comphelper::makePropertyValue("AttributePage.Landscape", true), + }; + lcl_dispatchCommand(mxComponent, ".uno:AttributePage", aPropertyValues); + Scheduler::ProcessEventsToIdle(); + + // Assert that the document model was modified. + SwDocShell* pDocShell = pDoc->GetDocShell(); + SwWrtShell* pWrtShell = pDocShell->GetWrtShell(); + size_t nPageDesc = pWrtShell->GetCurPageDesc(); + // This failed, page was still portrait. + CPPUNIT_ASSERT(pWrtShell->GetPageDesc(nPageDesc).GetLandscape()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest); CPPUNIT_PLUGIN_IMPLEMENT(); |