/* -*- 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 using namespace css; namespace apitest { void XControlAccess::testGetControl() { uno::Reference xCA(init(), uno::UNO_QUERY_THROW); uno::Reference xComponent(getXComponent(), uno::UNO_QUERY_THROW); uno::Reference xDPS(xComponent, uno::UNO_QUERY_THROW); uno::Reference xDP(xDPS->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW); uno::Reference xShapes(xDP, uno::UNO_QUERY_THROW); uno::Reference xShape( helper::form::createControlShape(xComponent, u"CommandButton", 10000, 50000, 100, 100), uno::UNO_QUERY_THROW); xShapes->add(xShape); uno::Reference xCS(xShape, uno::UNO_QUERY_THROW); uno::Reference xCM(xCS->getControl(), uno::UNO_SET_THROW); uno::Reference xControl(xCA->getControl(xCM), uno::UNO_SET_THROW); CPPUNIT_ASSERT(xControl.is()); } } // namespace apitest /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */