Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : */
9 :
10 : #include <test/sheet/cellproperties.hxx>
11 :
12 : #include <com/sun/star/beans/XPropertySet.hpp>
13 : #include <com/sun/star/table/CellVertJustify.hpp>
14 :
15 : #include "cppunit/extensions/HelperMacros.h"
16 : #include <iostream>
17 :
18 : using namespace css;
19 : using namespace css::uno;
20 :
21 : namespace apitest {
22 :
23 1 : void CellProperties::testVertJustify()
24 : {
25 1 : uno::Reference< beans::XPropertySet > xCellRangeBase(init(),UNO_QUERY_THROW);
26 2 : OUString aVertJustify("VertJustify");
27 2 : uno::Any aOldVertJustify = xCellRangeBase->getPropertyValue(aVertJustify);
28 1 : sal_Int32 aValue = 0;
29 1 : CPPUNIT_ASSERT(aOldVertJustify >>= aValue);
30 1 : std::cout << "Old VertJustify value: " << aValue << std::endl;
31 :
32 2 : uno::Any aNewVertJustify;
33 1 : aNewVertJustify <<= static_cast<sal_Int32>(3);
34 1 : xCellRangeBase->setPropertyValue(aVertJustify, aNewVertJustify);
35 2 : uno::Any aVertJustifyControllValue = xCellRangeBase->getPropertyValue(aVertJustify);
36 1 : CPPUNIT_ASSERT(aVertJustifyControllValue >>= aValue);
37 1 : std::cout << "New VertJustify value: " << aValue << std::endl;
38 2 : CPPUNIT_ASSERT_MESSAGE("value has not been changed", aValue == 3);
39 1 : }
40 :
41 1 : void CellProperties::testRotateReference()
42 : {
43 1 : uno::Reference< beans::XPropertySet > xCellRangeBase(init(),UNO_QUERY_THROW);
44 2 : OUString aRotateReference("RotateReference");
45 2 : uno::Any aOldRotateReference = xCellRangeBase->getPropertyValue(aRotateReference);
46 1 : sal_Int32 aValue = 0;
47 1 : CPPUNIT_ASSERT(aOldRotateReference >>= aValue);
48 1 : std::cout << "Old RotateReference Value: " << aValue << std::endl;
49 :
50 2 : uno::Any aNewRotateReference;
51 1 : aNewRotateReference <<= static_cast<sal_Int32>(3);
52 1 : xCellRangeBase->setPropertyValue(aRotateReference, aNewRotateReference);
53 2 : uno::Any aRotateReferenceControllValue = xCellRangeBase->getPropertyValue(aRotateReference);
54 1 : CPPUNIT_ASSERT(aRotateReferenceControllValue >>= aValue);
55 1 : std::cout << "New RotateReference value: " << aValue << std::endl;
56 2 : CPPUNIT_ASSERT_MESSAGE("value has not been changed", aValue == 3);
57 1 : }
58 :
59 90 : }
60 :
61 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|