summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFabio Buso <dev.siroibaf@gmail.com>2016-04-21 22:45:51 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-04-27 00:28:03 +0000
commite7f55f15ccd97bc92e1400bc5862171a621da3e2 (patch)
treee974d5b4cc71427b43362dc97d15de8343eb049f /test
parent72f89e0f0e2e766eb9739b6833a91139b4ae5e29 (diff)
tdf#45904 Move java XViewPane test to c++
Change-Id: I3c99fb4c611a3b45d31412731c548b59e95d7179 Reviewed-on: https://gerrit.libreoffice.org/24285 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'test')
-rw-r--r--test/Library_subsequenttest.mk1
-rw-r--r--test/source/sheet/xviewpane.cxx54
2 files changed, 55 insertions, 0 deletions
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index f9b4b932e29b..5bfe52712b3a 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -63,6 +63,7 @@ $(eval $(call gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xsheetannotations \
test/source/sheet/xsheetoutline \
test/source/sheet/xstyleloader \
+ test/source/sheet/xviewpane \
test/source/text/xtext \
test/source/text/xtextfield \
test/source/text/xtextcontent \
diff --git a/test/source/sheet/xviewpane.cxx b/test/source/sheet/xviewpane.cxx
new file mode 100644
index 000000000000..759531019a27
--- /dev/null
+++ b/test/source/sheet/xviewpane.cxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/sheet/xviewpane.hxx>
+#include <com/sun/star/sheet/XViewPane.hpp>
+#include <com/sun/star/table/CellRangeAddress.hpp>
+
+#include "cppunit/TestAssert.h"
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest {
+
+void XViewPane::testFirstVisibleColumn()
+{
+ sal_Int32 nCol = 5;
+ uno::Reference < sheet::XViewPane > xViewPane(init(),UNO_QUERY_THROW);
+ xViewPane->setFirstVisibleColumn(nCol);
+ CPPUNIT_ASSERT_EQUAL(xViewPane->getFirstVisibleColumn(), nCol);
+}
+
+void XViewPane::testFirstVisibleRow()
+{
+ sal_Int32 nRow = 3;
+ uno::Reference < sheet::XViewPane > xViewPane(init(),UNO_QUERY_THROW);
+ xViewPane->setFirstVisibleRow(nRow);
+ CPPUNIT_ASSERT_EQUAL(xViewPane->getFirstVisibleRow(), nRow);
+}
+
+void XViewPane::testVisibleRange()
+{
+ sal_Int16 nSheet = 0;
+ sal_Int32 nCol = 5;
+ sal_Int32 nRow = 3;
+ uno::Reference < sheet::XViewPane > xViewPane(init(),UNO_QUERY_THROW);
+ xViewPane->setFirstVisibleColumn(nCol);
+ xViewPane->setFirstVisibleRow(nRow);
+
+ table::CellRangeAddress aCellRangeAddress = xViewPane->getVisibleRange();
+ CPPUNIT_ASSERT_EQUAL(aCellRangeAddress.Sheet, nSheet);
+ CPPUNIT_ASSERT_EQUAL(aCellRangeAddress.StartRow, nRow);
+ CPPUNIT_ASSERT_EQUAL(aCellRangeAddress.StartColumn, nCol);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */