nss: upgrade to release 3.73
[LibreOffice.git] / test / source / sheet / xviewpane.cxx
bloba10c59d9c0b8607dd3251a2e330fb9838689c46d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
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>
16 using namespace css;
17 using namespace css::uno;
19 namespace apitest
21 void XViewPane::testFirstVisibleColumn()
23 sal_Int32 nCol = 5;
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()
31 sal_Int32 nRow = 3;
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);
52 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */