summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa')
-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();