diff options
author | Jens Carl <j.carl43@gmx.de> | 2019-03-28 22:21:59 +0000 |
---|---|---|
committer | Jens Carl <j.carl43@gmx.de> | 2019-03-29 01:36:42 +0100 |
commit | 8d45d5ee399d0148672e79c379f5d29e1c8ba6f3 (patch) | |
tree | 5cd5885f1e62f33215974e4b5c9247c45df2a13a /sc/qa | |
parent | b99ea0ff33b78ba76d1ae436895efac490252e0f (diff) |
tdf#45904 Move XRefreshable Java tests to C++
Move XRefreshable Java tests to C++ for ScSheetLinkObj.
Change-Id: I8225a3eb8be903ebcf51950431a5f6810a5aaa4f
Reviewed-on: https://gerrit.libreoffice.org/69906
Tested-by: Jenkins
Reviewed-by: Jens Carl <j.carl43@gmx.de>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/extras/scsheetlinkobj.cxx | 30 | ||||
-rw-r--r-- | sc/qa/extras/testdocuments/ScSheetLinkObj.ods | bin | 0 -> 6906 bytes |
2 files changed, 17 insertions, 13 deletions
diff --git a/sc/qa/extras/scsheetlinkobj.cxx b/sc/qa/extras/scsheetlinkobj.cxx index fbad33a9f18c..2819c915b6f0 100644 --- a/sc/qa/extras/scsheetlinkobj.cxx +++ b/sc/qa/extras/scsheetlinkobj.cxx @@ -9,6 +9,8 @@ #include <test/calc_unoapi_test.hxx> #include <test/sheet/sheetlink.hxx> +#include <test/util/xrefreshable.hxx> +#include <sfx2/app.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexAccess.hpp> @@ -24,12 +26,12 @@ #include <com/sun/star/uno/Reference.hxx> using namespace css; -using namespace css::uno; -using namespace com::sun::star; namespace sc_apitest { -class ScSheetLinkObj : public CalcUnoApiTest, public apitest::SheetLink +class ScSheetLinkObj : public CalcUnoApiTest, + public apitest::SheetLink, + public apitest::XRefreshable { public: ScSheetLinkObj(); @@ -44,6 +46,9 @@ public: // SheetLink CPPUNIT_TEST(testSheetLinkProperties); + // XRefreshable + CPPUNIT_TEST(testRefreshListener); + CPPUNIT_TEST_SUITE_END(); private: @@ -57,18 +62,17 @@ ScSheetLinkObj::ScSheetLinkObj() uno::Reference<uno::XInterface> ScSheetLinkObj::init() { - uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, UNO_QUERY_THROW); + uno::Reference<sheet::XSpreadsheetDocument> xDoc(mxComponent, uno::UNO_QUERY_THROW); - uno::Reference<sheet::XSpreadsheets> xSheets(xDoc->getSheets(), UNO_QUERY_THROW); - uno::Reference<container::XIndexAccess> xIA(xSheets, UNO_QUERY_THROW); - uno::Reference<sheet::XSpreadsheet> xSheet(xIA->getByIndex(0), UNO_QUERY_THROW); + uno::Reference<sheet::XSpreadsheets> xSheets(xDoc->getSheets(), uno::UNO_QUERY_THROW); + uno::Reference<container::XIndexAccess> xIA(xSheets, uno::UNO_QUERY_THROW); + uno::Reference<sheet::XSpreadsheet> xSheet(xIA->getByIndex(0), uno::UNO_QUERY_THROW); - uno::Reference<sheet::XSheetLinkable> xSL(xSheet, UNO_QUERY_THROW); - OUString aFileURL; - createFileURL("ScSheetLinkObj.ods", aFileURL); - xSL->link(aFileURL, "Sheet1", "", "", sheet::SheetLinkMode_VALUE); + uno::Reference<sheet::XSheetLinkable> xSL(xSheet, uno::UNO_QUERY_THROW); + xSL->link(m_directories.getURLFromSrc("/sc/qa/extras/testdocuments/ScSheetLinkObj.ods"), + "Sheet1", "", "", sheet::SheetLinkMode_VALUE); - uno::Reference<beans::XPropertySet> xPropSet(xDoc, UNO_QUERY_THROW); + uno::Reference<beans::XPropertySet> xPropSet(xDoc, uno::UNO_QUERY_THROW); uno::Reference<container::XNameAccess> sheetLinks; CPPUNIT_ASSERT(xPropSet->getPropertyValue("SheetLinks") >>= sheetLinks); CPPUNIT_ASSERT(sheetLinks.is()); @@ -94,7 +98,7 @@ void ScSheetLinkObj::tearDown() CPPUNIT_TEST_SUITE_REGISTRATION(ScSheetLinkObj); -} // end namespace +} // namespace sc_apitest CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sc/qa/extras/testdocuments/ScSheetLinkObj.ods b/sc/qa/extras/testdocuments/ScSheetLinkObj.ods Binary files differnew file mode 100644 index 000000000000..7f09e0d978eb --- /dev/null +++ b/sc/qa/extras/testdocuments/ScSheetLinkObj.ods |