summaryrefslogtreecommitdiff
path: root/sw/qa/extras
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-03 12:32:03 +0100
committerAndras Timar <andras.timar@collabora.com>2016-11-03 17:37:07 +0100
commit219b16cffdd1661886fa1e00d3503c42b270a825 (patch)
treed60701a920451e45334a2392218d93c10c4dcd8c /sw/qa/extras
parent7512f1e1867672c06d987a94edb07f0a7ea0fc1e (diff)
svx: add missing ~CONVERT_TWIPS mask in SvxPageItem::PutValue()
With this, it's possible to use AttributePage.* keys in macros. (cherry picked from commit a30f969432a451ade87b93e3077836a849b8f11b) Change-Id: I3f0b1ea8fb6274e7c18511c2e80774205206a2ba
Diffstat (limited to 'sw/qa/extras')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index f2c42630d2f4..531d15ebac17 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -91,6 +91,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/viewfrm.hxx>
#include <sfx2/dispatch.hxx>
+#include <comphelper/propertyvalue.hxx>
static const char* DATA_DIRECTORY = "/sw/qa/extras/uiwriter/data/";
@@ -196,6 +197,7 @@ public:
void testRedlineViewAuthor();
void testRedlineTimestamp();
void testCursorWindows();
+ void testLandscape();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -294,6 +296,7 @@ public:
CPPUNIT_TEST(testRedlineViewAuthor);
CPPUNIT_TEST(testRedlineTimestamp);
CPPUNIT_TEST(testCursorWindows);
+ CPPUNIT_TEST(testLandscape);
CPPUNIT_TEST_SUITE_END();
private:
@@ -3442,6 +3445,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();