summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-11-03 12:32:03 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-11-03 14:39:48 +0100
commita30f969432a451ade87b93e3077836a849b8f11b (patch)
tree52da861cd70eaca8567bfa1b83d05b3c366627d2
parentb75468d7439e66b70d2a1ab2e3f77f5c46af7be3 (diff)
svx: add missing ~CONVERT_TWIPS mask in SvxPageItem::PutValue()
With this, it's possible to use AttributePage.* keys in macros. Change-Id: I3f0b1ea8fb6274e7c18511c2e80774205206a2ba
-rw-r--r--svx/source/items/pageitem.cxx2
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx22
2 files changed, 23 insertions, 1 deletions
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 7371ef1de7cb..53c01c10d595 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -180,7 +180,7 @@ bool SvxPageItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
bool SvxPageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
- switch( nMemberId )
+ switch( nMemberId & ~CONVERT_TWIPS )
{
case MID_PAGE_NUMTYPE:
{
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();