summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/test/container/xchild.hxx34
-rw-r--r--qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv2
-rw-r--r--sc/qa/extras/scannotationobj.cxx8
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/container/xchild.cxx40
5 files changed, 82 insertions, 3 deletions
diff --git a/include/test/container/xchild.hxx b/include/test/container/xchild.hxx
new file mode 100644
index 000000000000..2128b40390e3
--- /dev/null
+++ b/include/test/container/xchild.hxx
@@ -0,0 +1,34 @@
+/* -*- 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_TABLE_XCHILD_HXX
+#define INCLUDED_TEST_TABLE_XCHILD_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 XChild
+{
+public:
+ virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+ void testGetSetParent();
+
+protected:
+ ~XChild() {}
+};
+}
+
+#endif // INCLUDED_TEST_TABLE_XCHILD_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
index 5bfb8b6e1270..fe1b71e1b4fb 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAnnotationObj.csv
@@ -7,5 +7,3 @@
"ScAnnotationObj";"com::sun::star::text::XTextRange";"getEnd()"
"ScAnnotationObj";"com::sun::star::text::XTextRange";"getString()"
"ScAnnotationObj";"com::sun::star::text::XTextRange";"setString()"
-"ScAnnotationObj";"com::sun::star::container::XChild";"getParent()"
-"ScAnnotationObj";"com::sun::star::container::XChild";"setParent()"
diff --git a/sc/qa/extras/scannotationobj.cxx b/sc/qa/extras/scannotationobj.cxx
index 7d6d10890c12..bbd0f60493fb 100644
--- a/sc/qa/extras/scannotationobj.cxx
+++ b/sc/qa/extras/scannotationobj.cxx
@@ -8,6 +8,7 @@
*/
#include <test/calc_unoapi_test.hxx>
+#include <test/container/xchild.hxx>
#include <test/sheet/xsheetannotation.hxx>
#include <test/sheet/xsheetannotationshapesupplier.hxx>
@@ -26,7 +27,9 @@ using namespace css::uno;
namespace sc_apitest {
-class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation, public apitest::XSheetAnnotationShapeSupplier
+class ScAnnontationObj : public CalcUnoApiTest, public apitest::XSheetAnnotation,
+ public apitest::XSheetAnnotationShapeSupplier,
+ public apitest::XChild
{
public:
ScAnnontationObj();
@@ -39,6 +42,9 @@ public:
CPPUNIT_TEST_SUITE(ScAnnontationObj);
+ // XChild
+ CPPUNIT_TEST(testGetSetParent);
+
// XSheetAnnotation
CPPUNIT_TEST(testGetPosition);
CPPUNIT_TEST(testGetAuthor);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index fce5a9033314..f916567160ce 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/unoapi_test \
test/source/calc_unoapi_test \
test/source/beans/xpropertyset \
+ test/source/container/xchild \
test/source/container/xelementaccess \
test/source/container/xindexaccess \
test/source/container/xnamecontainer \
diff --git a/test/source/container/xchild.cxx b/test/source/container/xchild.cxx
new file mode 100644
index 000000000000..45627ed03de0
--- /dev/null
+++ b/test/source/container/xchild.cxx
@@ -0,0 +1,40 @@
+/* -*- 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/cppunitasserthelper.hxx>
+#include <test/container/xchild.hxx>
+
+#include <com/sun/star/container/XChild.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+
+namespace apitest
+{
+void XChild::testGetSetParent()
+{
+ uno::Reference<container::XChild> xChild(init(), UNO_QUERY_THROW);
+ uno::Reference<uno::XInterface> xInterface(xChild, UNO_QUERY_THROW);
+ xInterface = xChild->getParent();
+
+ CPPUNIT_ASSERT_MESSAGE("Successfully able to Get Parent", xInterface);
+
+ xChild->setParent(xInterface);
+
+ CPPUNIT_ASSERT_MESSAGE("Successfully able to Set Parent", xChild);
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */