12#include <com/sun/star/beans/XPropertySet.hpp>
13#include <com/sun/star/uno/Any.hxx>
14#include <com/sun/star/uno/Reference.hxx>
16#include <cppunit/TestAssert.h>
29 propName =
"IsActive";
30 bool aIsActive =
false;
31 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aIsActive);
32 CPPUNIT_ASSERT_MESSAGE(
"Unable to get property value IsActive", aIsActive);
35 xScenario->setPropertyValue(propName, aNewValue);
36 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aIsActive);
37 CPPUNIT_ASSERT_MESSAGE(
"Unable to set property value IsActive", !aIsActive);
39 propName =
"BorderColor";
40 sal_Int32 aBorderColor = 0;
41 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aBorderColor);
42 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to get property value BorderColor", sal_Int32(12632256),
45 aNewValue <<= sal_Int32(42);
46 xScenario->setPropertyValue(propName, aNewValue);
47 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aBorderColor);
48 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Unable to set property value BorderColor", sal_Int32(42),
51 propName =
"Protected";
52 bool aProtected =
false;
53 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aProtected);
54 CPPUNIT_ASSERT_MESSAGE(
"Unable to get property value Protected", aProtected);
57 xScenario->setPropertyValue(propName, aNewValue);
58 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aProtected);
59 CPPUNIT_ASSERT_MESSAGE(
"Unable to set property value Protected", !aProtected);
61 propName =
"ShowBorder";
62 bool aShowBorder =
false;
63 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aShowBorder);
64 CPPUNIT_ASSERT_MESSAGE(
"Unable to get property value ShowBorder", aShowBorder);
67 xScenario->setPropertyValue(propName, aNewValue);
68 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aShowBorder);
69 CPPUNIT_ASSERT_MESSAGE(
"Unable to set property value ShowBorder", !aShowBorder);
71 propName =
"PrintBorder";
72 bool aPrintBorder =
false;
73 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aPrintBorder);
74 CPPUNIT_ASSERT_MESSAGE(
"Unable to get property value PrintBorder", aPrintBorder);
77 xScenario->setPropertyValue(propName, aNewValue);
78 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aPrintBorder);
79 CPPUNIT_ASSERT_MESSAGE(
"Unable to set property value PrintBorder", !aPrintBorder);
81 propName =
"CopyBack";
82 bool aCopyBack =
false;
83 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aCopyBack);
84 CPPUNIT_ASSERT_MESSAGE(
"Unable to get property value CopyBack", aCopyBack);
87 xScenario->setPropertyValue(propName, aNewValue);
88 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aCopyBack);
89 CPPUNIT_ASSERT_MESSAGE(
"Unable to set property value CopyBack", !aCopyBack);
91 propName =
"CopyStyles";
92 bool aCopyStyles =
true;
93 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aCopyStyles);
94 CPPUNIT_ASSERT_MESSAGE(
"Unable to get property value CopyStyles", !aCopyStyles);
97 xScenario->setPropertyValue(propName, aNewValue);
98 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aCopyStyles);
99 CPPUNIT_ASSERT_MESSAGE(
"Unable to set property value CopyStyles", aCopyStyles);
101 propName =
"CopyFormulas";
102 bool aCopyFormulas =
false;
103 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aCopyFormulas);
104 CPPUNIT_ASSERT_MESSAGE(
"Unable to get property value CopyFormulas", aCopyFormulas);
107 xScenario->setPropertyValue(propName, aNewValue);
108 CPPUNIT_ASSERT(xScenario->getPropertyValue(propName) >>= aCopyFormulas);
109 CPPUNIT_ASSERT_MESSAGE(
"Unable to set property value CopyFormulas", !aCopyFormulas);
void testScenarioProperties()
virtual css::uno::Reference< css::uno::XInterface > getScenarioSpreadsheet()=0