nss: upgrade to release 3.73
[LibreOffice.git] / test / source / sheet / xlabelranges.cxx
blob36e2edb45eb9222cbdc7fd30bae1dd3fbc92df31
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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/xlabelranges.hxx>
12 #include <com/sun/star/sheet/XLabelRanges.hpp>
13 #include <com/sun/star/table/CellRangeAddress.hpp>
14 #include <com/sun/star/uno/Reference.hxx>
16 #include <cppunit/TestAssert.h>
18 using namespace css;
19 using namespace css::uno;
21 namespace apitest
23 void XLabelRanges::testAddNew()
25 uno::Reference<sheet::XLabelRanges> xLabelRanges(init(), UNO_QUERY_THROW);
27 const sal_Int32 nCount = xLabelRanges->getCount();
28 xLabelRanges->addNew(table::CellRangeAddress(0, 1, 0, 1, 0),
29 table::CellRangeAddress(0, 1, 1, 1, 6));
31 CPPUNIT_ASSERT_MESSAGE("Unable to add new range", nCount < xLabelRanges->getCount());
34 void XLabelRanges::testRemoveByIndex()
36 uno::Reference<sheet::XLabelRanges> xLabelRanges(init(), UNO_QUERY_THROW);
38 const sal_Int32 nCount = xLabelRanges->getCount();
39 xLabelRanges->removeByIndex(nCount - 1);
40 CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to remove range", (nCount - 1), xLabelRanges->getCount());
44 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */