1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <test/sheet/cellproperties.hxx>
12 #include <com/sun/star/beans/XPropertySet.hpp>
14 #include <cppunit/TestAssert.h>
18 using namespace css::uno
;
22 void CellProperties::testVertJustify()
24 uno::Reference
<beans::XPropertySet
> xCellRangeBase(init(), UNO_QUERY_THROW
);
25 OUString
aVertJustify("VertJustify");
26 uno::Any aOldVertJustify
= xCellRangeBase
->getPropertyValue(aVertJustify
);
28 CPPUNIT_ASSERT(aOldVertJustify
>>= aValue
);
29 std::cout
<< "Old VertJustify value: " << aValue
<< std::endl
;
31 uno::Any aNewVertJustify
;
32 aNewVertJustify
<<= static_cast<sal_Int32
>(3);
33 xCellRangeBase
->setPropertyValue(aVertJustify
, aNewVertJustify
);
34 uno::Any aVertJustifyControllValue
= xCellRangeBase
->getPropertyValue(aVertJustify
);
35 CPPUNIT_ASSERT(aVertJustifyControllValue
>>= aValue
);
36 std::cout
<< "New VertJustify value: " << aValue
<< std::endl
;
37 CPPUNIT_ASSERT_EQUAL_MESSAGE("value has not been changed", sal_Int32(3), aValue
);
40 void CellProperties::testRotateReference()
42 uno::Reference
<beans::XPropertySet
> xCellRangeBase(init(), UNO_QUERY_THROW
);
43 OUString
aRotateReference("RotateReference");
44 uno::Any aOldRotateReference
= xCellRangeBase
->getPropertyValue(aRotateReference
);
46 CPPUNIT_ASSERT(aOldRotateReference
>>= aValue
);
47 std::cout
<< "Old RotateReference Value: " << aValue
<< std::endl
;
49 uno::Any aNewRotateReference
;
50 aNewRotateReference
<<= static_cast<sal_Int32
>(3);
51 xCellRangeBase
->setPropertyValue(aRotateReference
, aNewRotateReference
);
52 uno::Any aRotateReferenceControllValue
= xCellRangeBase
->getPropertyValue(aRotateReference
);
53 CPPUNIT_ASSERT(aRotateReferenceControllValue
>>= aValue
);
54 std::cout
<< "New RotateReference value: " << aValue
<< std::endl
;
55 CPPUNIT_ASSERT_EQUAL_MESSAGE("value has not been changed", sal_Int32(3), aValue
);
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */