12 #include <com/sun/star/text/TextContentAnchorType.hpp>
13 #include <com/sun/star/beans/XPropertySet.hpp>
15 #include <com/sun/star/uno/Any.hxx>
16 #include <com/sun/star/uno/Reference.hxx>
17 #include <com/sun/star/uno/Sequence.hxx>
19 #include <cppunit/TestAssert.h>
25 void TextContent::testTextContentProperties()
27 uno::Reference<beans::XPropertySet> xPS(
init(), uno::UNO_QUERY_THROW);
29 text::TextContentAnchorType aExpectedTCAT;
30 CPPUNIT_ASSERT(xPS->getPropertyValue(
"AnchorType") >>= aExpectedTCAT);
31 CPPUNIT_ASSERT_EQUAL(m_aExpectedTCAT, aExpectedTCAT);
35 xPS->setPropertyValue(
"AnchorType", uno::makeAny(m_aNewTCAT));
36 text::TextContentAnchorType aNewTCAT;
37 CPPUNIT_ASSERT(xPS->getPropertyValue(
"AnchorType") >>= aNewTCAT);
38 CPPUNIT_ASSERT_EQUAL(m_aNewTCAT, aNewTCAT);
40 catch (
const beans::UnknownPropertyException& )
45 uno::Sequence<text::TextContentAnchorType> aAnchorTypes;
46 CPPUNIT_ASSERT(xPS->getPropertyValue(
"AnchorTypes") >>= aAnchorTypes);
47 CPPUNIT_ASSERT(aAnchorTypes.hasElements());
49 text::WrapTextMode aExpectedWTM;
50 CPPUNIT_ASSERT(xPS->getPropertyValue(
"TextWrap") >>= aExpectedWTM);
51 CPPUNIT_ASSERT_EQUAL(m_aExpectedWTM, aExpectedWTM);
55 xPS->setPropertyValue(
"TextWrap", uno::makeAny(m_aNewWTM));
56 text::WrapTextMode aNewWTM;
57 CPPUNIT_ASSERT(xPS->getPropertyValue(
"TextWrap") >>= aNewWTM);
58 CPPUNIT_ASSERT_EQUAL(m_aNewWTM, aNewWTM);
60 catch (
const beans::UnknownPropertyException& )
FILE * init(int, char **)