From 4cb874c1b068d45039d7eed6f47c5ae5229fa301 Mon Sep 17 00:00:00 2001 From: Jens Carl Date: Wed, 5 Dec 2018 05:01:27 +0000 Subject: tdf#45904 Move XControlAccess Java test to C++ Move XControlAccess Java test to C++ for ScViewPaneObj. Change-Id: If18596b41fccc140186820c9e370f502fb2b6458 Reviewed-on: https://gerrit.libreoffice.org/64606 Tested-by: Jenkins Reviewed-by: Jens Carl --- test/Library_subsequenttest.mk | 2 ++ test/source/view/xcontrolaccess.cxx | 56 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 test/source/view/xcontrolaccess.cxx (limited to 'test') diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index 78c2e7f6a727..1b71ab44270b 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -10,6 +10,7 @@ $(eval $(call gb_Library_Library,subsequenttest)) $(eval $(call gb_Library_set_include,subsequenttest,\ + -I$(SRCDIR)/test/inc \ $$(INCLUDE) \ )) @@ -162,6 +163,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/util/xrefreshable \ test/source/util/xreplaceable \ test/source/util/xsearchable \ + test/source/view/xcontrolaccess \ )) # vim: set noet sw=4 ts=4: diff --git a/test/source/view/xcontrolaccess.cxx b/test/source/view/xcontrolaccess.cxx new file mode 100644 index 000000000000..29ca1fa339aa --- /dev/null +++ b/test/source/view/xcontrolaccess.cxx @@ -0,0 +1,56 @@ +/* -*- 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; +using namespace css::uno; + +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( + createControlShape(xComponent, 100, 100, 10000, 50000, "CommandButton"), + uno::UNO_QUERY_THROW); + + xShapes->add(xShape); + + uno::Reference xCS(xShape, uno::UNO_QUERY_THROW); + uno::Reference xCM(xCS->getControl(), uno::UNO_QUERY_THROW); + uno::Reference xControl(xCA->getControl(xCM), uno::UNO_QUERY_THROW); + + CPPUNIT_ASSERT(xControl.is()); +} + +} // namespace apitest + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ -- cgit