/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace css; using namespace css::uno; using namespace com::sun::star; namespace sc_apitest { class ScScenariosObj : public UnoApiTest, public apitest::XElementAccess, public apitest::XEnumerationAccess, public apitest::XNameAccess, public apitest::XIndexAccess, public apitest::XScenarios, public apitest::XServiceInfo { public: ScScenariosObj(); virtual uno::Reference init() override; virtual void setUp() override; CPPUNIT_TEST_SUITE(ScScenariosObj); // XElementAccess CPPUNIT_TEST(testGetElementType); CPPUNIT_TEST(testHasElements); // XEnumerationAccess CPPUNIT_TEST(testCreateEnumeration); // XNameAccess CPPUNIT_TEST(testGetByName); CPPUNIT_TEST(testGetElementNames); CPPUNIT_TEST(testHasByName); // XIndexAccess CPPUNIT_TEST(testGetByIndex); CPPUNIT_TEST(testGetCount); // XScenarios CPPUNIT_TEST(testAddNewByName); CPPUNIT_TEST(testRemoveByName); // XServiceInfo CPPUNIT_TEST(testGetImplementationName); CPPUNIT_TEST(testGetSupportedServiceNames); CPPUNIT_TEST(testSupportsService); CPPUNIT_TEST_SUITE_END(); }; ScScenariosObj::ScScenariosObj() : UnoApiTest(u"/sc/qa/extras/testdocuments"_ustr) , XElementAccess(cppu::UnoType::get()) , XNameAccess(u"ScScenarios"_ustr) , XIndexAccess(1) , XServiceInfo(u"ScScenariosObj"_ustr, u"com.sun.star.sheet.Scenarios"_ustr) { } uno::Reference ScScenariosObj::init() { uno::Reference xDoc(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xIndex(xDoc->getSheets(), uno::UNO_QUERY_THROW); uno::Reference xSheet(xIndex->getByIndex(0), uno::UNO_QUERY_THROW); xSheet->getCellByPosition(5, 5)->setValue(15); xSheet->getCellByPosition(1, 4)->setValue(10); xSheet->getCellByPosition(2, 0)->setValue(-5.15); uno::Reference xCellRange(xSheet, uno::UNO_QUERY_THROW); uno::Reference xCellRange2 = xCellRange->getCellRangeByName(u"A1:N4"_ustr); uno::Reference xCRAddressable(xCellRange2, uno::UNO_QUERY_THROW); table::CellRangeAddress aCellRangeAddr = xCRAddressable->getRangeAddress(); uno::Reference xSupplier(xSheet, uno::UNO_QUERY_THROW); xSupplier->getScenarios()->addNewByName(u"ScScenarios"_ustr, { aCellRangeAddr }, u"Range"_ustr); return xSupplier->getScenarios(); } void ScScenariosObj::setUp() { UnoApiTest::setUp(); // create a calc document loadFromURL(u"private:factory/scalc"_ustr); } CPPUNIT_TEST_SUITE_REGISTRATION(ScScenariosObj); } // end namespace CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ /option> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-15 20:19:59 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-16 09:30:37 +0200
commitc93eb54c872ea279ee43bbf0abe00cc92e9a72e2 (patch)
tree33bfb98083e33270a30a4242e983b941918bb2a9 /binaryurp
parent4551356827e7c506f76a3da744ac8c8d4a3d0fac (diff)
cid#1557618 COPY_INSTEAD_OF_MOVE
and cid#1557535 COPY_INSTEAD_OF_MOVE cid#1557520 COPY_INSTEAD_OF_MOVE cid#1557513 COPY_INSTEAD_OF_MOVE cid#1557503 COPY_INSTEAD_OF_MOVE cid#1557487 COPY_INSTEAD_OF_MOVE cid#1557483 COPY_INSTEAD_OF_MOVE cid#1557479 COPY_INSTEAD_OF_MOVE cid#1557474 COPY_INSTEAD_OF_MOVE cid#1557461 COPY_INSTEAD_OF_MOVE cid#1557446 COPY_INSTEAD_OF_MOVE cid#1557445 COPY_INSTEAD_OF_MOVE cid#1557441 COPY_INSTEAD_OF_MOVE cid#1557435 COPY_INSTEAD_OF_MOVE cid#1557433 COPY_INSTEAD_OF_MOVE cid#1557429 COPY_INSTEAD_OF_MOVE cid#1557375 COPY_INSTEAD_OF_MOVE cid#1557372 COPY_INSTEAD_OF_MOVE cid#1557356 COPY_INSTEAD_OF_MOVE cid#1557350 COPY_INSTEAD_OF_MOVE cid#1557344 COPY_INSTEAD_OF_MOVE cid#1557339 COPY_INSTEAD_OF_MOVE cid#1557332 COPY_INSTEAD_OF_MOVE cid#1557330 COPY_INSTEAD_OF_MOVE cid#1557328 COPY_INSTEAD_OF_MOVE cid#1557323 COPY_INSTEAD_OF_MOVE cid#1557315 COPY_INSTEAD_OF_MOVE cid#1557313 COPY_INSTEAD_OF_MOVE cid#1557304 COPY_INSTEAD_OF_MOVE cid#1557297 COPY_INSTEAD_OF_MOVE cid#1557291 COPY_INSTEAD_OF_MOVE cid#1557290 COPY_INSTEAD_OF_MOVE cid#1557271 COPY_INSTEAD_OF_MOVE cid#1557266 COPY_INSTEAD_OF_MOVE cid#1557262 COPY_INSTEAD_OF_MOVE cid#1557259 COPY_INSTEAD_OF_MOVE cid#1557246 COPY_INSTEAD_OF_MOVE cid#1557242 COPY_INSTEAD_OF_MOVE cid#1557241 COPY_INSTEAD_OF_MOVE cid#1557236 COPY_INSTEAD_OF_MOVE cid#1557228 COPY_INSTEAD_OF_MOVE cid#1557225 COPY_INSTEAD_OF_MOVE cid#1557221 COPY_INSTEAD_OF_MOVE cid#1557217 COPY_INSTEAD_OF_MOVE cid#1557213 COPY_INSTEAD_OF_MOVE cid#1557211 COPY_INSTEAD_OF_MOVE cid#1557209 COPY_INSTEAD_OF_MOVE cid#1557205 COPY_INSTEAD_OF_MOVE cid#1557204 COPY_INSTEAD_OF_MOVE cid#1557193 COPY_INSTEAD_OF_MOVE cid#1556082 COPY_INSTEAD_OF_MOVE Change-Id: I07f195a79a69d4bac0d14317854efc88d6fe94d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171927 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'binaryurp')