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 0 : void XDataPilotTable::testGetOutputRange()
30 : {
31 0 : uno::Reference< sheet::XDataPilotTable > xDPTable(init(),UNO_QUERY_THROW);
32 :
33 0 : table::CellRangeAddress aRange = xDPTable->getOutputRange();
34 0 : CPPUNIT_ASSERT( aRange.Sheet == 0 );
35 0 : CPPUNIT_ASSERT( aRange.StartColumn == 7 );
36 0 : CPPUNIT_ASSERT( aRange.StartRow == 8 );
37 0 : }
38 :
39 0 : void XDataPilotTable::testRefresh()
40 : {
41 0 : uno::Reference< sheet::XDataPilotTable > xDPTable(init(),UNO_QUERY_THROW);
42 0 : std::cout << "xCellForChange: Old Value: " << xCellForChange->getValue() << std::endl;
43 0 : std::cout << "xCellForCheck: Old Value: " << xCellForCheck->getValue() << std::endl;
44 0 : double aOldData = xCellForCheck->getValue();
45 0 : xCellForChange->setValue( 5 );
46 :
47 0 : xDPTable->refresh();
48 0 : xDPTable->refresh();
49 0 : std::cout << "xCellForChange: Old Value: " << xCellForChange->getValue() << std::endl;
50 0 : std::cout << "xCellForCheck: Old Value: " << xCellForCheck->getValue() << std::endl;
51 0 : double aNewData = xCellForCheck->getValue();
52 0 : CPPUNIT_ASSERT_MESSAGE("value needs to change", aOldData != aNewData);
53 0 : }
54 :
55 0 : XDataPilotTable::~XDataPilotTable()
56 : {
57 0 : }
58 :
59 0 : }
60 :
61 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|