Kaydet (Commit) 2b307927 authored tarafından Jens Carl's avatar Jens Carl

tdf#45904 Move XCellRange Java test to C++

mOve XCellRange Java test to C++ for ScTableColumnObj.

Change-Id: I165e5752fb679be6790c305a99f35da644e17d56
Reviewed-on: https://gerrit.libreoffice.org/70968
Tested-by: Jenkins
Reviewed-by: 's avatarJens Carl <j.carl43@gmx.de>
üst 003d11f4
"ScTableColumnObj";"com::sun::star::table::XCellRange";"getCellByPosition()"
"ScTableColumnObj";"com::sun::star::table::XCellRange";"getCellRangeByPosition()"
"ScTableColumnObj";"com::sun::star::table::XCellRange";"getCellRangeByName()"
"ScTableColumnObj";"com::sun::star::container::XNamed";"getName()" "ScTableColumnObj";"com::sun::star::container::XNamed";"getName()"
"ScTableColumnObj";"com::sun::star::container::XNamed";"setName()" "ScTableColumnObj";"com::sun::star::container::XNamed";"setName()"
"ScTableColumnObj";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "ScTableColumnObj";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
......
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#*************************************************************************
#
# 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/.
#
#*************************************************************************
$(eval $(call gb_CppunitTest_CppunitTest,sc_tablecolumnobj))
$(eval $(call gb_CppunitTest_use_external,sc_tablecolumnobj,boost_headers))
$(eval $(call gb_CppunitTest_add_exception_objects,sc_tablecolumnobj, \
sc/qa/extras/sctablecolumnobj \
))
$(eval $(call gb_CppunitTest_use_libraries,sc_tablecolumnobj, \
cppu \
sal \
subsequenttest \
test \
unotest \
))
$(eval $(call gb_CppunitTest_set_include,sc_tablecolumnobj,\
$$(INCLUDE) \
))
$(eval $(call gb_CppunitTest_use_sdk_api,sc_tablecolumnobj))
$(eval $(call gb_CppunitTest_use_ure,sc_tablecolumnobj))
$(eval $(call gb_CppunitTest_use_vcl,sc_tablecolumnobj))
$(eval $(call gb_CppunitTest_use_components,sc_tablecolumnobj,\
$(sc_unoapi_common_components) \
))
$(eval $(call gb_CppunitTest_use_configuration,sc_tablecolumnobj))
# vim: set noet sw=4 ts=4:
...@@ -194,6 +194,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\ ...@@ -194,6 +194,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\
CppunitTest_sc_stylefamilyobj \ CppunitTest_sc_stylefamilyobj \
CppunitTest_sc_subtotaldescriptorbase \ CppunitTest_sc_subtotaldescriptorbase \
CppunitTest_sc_subtotalfieldobj \ CppunitTest_sc_subtotalfieldobj \
CppunitTest_sc_tablecolumnobj \
CppunitTest_sc_tablecolumnsobj \ CppunitTest_sc_tablecolumnsobj \
CppunitTest_sc_tableconditionalentryobj \ CppunitTest_sc_tableconditionalentryobj \
CppunitTest_sc_tableconditionalformat \ CppunitTest_sc_tableconditionalformat \
......
/* -*- 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 <test/calc_unoapi_test.hxx>
#include <test/table/xcellrange.hxx>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/sheet/XSpreadsheet.hpp>
#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
#include <com/sun/star/sheet/XSpreadsheets.hpp>
#include <com/sun/star/table/XColumnRowRange.hpp>
#include <com/sun/star/table/XTableColumns.hpp>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/uno/Reference.hxx>
using namespace css;
namespace sc_apitest
{
class ScTableColumnObj : public CalcUnoApiTest, public apitest::XCellRange
{
public:
ScTableColumnObj();
virtual uno::Reference<uno::XInterface> init() override;
virtual void setUp() override;
virtual void tearDown() override;
CPPUNIT_TEST_SUITE(ScTableColumnObj);
// XCellRange
CPPUNIT_TEST(testGetCellByPosition);
CPPUNIT_TEST(testGetCellRangeByName);
CPPUNIT_TEST(testGetCellRangeByPosition);
CPPUNIT_TEST_SUITE_END();
private:
uno::Reference<lang::XComponent> m_xComponent;
};
ScTableColumnObj::ScTableColumnObj()
: CalcUnoApiTest("/sc/qa/extras/testdocuments")
, XCellRange("K1:K1")
{
}
uno::Reference<uno::XInterface> ScTableColumnObj::init()
{
uno::Reference<sheet::XSpreadsheetDocument> xDoc(m_xComponent, uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheets> xSheets(xDoc->getSheets(), uno::UNO_QUERY_THROW);
uno::Reference<container::XIndexAccess> xIA(xSheets, uno::UNO_QUERY_THROW);
uno::Reference<sheet::XSpreadsheet> xSheet0(xIA->getByIndex(0), uno::UNO_QUERY_THROW);
uno::Reference<table::XColumnRowRange> xCRR(xSheet0, uno::UNO_QUERY_THROW);
uno::Reference<table::XTableColumns> xTC(xCRR->getColumns(), uno::UNO_QUERY_THROW);
uno::Reference<container::XIndexAccess> xIA_TC(xTC, uno::UNO_QUERY_THROW);
uno::Reference<uno::XInterface> xReturn(xIA_TC->getByIndex(10), uno::UNO_QUERY_THROW);
return xReturn;
}
void ScTableColumnObj::setUp()
{
CalcUnoApiTest::setUp();
// create calc document
m_xComponent = loadFromDesktop("private:factory/scalc");
}
void ScTableColumnObj::tearDown()
{
closeDocument(m_xComponent);
CalcUnoApiTest::tearDown();
}
CPPUNIT_TEST_SUITE_REGISTRATION(ScTableColumnObj);
} // namespace sc_apitest
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment