summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-02-18 04:31:06 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-02-19 00:36:08 +0100
commit903a19b0c3eb9428445bc115d37f700cec8c3265 (patch)
treef749f7cdbc7667bca496f1a2788688c63befbdbc /test
parentbbfddc1b3b673fe2bd25c2c382ca95cd8f6f28a8 (diff)
add test for XCellRangeReferrer
Diffstat (limited to 'test')
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/Package_inc.mk1
-rw-r--r--test/inc/test/sheet/xcellrangereferrer.hxx52
-rw-r--r--test/source/sheet/xcellrangereferrer.cxx56
4 files changed, 110 insertions, 0 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 53cc8e4d3985..cd540d6b379e 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -70,6 +70,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/cellproperties \
test/source/sheet/datapilotfield \
test/source/sheet/xcellrangedata \
+ test/source/sheet/xcellrangereferrer \
test/source/sheet/xcellrangesquery \
test/source/sheet/xdatabaserange \
test/source/sheet/xdatapilotdescriptor \
diff --git a/test/Package_inc.mk b/test/Package_inc.mk
index 768c6a86f1ac..1dcc10e51cc9 100644
--- a/test/Package_inc.mk
+++ b/test/Package_inc.mk
@@ -41,6 +41,7 @@ $(eval $(call gb_Package_add_file,test_inc,inc/test/container/xnamecontainer.hxx
$(eval $(call gb_Package_add_file,test_inc,inc/test/container/xnamereplace.hxx,test/container/xnamereplace.hxx))
$(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/cellproperties.hxx,test/sheet/cellproperties.hxx))
$(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xcellrangedata.hxx,test/sheet/xcellrangedata.hxx))
+$(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xcellrangereferrer.hxx,test/sheet/xcellrangereferrer.hxx))
$(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xdatapilottable.hxx,test/sheet/xdatapilottable.hxx))
$(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xdatapilottable2.hxx,test/sheet/xdatapilottable2.hxx))
$(eval $(call gb_Package_add_file,test_inc,inc/test/sheet/xdatapilotfieldgrouping.hxx,test/sheet/xdatapilotfieldgrouping.hxx))
diff --git a/test/inc/test/sheet/xcellrangereferrer.hxx b/test/inc/test/sheet/xcellrangereferrer.hxx
new file mode 100644
index 000000000000..b799993581a3
--- /dev/null
+++ b/test/inc/test/sheet/xcellrangereferrer.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <com/sun/star/table/CellRangeAddress.hpp>
+#include <test/testdllapi.hxx>
+
+using namespace com::sun::star;
+
+namespace apitest {
+
+class OOO_DLLPUBLIC_TEST XCellRangeReferrer
+{
+public:
+ XCellRangeReferrer( table::CellRangeAddress aCellRange ):
+ maCellRange( aCellRange ) {}
+
+ virtual uno::Reference< uno::XInterface > init() = 0;
+
+ void testGetReferredCells();
+
+private:
+ table::CellRangeAddress maCellRange;
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/test/source/sheet/xcellrangereferrer.cxx b/test/source/sheet/xcellrangereferrer.cxx
new file mode 100644
index 000000000000..c0dbf79fd22b
--- /dev/null
+++ b/test/source/sheet/xcellrangereferrer.cxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2012 Markus Mohrhard <markus.mohrhard@googlemail.com> (initial developer)
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#include <test/sheet/xcellrangereferrer.hxx>
+#include <com/sun/star/table/XCellRange.hpp>
+#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
+#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
+#include "cppunit/extensions/HelperMacros.h"
+
+using namespace com::sun::star::uno;
+
+namespace apitest {
+
+void XCellRangeReferrer::testGetReferredCells()
+{
+ uno::Reference< sheet::XCellRangeReferrer > xReferrer(init(), UNO_QUERY_THROW);
+ uno::Reference< table::XCellRange > xReferredRange = xReferrer->getReferredCells();
+
+ uno::Reference< sheet::XCellRangeAddressable > xAdressable( xReferredRange, UNO_QUERY_THROW );
+ table::CellRangeAddress aCellRange = xAdressable->getRangeAddress();
+
+ CPPUNIT_ASSERT_EQUAL( aCellRange.Sheet, maCellRange.Sheet );
+ CPPUNIT_ASSERT_EQUAL( aCellRange.StartRow, maCellRange.StartRow );
+ CPPUNIT_ASSERT_EQUAL( aCellRange.EndRow, maCellRange.EndRow );
+ CPPUNIT_ASSERT_EQUAL( aCellRange.StartColumn, maCellRange.StartColumn );
+ CPPUNIT_ASSERT_EQUAL( aCellRange.EndColumn, maCellRange.EndColumn );
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */