LibreOffice Module test (master) 1
xdatapilottable.cxx
Go to the documentation of this file.
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
11#include <com/sun/star/sheet/XDataPilotTable.hpp>
12#include <com/sun/star/table/CellRangeAddress.hpp>
13
14using namespace css;
15using namespace css::uno;
16
17namespace apitest
18{
20{
21 uno::Reference<sheet::XDataPilotTable> xDPTable(init(), UNO_QUERY_THROW);
22
23 table::CellRangeAddress aRange = xDPTable->getOutputRange();
24 CPPUNIT_ASSERT_EQUAL(sal_Int16(0), aRange.Sheet);
25 CPPUNIT_ASSERT_EQUAL(sal_Int32(7), aRange.StartColumn);
26 CPPUNIT_ASSERT_EQUAL(sal_Int32(8), aRange.StartRow);
27}
28
30{
31 uno::Reference<sheet::XDataPilotTable> xDPTable(init(), UNO_QUERY_THROW);
32 std::cout << "xCellForChange: Old Value: " << xCellForChange->getValue() << std::endl;
33 std::cout << "xCellForCheck: Old Value: " << xCellForCheck->getValue() << std::endl;
34 double aOldData = xCellForCheck->getValue();
35 xCellForChange->setValue(5);
36
37 xDPTable->refresh();
38 xDPTable->refresh();
39 std::cout << "xCellForChange: Old Value: " << xCellForChange->getValue() << std::endl;
40 std::cout << "xCellForCheck: Old Value: " << xCellForCheck->getValue() << std::endl;
41 double aNewData = xCellForCheck->getValue();
42 CPPUNIT_ASSERT_MESSAGE("value needs to change", aOldData != aNewData);
43}
44
46}
47
48/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::table::XCell > xCellForChange
virtual css::uno::Reference< css::uno::XInterface > init()=0
css::uno::Reference< css::table::XCell > xCellForCheck