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/xdatapilottable.hxx>
11 : #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
12 : #include <com/sun/star/sheet/XSpreadsheet.hpp>
13 : #include <com/sun/star/sheet/XDataPilotTablesSupplier.hpp>
14 : #include <com/sun/star/sheet/XDataPilotTables.hpp>
15 : #include <com/sun/star/sheet/XDataPilotTable.hpp>
16 : #include <com/sun/star/table/XCell.hpp>
17 : #include <com/sun/star/util/XCloseable.hpp>
18 : #include <com/sun/star/table/CellRangeAddress.hpp>
19 : #include <com/sun/star/beans/XPropertySet.hpp>
20 :
21 : #include <rtl/ustring.hxx>
22 :
23 : using namespace css;
24 : using namespace css::uno;
25 :
26 : namespace apitest
27 : {
28 :
29 1 : void XDataPilotTable::testGetOutputRange()
30 : {
31 1 : uno::Reference< sheet::XDataPilotTable > xDPTable(init(),UNO_QUERY_THROW);
32 :
33 1 : table::CellRangeAddress aRange = xDPTable->getOutputRange();
34 1 : CPPUNIT_ASSERT( aRange.Sheet == 0 );
35 1 : CPPUNIT_ASSERT( aRange.StartColumn == 7 );
36 1 : CPPUNIT_ASSERT( aRange.StartRow == 8 );
37 1 : }
38 :
39 1 : void XDataPilotTable::testRefresh()
40 : {
41 1 : uno::Reference< sheet::XDataPilotTable > xDPTable(init(),UNO_QUERY_THROW);
42 1 : std::cout << "xCellForChange: Old Value: " << xCellForChange->getValue() << std::endl;
43 1 : std::cout << "xCellForCheck: Old Value: " << xCellForCheck->getValue() << std::endl;
44 1 : double aOldData = xCellForCheck->getValue();
45 1 : xCellForChange->setValue( 5 );
46 :
47 1 : xDPTable->refresh();
48 1 : xDPTable->refresh();
49 1 : std::cout << "xCellForChange: Old Value: " << xCellForChange->getValue() << std::endl;
50 1 : std::cout << "xCellForCheck: Old Value: " << xCellForCheck->getValue() << std::endl;
51 1 : double aNewData = xCellForCheck->getValue();
52 1 : CPPUNIT_ASSERT_MESSAGE("value needs to change", aOldData != aNewData);
53 1 : }
54 :
55 16 : XDataPilotTable::~XDataPilotTable()
56 : {
57 16 : }
58 :
59 90 : }
60 :
61 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|