summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/test/drawing/xdrawpages.hxx37
-rw-r--r--qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv2
-rw-r--r--sc/qa/extras/scdrawpagesobj.cxx6
-rw-r--r--test/Library_subsequenttest.mk3
-rw-r--r--test/source/drawing/xdrawpages.cxx49
5 files changed, 94 insertions, 3 deletions
diff --git a/include/test/drawing/xdrawpages.hxx b/include/test/drawing/xdrawpages.hxx
new file mode 100644
index 000000000000..b6430df6026b
--- /dev/null
+++ b/include/test/drawing/xdrawpages.hxx
@@ -0,0 +1,37 @@
+/* -*- 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_DRAWING_XDRAWPAGES_HXX
+#define INCLUDED_TEST_DRAWING_XDRAWPAGES_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 XDrawPages
+{
+public:
+ virtual css::uno::Reference<css::uno::XInterface> init() = 0;
+
+ virtual void testInsertNewByIndex();
+ virtual void testRemove();
+
+protected:
+ ~XDrawPages() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_DRAWING_XDRAWPAGES_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.ScDrawPagesObj.csv b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
index 11ce9966a95a..844f27507b3e 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
@@ -1,4 +1,2 @@
-"ScDrawPagesObj";"com::sun::star::drawing::XDrawPages";"insertNewByIndex()"
-"ScDrawPagesObj";"com::sun::star::drawing::XDrawPages";"remove()"
"ScDrawPagesObj";"com::sun::star::drawing::XDrawPageExpander#optional";"expand()"
"ScDrawPagesObj";"com::sun::star::drawing::XDrawPageSummarizer#optional";"summarize()"
diff --git a/sc/qa/extras/scdrawpagesobj.cxx b/sc/qa/extras/scdrawpagesobj.cxx
index 9a40d417791e..16ba202fb19b 100644
--- a/sc/qa/extras/scdrawpagesobj.cxx
+++ b/sc/qa/extras/scdrawpagesobj.cxx
@@ -10,6 +10,7 @@
#include <test/calc_unoapi_test.hxx>
#include <test/container/xelementaccess.hxx>
#include <test/container/xindexaccess.hxx>
+#include <test/drawing/xdrawpages.hxx>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawPages.hpp>
@@ -28,6 +29,7 @@ using namespace css::uno;
namespace sc_apitest
{
class ScDrawPagesObj : public CalcUnoApiTest,
+ public apitest::XDrawPages,
public apitest::XElementAccess,
public apitest::XIndexAccess
{
@@ -40,6 +42,10 @@ public:
CPPUNIT_TEST_SUITE(ScDrawPagesObj);
+ // XDrawPages
+ CPPUNIT_TEST(testInsertNewByIndex);
+ CPPUNIT_TEST(testRemove);
+
// XElementAccess
CPPUNIT_TEST(testGetElementType);
CPPUNIT_TEST(testHasElements);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 43c4593efaca..80e8f0be7952 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -51,8 +51,9 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/container/xnamecontainer \
test/source/container/xnamed \
test/source/container/xnamereplace \
- test/source/drawing/captionshape \
test/source/document/xlinktargetsupplier \
+ test/source/drawing/captionshape \
+ test/source/drawing/xdrawpages \
test/source/lang/xserviceinfo \
test/source/sheet/cellarealink \
test/source/sheet/cellproperties \
diff --git a/test/source/drawing/xdrawpages.cxx b/test/source/drawing/xdrawpages.cxx
new file mode 100644
index 000000000000..5fe89abfb348
--- /dev/null
+++ b/test/source/drawing/xdrawpages.cxx
@@ -0,0 +1,49 @@
+/* -*- 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/drawing/xdrawpages.hxx>
+
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#include <com/sun/star/drawing/XDrawPages.hpp>
+#include <com/sun/star/uno/XInterface.hpp>
+
+#include <com/sun/star/uno/Reference.hxx>
+
+#include <cppunit/extensions/HelperMacros.h>
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XDrawPages::testInsertNewByIndex()
+{
+ uno::Reference<drawing::XDrawPages> xDrawPages(init(), uno::UNO_QUERY_THROW);
+ const sal_Int32 nCount = xDrawPages->getCount();
+
+ uno::Reference<drawing::XDrawPage> xDP(xDrawPages->insertNewByIndex(0), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xDP.is());
+ CPPUNIT_ASSERT_EQUAL(nCount + 1, xDrawPages->getCount());
+}
+
+void XDrawPages::testRemove()
+{
+ uno::Reference<drawing::XDrawPages> xDrawPages(init(), uno::UNO_QUERY_THROW);
+ const sal_Int32 nCount = xDrawPages->getCount();
+
+ uno::Reference<drawing::XDrawPage> xDP(xDrawPages->insertNewByIndex(0), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xDP.is());
+
+ xDrawPages->remove(xDP);
+ CPPUNIT_ASSERT_EQUAL(nCount, xDrawPages->getCount());
+}
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */