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