12#include <com/sun/star/beans/XPropertySet.hpp>
14#include <com/sun/star/uno/Reference.hxx>
16#include <cppunit/TestAssert.h>
25 uno::Reference<beans::XPropertySet> xItem(
init(), UNO_QUERY_THROW);
27 static constexpr OUStringLiteral propNameIS(
u"IsHidden");
29 bool bIsHidden =
true;
30 CPPUNIT_ASSERT(xItem->getPropertyValue(propNameIS) >>= bIsHidden);
31 CPPUNIT_ASSERT_MESSAGE(
"Default IsHidden already changed", !bIsHidden);
34 aNewIsHidden <<=
false;
35 xItem->setPropertyValue(propNameIS, aNewIsHidden);
36 CPPUNIT_ASSERT(xItem->getPropertyValue(propNameIS) >>= bIsHidden);
37 CPPUNIT_ASSERT_MESSAGE(
"Value of IsHidden wasn't changed", !bIsHidden);
39 static constexpr OUStringLiteral propNameSD(
u"ShowDetail");
41 bool bShowDetail =
false;
42 CPPUNIT_ASSERT(xItem->getPropertyValue(propNameSD) >>= bShowDetail);
43 CPPUNIT_ASSERT_MESSAGE(
"Default ShowDetail already changed", bShowDetail);
46 aNewShowDetail <<=
true;
47 xItem->setPropertyValue(propNameSD, aNewShowDetail);
48 CPPUNIT_ASSERT(xItem->getPropertyValue(propNameSD) >>= bShowDetail);
49 CPPUNIT_ASSERT_MESSAGE(
"Value of ShowDetail wasn't changed", bShowDetail);
51 sal_Int32 nPosition = 42;
52 CPPUNIT_ASSERT(xItem->getPropertyValue(
"Position") >>= nPosition);
53 CPPUNIT_ASSERT_EQUAL_MESSAGE(
"Default Position already changed", sal_Int32(0), nPosition);
virtual css::uno::Reference< css::uno::XInterface > init()=0