/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * 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 using namespace css; using namespace css::uno; namespace { /** * Initial tests for SwXTextTable. */ struct SwXTextTable final : public UnoApiTest, public apitest::XComponent { SwXTextTable(); Reference init() override; void triggerDesktopTerminate() override; CPPUNIT_TEST_SUITE(SwXTextTable); CPPUNIT_TEST(testAddEventListener); CPPUNIT_TEST(testRemoveEventListener); CPPUNIT_TEST_SUITE_END(); }; SwXTextTable::SwXTextTable() : UnoApiTest(u""_ustr) { } void SwXTextTable::triggerDesktopTerminate() { mxDesktop->terminate(); } Reference SwXTextTable::init() { mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xText = xTextDocument->getText(); Reference xCursor = xText->createTextCursor(); Reference xTable(xMSF->createInstance(u"com.sun.star.text.TextTable"_ustr), UNO_QUERY_THROW); xTable->initialize(4, 3); xText->insertTextContent(xCursor, xTable, false); CPPUNIT_ASSERT(xCursor.is()); return Reference(xTable, UNO_QUERY_THROW); } CPPUNIT_TEST_SUITE_REGISTRATION(SwXTextTable); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -3.1'>distro/collabora/cd-5.3-3.1 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff