1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
10 #include <test/sheet/xviewpane.hxx>
11 #include <com/sun/star/sheet/XViewPane.hpp>
12 #include <com/sun/star/table/CellRangeAddress.hpp>
14 #include <cppunit/TestAssert.h>
17 using namespace css::uno
;
21 void XViewPane::testFirstVisibleColumn()
24 uno::Reference
< sheet::XViewPane
> xViewPane(init(),UNO_QUERY_THROW
);
25 xViewPane
->setFirstVisibleColumn(nCol
);
26 CPPUNIT_ASSERT_EQUAL(xViewPane
->getFirstVisibleColumn(), nCol
);
29 void XViewPane::testFirstVisibleRow()
32 uno::Reference
< sheet::XViewPane
> xViewPane(init(),UNO_QUERY_THROW
);
33 xViewPane
->setFirstVisibleRow(nRow
);
34 CPPUNIT_ASSERT_EQUAL(xViewPane
->getFirstVisibleRow(), nRow
);
37 void XViewPane::testVisibleRange()
39 constexpr sal_Int32 nCol
= 5;
40 constexpr sal_Int32 nRow
= 3;
41 uno::Reference
< sheet::XViewPane
> xViewPane(init(),UNO_QUERY_THROW
);
42 xViewPane
->setFirstVisibleColumn(nCol
);
43 xViewPane
->setFirstVisibleRow(nRow
);
45 table::CellRangeAddress aCellRangeAddress
= xViewPane
->getVisibleRange();
46 CPPUNIT_ASSERT_EQUAL(short(0), aCellRangeAddress
.Sheet
);
47 CPPUNIT_ASSERT_EQUAL(nRow
, aCellRangeAddress
.StartRow
);
48 CPPUNIT_ASSERT_EQUAL(nCol
, aCellRangeAddress
.StartColumn
);
53 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */