diff options
author | Jens Carl <j.carl43@gmx.de> | 2019-03-11 04:34:16 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2019-03-11 06:44:13 +0100 |
commit | dc28443e1ae7d160127e0ccbc7362b9756660152 (patch) | |
tree | 6d7eeedc959b2f89bb6581ebc4490ace4ec0074a /sc/qa | |
parent | 17eb345d999ce8db78453e804af678384846acbc (diff) |
tdf#45904 Move XNameContainer Java tests to C++
Move XNameContainer Java tests to C++ for ScStyleFamilyObj.
Change-Id: I8ff465262258ef5277d470369cc05f48bba25ce4
Reviewed-on: https://gerrit.libreoffice.org/69029
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/scstylefamilyobj.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sc/qa/extras/scstylefamilyobj.cxx b/sc/qa/extras/scstylefamilyobj.cxx index c9df85f5cc92..2ca381c92d33 100644 --- a/sc/qa/extras/scstylefamilyobj.cxx +++ b/sc/qa/extras/scstylefamilyobj.cxx @@ -11,6 +11,7 @@ #include <test/container/xelementaccess.hxx> #include <test/container/xindexaccess.hxx> #include <test/container/xnameaccess.hxx> +#include <test/container/xnamecontainer.hxx> #include <cppu/unotype.hxx> #include <com/sun/star/container/XIndexAccess.hpp> @@ -32,7 +33,8 @@ namespace sc_apitest class ScStyleFamilyObj : public CalcUnoApiTest, public apitest::XElementAccess, public apitest::XIndexAccess, - public apitest::XNameAccess + public apitest::XNameAccess, + public apitest::XNameContainer { public: ScStyleFamilyObj(); @@ -56,6 +58,13 @@ public: CPPUNIT_TEST(testGetElementNames); CPPUNIT_TEST(testHasByName); + // XNameContainer + CPPUNIT_TEST(testInsertByName); + CPPUNIT_TEST(testInsertByNameDuplicate); + CPPUNIT_TEST(testInsertByNameEmptyName); + CPPUNIT_TEST(testRemoveByName); + CPPUNIT_TEST(testRemoveByNameNoneExistingElement); + CPPUNIT_TEST_SUITE_END(); private: @@ -67,6 +76,7 @@ ScStyleFamilyObj::ScStyleFamilyObj() , XElementAccess(cppu::UnoType<style::XStyle>::get()) , XIndexAccess(19) , XNameAccess("Default") + , XNameContainer("Default") { } @@ -82,6 +92,8 @@ uno::Reference<uno::XInterface> ScStyleFamilyObj::init() uno::Reference<lang::XMultiServiceFactory> xMSF(m_xComponent, uno::UNO_QUERY_THROW); uno::Reference<uno::XInterface> xCS(xMSF->createInstance("com.sun.star.style.CellStyle"), uno::UNO_QUERY_THROW); + // XNameContainer + setElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle"))); uno::Reference<container::XNameContainer> xNC(xNA_SF, uno::UNO_QUERY_THROW); xNC->insertByName("ScStyleFamilyObj", uno::makeAny(xCS)); |