tdf#45904 Move XElementAccess Java tests to C++

Move XElementAccess Java tests to C++ for ScCellFieldsObj.

Change-Id: I140cb1f1d5f9cbccfd4dbb43d37c9cd48b7346e8
Reviewed-on: https://gerrit.libreoffice.org/64794
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldsObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldsObj.csv
index dac1b03..ea3a0c7 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldsObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldsObj.csv
@@ -1,3 +1 @@
"ScCellFieldsObj";"com::sun::star::container::XElementAccess";"getElementType()"
"ScCellFieldsObj";"com::sun::star::container::XElementAccess";"hasElements()"
"ScCellFieldsObj";"com::sun::star::container::XEnumerationAccess";"createEnumeration()"
diff --git a/sc/qa/extras/sccellfieldsobj.cxx b/sc/qa/extras/sccellfieldsobj.cxx
index ec6400e..d9074ad 100644
--- a/sc/qa/extras/sccellfieldsobj.cxx
+++ b/sc/qa/extras/sccellfieldsobj.cxx
@@ -8,6 +8,7 @@
 */

#include <test/calc_unoapi_test.hxx>
#include <test/container/xelementaccess.hxx>
#include <test/util/xrefreshable.hxx>

#include <com/sun/star/container/XIndexAccess.hpp>
@@ -19,17 +20,22 @@
#include <com/sun/star/table/XCell.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/text/XTextContent.hpp>
#include <com/sun/star/text/XTextField.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/uno/XInterface.hpp>

#include <com/sun/star/uno/Reference.hxx>

#include <cppu/unotype.hxx>

using namespace css;
using namespace css::uno;

namespace sc_apitest
{
class ScCellFieldsObj : public CalcUnoApiTest, public apitest::XRefreshable
class ScCellFieldsObj : public CalcUnoApiTest,
                        public apitest::XElementAccess,
                        public apitest::XRefreshable
{
public:
    ScCellFieldsObj();
@@ -40,6 +46,10 @@

    CPPUNIT_TEST_SUITE(ScCellFieldsObj);

    // XElementAccess
    CPPUNIT_TEST(testGetElementType);
    CPPUNIT_TEST(testHasElements);

    // XRefreshable
    CPPUNIT_TEST(testAddRefreshListener);
    CPPUNIT_TEST(testRefresh);
@@ -53,6 +63,7 @@

ScCellFieldsObj::ScCellFieldsObj()
    : CalcUnoApiTest("/sc/qa/extras/testdocuments")
    , XElementAccess(cppu::UnoType<text::XTextField>::get())
{
}