framework/qa/complex/api_internal/api.lst | 1 include/test/sheet/xlabelrange.hxx | 35 ++ qadevOOo/Jar_OOoRunner.mk | 2 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScLabelRangeObj.csv | 4 qadevOOo/tests/java/ifc/sheet/_XLabelRange.java | 100 -------- qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java | 118 ---------- sc/CppunitTest_sc_labelrangeobj.mk | 105 ++++++++ sc/Module_sc.mk | 1 sc/qa/extras/sclabelrangeobj.cxx | 107 +++++++++ sc/qa/unoapi/sc_6.sce | 1 test/Library_subsequenttest.mk | 1 test/source/sheet/xlabelrange.cxx | 50 ++++ 12 files changed, 299 insertions(+), 226 deletions(-)
New commits: commit 1c52e61fdc48971387254d5c135e613fa42f9df8 Author: Jens Carl <j.car...@gmx.de> Date: Mon Nov 13 08:52:52 2017 +0000 tdf#45904 Move _XLabelRange Java tests to C++ Change-Id: I707631718c30d4503ae675f3679038705371f969 Reviewed-on: https://gerrit.libreoffice.org/44672 Reviewed-by: Jens Carl <j.car...@gmx.de> Tested-by: Jens Carl <j.car...@gmx.de> diff --git a/framework/qa/complex/api_internal/api.lst b/framework/qa/complex/api_internal/api.lst index 44ca4d40ff91..fe472e824ea5 100644 --- a/framework/qa/complex/api_internal/api.lst +++ b/framework/qa/complex/api_internal/api.lst @@ -117,7 +117,6 @@ job117=sc.ScIndexEnumeration_TableChartsEnumeration job118=sc.ScIndexEnumeration_TableColumnsEnumeration job119=sc.ScIndexEnumeration_TableConditionalEntryEnumeration job120=sc.ScIndexEnumeration_TextFieldEnumeration -job121=sc.ScLabelRangeObj job122=sc.ScLabelRangesObj job123=sc.ScNamedRangeObj job124=sc.ScRecentFunctionsObj diff --git a/include/test/sheet/xlabelrange.hxx b/include/test/sheet/xlabelrange.hxx new file mode 100644 index 000000000000..24d2f3a07b9e --- /dev/null +++ b/include/test/sheet/xlabelrange.hxx @@ -0,0 +1,35 @@ +/* -*- 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/. + */ + +#ifndef INCLUDED_TEST_SHEET_XLABELRANGE_HXX +#define INCLUDED_TEST_SHEET_XLABELRANGE_HXX + +#include <com/sun/star/uno/XInterface.hpp> +#include <com/sun/star/uno/Reference.hxx> + +#include <test/testdllapi.hxx> + +namespace apitest +{ +class OOO_DLLPUBLIC_TEST XLabelRange +{ +public: + virtual css::uno::Reference<css::uno::XInterface> init() = 0; + + void testGetSetDataArea(); + void testGetSetLabelArea(); + +protected: + ~XLabelRange() {} +}; +} + +#endif // INCLUDED_TEST_SHEET_XLABELRANGE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index 26988d28dc64..24db4d9f20a8 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -605,7 +605,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/ifc/sheet/_XFormulaQuery \ qadevOOo/tests/java/ifc/sheet/_XFunctionDescriptions \ qadevOOo/tests/java/ifc/sheet/_XHeaderFooterContent \ - qadevOOo/tests/java/ifc/sheet/_XLabelRange \ qadevOOo/tests/java/ifc/sheet/_XMultipleOperation \ qadevOOo/tests/java/ifc/sheet/_XRangeSelection \ qadevOOo/tests/java/ifc/sheet/_XRecentFunctions \ @@ -1076,7 +1075,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableConditionalEntryEnumeration \ qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TableRowsEnumeration \ qadevOOo/tests/java/mod/_sc/ScIndexEnumeration_TextFieldEnumeration \ - qadevOOo/tests/java/mod/_sc/ScLabelRangeObj \ qadevOOo/tests/java/mod/_sc/ScLabelRangesObj \ qadevOOo/tests/java/mod/_sc/ScModelObj \ qadevOOo/tests/java/mod/_sc/ScNamedRangeObj \ diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScLabelRangeObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScLabelRangeObj.csv deleted file mode 100644 index 19a9abea5c54..000000000000 --- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScLabelRangeObj.csv +++ /dev/null @@ -1,4 +0,0 @@ -"ScLabelRangeObj";"com::sun::star::sheet::XLabelRange";"getLabelArea()" -"ScLabelRangeObj";"com::sun::star::sheet::XLabelRange";"setLabelArea()" -"ScLabelRangeObj";"com::sun::star::sheet::XLabelRange";"getDataArea()" -"ScLabelRangeObj";"com::sun::star::sheet::XLabelRange";"setDataArea()" diff --git a/qadevOOo/tests/java/ifc/sheet/_XLabelRange.java b/qadevOOo/tests/java/ifc/sheet/_XLabelRange.java deleted file mode 100644 index 84da96145364..000000000000 --- a/qadevOOo/tests/java/ifc/sheet/_XLabelRange.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -package ifc.sheet; - -import lib.MultiMethodTest; -import util.ValueComparer; - -import com.sun.star.sheet.XLabelRange; -import com.sun.star.table.CellRangeAddress; - -/** -* Testing <code>com.sun.star.sheet.XLabelRange</code> -* interface methods : -* <ul> -* <li><code> getLabelArea()</code></li> -* <li><code> setLabelArea()</code></li> -* <li><code> getDataArea()</code></li> -* <li><code> setDataArea()</code></li> -* </ul> <p> -* @see com.sun.star.sheet.XLabelRange -*/ -public class _XLabelRange extends MultiMethodTest { - - public XLabelRange oObj = null; - public CellRangeAddress setDAddress = null; - public CellRangeAddress setLAddress = null; - - /** - * Test creates and stores <code>CellRangeAddress</code>, calls the method. - * <p>Has <b> OK </b> status if the method successfully returns. <p> - * @see com.sun.star.table.CellRangeAddress - */ - public void _setDataArea() { - int nr = Thread.activeCount(); - setDAddress = new CellRangeAddress((short)1, nr, 1, nr, 8); - oObj.setDataArea(setDAddress); - tRes.tested("setDataArea()", true); - } - - /** - * Test creates and stores <code>CellRangeAddress</code>, calls the method. - * <p>Has <b> OK </b> status if the method successfully returns. <p> - * @see com.sun.star.table.CellRangeAddress - */ - public void _setLabelArea() { - int nr = Thread.activeCount(); - setLAddress = new CellRangeAddress((short)1, nr, 0, nr, 0); - oObj.setLabelArea(setLAddress); - tRes.tested("setLabelArea()", true); - } - - /** - * Test calls the method and compares returned value with value that was set. - * <p>Has <b> OK </b> status if values are equal. <p> - * The following method tests are to be completed successfully before : - * <ul> - * <li> <code> setDataArea() </code> : to have address of the cell range for - * which the labels are valid</li> - * </ul> - */ - public void _getDataArea() { - requiredMethod("setDataArea()"); - CellRangeAddress gA = oObj.getDataArea(); - tRes.tested("getDataArea()", ValueComparer.equalValue(gA, setDAddress)); - } - - /** - * Test calls the method and compares returned value with value set before. - * <p>Has <b> OK </b> status if values are equal. <p> - * The following method tests are to be completed successfully before : - * <ul> - * <li> <code> setLabelArea() </code>: to have the cell range that contains - * the labels</li> - * </ul> - */ - public void _getLabelArea() { - requiredMethod("setLabelArea()"); - CellRangeAddress gA1 = oObj.getLabelArea(); - tRes.tested("getLabelArea()", - ValueComparer.equalValue(gA1, setLAddress)); - } -} // finish class _XLabelRange - - diff --git a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java b/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java deleted file mode 100644 index df585350d548..000000000000 --- a/qadevOOo/tests/java/mod/_sc/ScLabelRangeObj.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -package mod._sc; - -import java.io.PrintWriter; - -import lib.TestCase; -import lib.TestEnvironment; -import lib.TestParameters; -import util.SOfficeFactory; - -import com.sun.star.beans.XPropertySet; -import com.sun.star.lang.XComponent; -import com.sun.star.sheet.XLabelRange; -import com.sun.star.sheet.XLabelRanges; -import com.sun.star.sheet.XSpreadsheetDocument; -import com.sun.star.table.CellRangeAddress; -import com.sun.star.uno.AnyConverter; -import com.sun.star.uno.Type; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XInterface; - -/** -* Test for object which is represented by service -* <code>com.sun.star.sheet.LabelRange</code>. <p> -* Object implements the following interfaces : -* <ul> -* <li> <code>com::sun::star::sheet::XLabelRange</code></li> -* </ul> -* @see com.sun.star.sheet.LabelRange -* @see com.sun.star.sheet.XLabelRange -* @see ifc.sheet._XLabelRange -*/ -public class ScLabelRangeObj extends TestCase { - private XSpreadsheetDocument xSheetDoc = null; - - /** - * Creates Spreadsheet document. - */ - @Override - protected void initialize( TestParameters tParam, PrintWriter log ) throws Exception { - // get a soffice factory object - SOfficeFactory SOF = SOfficeFactory.getFactory( tParam.getMSF()); - log.println( "creating a sheetdocument" ); - xSheetDoc = SOF.createCalcDoc(null); - } - - /** - * Disposes Spreadsheet document. - */ - @Override - protected void cleanup( TestParameters tParam, PrintWriter log ) { - log.println( " disposing xSheetDoc " ); - XComponent oComp = UnoRuntime.queryInterface (XComponent.class, xSheetDoc) ; - util.DesktopTools.closeDoc(oComp); - } - - /** - * Creating a TestEnvironment for the interfaces to be tested. - * Obtains the value of the property <code>'ColumnLabelRanges'</code> - * from the document. The property value is the collection of label ranges. - * Adds new label range to the collection using the interface - * <code>XLabelRanges</code> that was queried from the property value. - * Retrieved from the collection the label range with index 0. - * The retrieved label range is the instance of the service - * <code>com.sun.star.sheet.LabelRange</code>. - * @see com.sun.star.sheet.LabelRange - * @see com.sun.star.sheet.XLabelRanges - */ - @Override - protected TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) throws Exception { - - XInterface oObj = null; - - // creation of testobject here - // first we write what we are intend to do to log file - log.println( "Creating a test environment" ); - - log.println("Getting test object ") ; - XPropertySet docProps = UnoRuntime.queryInterface(XPropertySet.class, xSheetDoc); - Object ranges = docProps.getPropertyValue("ColumnLabelRanges"); - XLabelRanges lRanges = UnoRuntime.queryInterface(XLabelRanges.class, ranges); - - log.println("Adding at least one element for ElementAccess interface"); - CellRangeAddress aRange2 = new CellRangeAddress((short)0, 0, 1, 0, 6); - CellRangeAddress aRange1 = new CellRangeAddress((short)0, 0, 0, 0, 1); - lRanges.addNew(aRange1, aRange2); - - oObj = (XLabelRange) AnyConverter.toObject( - new Type(XLabelRange.class),lRanges.getByIndex(0)); - - log.println("creating a new environment for object"); - TestEnvironment tEnv = new TestEnvironment(oObj); - - log.println("testing..."); - - return tEnv; - - } // finish method getTestEnvironment - -} // finish class ScLabelRangeObj - diff --git a/sc/CppunitTest_sc_labelrangeobj.mk b/sc/CppunitTest_sc_labelrangeobj.mk new file mode 100644 index 000000000000..9a0944d76170 --- /dev/null +++ b/sc/CppunitTest_sc_labelrangeobj.mk @@ -0,0 +1,105 @@ +# -*- 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_labelrangeobj)) + +$(eval $(call gb_CppunitTest_use_external,sc_labelrangeobj,boost_headers)) + +$(eval $(call gb_CppunitTest_add_exception_objects,sc_labelrangeobj, \ + sc/qa/extras/sclabelrangeobj \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,sc_labelrangeobj, \ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + drawinglayer \ + editeng \ + for \ + forui \ + i18nlangtag \ + msfilter \ + oox \ + sal \ + salhelper \ + sax \ + sb \ + sc \ + sfx \ + sot \ + subsequenttest \ + svl \ + svt \ + svx \ + svxcore \ + test \ + tk \ + tl \ + ucbhelper \ + unotest \ + utl \ + vbahelper \ + vcl \ + xo \ +)) + +$(eval $(call gb_CppunitTest_set_include,sc_labelrangeobj,\ + -I$(SRCDIR)/sc/source/ui/inc \ + -I$(SRCDIR)/sc/inc \ + $$(INCLUDE) \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,sc_labelrangeobj)) + +$(eval $(call gb_CppunitTest_use_ure,sc_labelrangeobj)) +$(eval $(call gb_CppunitTest_use_vcl,sc_labelrangeobj)) + +$(eval $(call gb_CppunitTest_use_components,sc_labelrangeobj,\ + basic/util/sb \ + comphelper/util/comphelp \ + configmgr/source/configmgr \ + dbaccess/util/dba \ + filter/source/config/cache/filterconfig1 \ + filter/source/storagefilterdetect/storagefd \ + forms/util/frm \ + framework/util/fwk \ + i18npool/util/i18npool \ + linguistic/source/lng \ + oox/util/oox \ + package/source/xstor/xstor \ + package/util/package2 \ + sax/source/expatwrap/expwrap \ + scripting/source/basprov/basprov \ + scripting/util/scriptframe \ + sc/util/sc \ + sc/util/scd \ + sc/util/scfilt \ + $(call gb_Helper_optional,SCRIPTING, \ + sc/util/vbaobj) \ + sfx2/util/sfx \ + sot/util/sot \ + svl/source/fsstor/fsstorage \ + toolkit/util/tk \ + ucb/source/core/ucb1 \ + ucb/source/ucp/file/ucpfile1 \ + ucb/source/ucp/tdoc/ucptdoc1 \ + unotools/util/utl \ + unoxml/source/rdf/unordf \ + unoxml/source/service/unoxml \ + uui/util/uui \ + xmloff/util/xo \ + svtools/util/svt \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,sc_labelrangeobj)) + +# vim: set noet sw=4 ts=4: diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 732717d5db5e..c098e0de7ff6 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -139,6 +139,7 @@ $(eval $(call gb_Module_add_subsequentcheck_targets,sc,\ CppunitTest_sc_tableconditionalformatobj \ CppunitTest_sc_scenariosobj \ CppunitTest_sc_labelrangesobj \ + CppunitTest_sc_labelrangeobj \ )) $(eval $(call gb_Module_add_perfcheck_targets,sc,\ diff --git a/sc/qa/extras/sclabelrangeobj.cxx b/sc/qa/extras/sclabelrangeobj.cxx new file mode 100644 index 000000000000..a0f0ed78c8f2 --- /dev/null +++ b/sc/qa/extras/sclabelrangeobj.cxx @@ -0,0 +1,107 @@ +/* -*- 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/sheet/xlabelrange.hxx> + +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/sheet/XLabelRange.hpp> +#include <com/sun/star/sheet/XLabelRanges.hpp> +#include <com/sun/star/sheet/XSpreadsheetDocument.hpp> +#include <com/sun/star/table/CellRangeAddress.hpp> + +#include <com/sun/star/uno/Reference.hxx> +#include <com/sun/star/uno/XInterface.hpp> + +using namespace css; +using namespace css::uno; +using namespace com::sun::star; + +namespace sc_apitest +{ +#define NUMBER_OF_TESTS 2 + +class ScLabelRangeObj : public CalcUnoApiTest, public apitest::XLabelRange +{ +public: + ScLabelRangeObj(); + + virtual uno::Reference<uno::XInterface> init() override; + virtual void setUp() override; + virtual void tearDown() override; + + CPPUNIT_TEST_SUITE(ScLabelRangeObj); + + // XLabelRange + CPPUNIT_TEST(testGetSetDataArea); + CPPUNIT_TEST(testGetSetLabelArea); + + CPPUNIT_TEST_SUITE_END(); + +private: + static sal_Int32 nTest; + static uno::Reference<lang::XComponent> mxComponent; +}; + +sal_Int32 ScLabelRangeObj::nTest = 0; +uno::Reference<lang::XComponent> ScLabelRangeObj::mxComponent; + +ScLabelRangeObj::ScLabelRangeObj() + : CalcUnoApiTest("/sc/qa/extras/testdocuments") +{ +} + +uno::Reference<uno::XInterface> ScLabelRangeObj::init() +{ + // create a calc document + if (!mxComponent.is()) + mxComponent = loadFromDesktop("private:factory/scalc"); + + uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("no calc document", xDoc.is()); + + uno::Reference<beans::XPropertySet> xProp(xDoc, uno::UNO_QUERY_THROW); + uno::Reference<sheet::XLabelRanges> xLabelRanges(xProp->getPropertyValue("ColumnLabelRanges"), + uno::UNO_QUERY_THROW); + + table::CellRangeAddress aCellRanageAddr1(0, 0, 1, 0, 6); + table::CellRangeAddress aCellRanageAddr2(0, 0, 0, 0, 1); + xLabelRanges->addNew(aCellRanageAddr1, aCellRanageAddr2); + + uno::Reference<sheet::XLabelRange> xLabelRange(xLabelRanges->getByIndex(0), + uno::UNO_QUERY_THROW); + return xLabelRange; +} + +void ScLabelRangeObj::setUp() +{ + nTest++; + CPPUNIT_ASSERT(nTest <= NUMBER_OF_TESTS); + CalcUnoApiTest::setUp(); +} + +void ScLabelRangeObj::tearDown() +{ + if (nTest == NUMBER_OF_TESTS) + { + closeDocument(mxComponent); + mxComponent.clear(); + } + + CalcUnoApiTest::tearDown(); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(ScLabelRangeObj); + +} // end namespace + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/sc/qa/unoapi/sc_6.sce b/sc/qa/unoapi/sc_6.sce index 8fbf24bf2979..6467d0885485 100644 --- a/sc/qa/unoapi/sc_6.sce +++ b/sc/qa/unoapi/sc_6.sce @@ -19,7 +19,6 @@ -o sc.ScIndexEnumeration_TableConditionalEntryEnumeration # fdo#45337 -o sc.ScIndexEnumeration_TableRowsEnumeration -o sc.ScIndexEnumeration_TextFieldEnumeration --o sc.ScLabelRangeObj -o sc.ScLabelRangesObj -o sc.ScModelObj -o sc.ScNamedRangeObj diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk index 5f2bd6166a55..a4efd36e46e9 100644 --- a/test/Library_subsequenttest.mk +++ b/test/Library_subsequenttest.mk @@ -60,6 +60,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\ test/source/sheet/xdatapilotfieldgrouping \ test/source/sheet/xdatapilottable \ test/source/sheet/xdatapilottable2 \ + test/source/sheet/xlabelrange \ test/source/sheet/xlabelranges \ test/source/sheet/xnamedrange \ test/source/sheet/xnamedranges \ diff --git a/test/source/sheet/xlabelrange.cxx b/test/source/sheet/xlabelrange.cxx new file mode 100644 index 000000000000..8af4026d316b --- /dev/null +++ b/test/source/sheet/xlabelrange.cxx @@ -0,0 +1,50 @@ +/* -*- 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/sheet/xlabelrange.hxx> +#include <test/cppunitasserthelper.hxx> + +#include <com/sun/star/sheet/XLabelRange.hpp> +#include <com/sun/star/table/CellRangeAddress.hpp> +#include <com/sun/star/uno/Reference.hxx> + +#include <cppunit/extensions/HelperMacros.h> + +using namespace css; +using namespace css::uno; + +namespace apitest +{ +void XLabelRange::testGetSetDataArea() +{ + uno::Reference<sheet::XLabelRange> xLabelRange(init(), UNO_QUERY_THROW); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get DataArea", table::CellRangeAddress(0, 0, 0, 0, 1), + xLabelRange->getDataArea()); + + table::CellRangeAddress aDataAddr(1, 0, 1, 0, 8); + xLabelRange->setDataArea(aDataAddr); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set DataArea", aDataAddr, xLabelRange->getDataArea()); +} + +void XLabelRange::testGetSetLabelArea() +{ + uno::Reference<sheet::XLabelRange> xLabelRange(init(), UNO_QUERY_THROW); + + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get DataArea", table::CellRangeAddress(0, 0, 1, 0, 6), + xLabelRange->getLabelArea()); + + table::CellRangeAddress aLabelAddr(1, 0, 1, 0, 8); + xLabelRange->setLabelArea(aLabelAddr); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set LabelArea", aLabelAddr, + xLabelRange->getLabelArea()); +} +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits