diff options
-rw-r--r-- | include/test/util/xrefreshable.hxx | 4 | ||||
-rw-r--r-- | sc/CppunitTest_sc_ddelinkobj.mk | 1 | ||||
-rw-r--r-- | sc/qa/extras/sccellfieldsobj.cxx | 4 | ||||
-rw-r--r-- | sc/qa/extras/scddelinkobj.cxx | 22 | ||||
-rw-r--r-- | test/source/sheet/xddelink.cxx | 6 | ||||
-rw-r--r-- | test/source/util/xrefreshable.cxx | 22 |
6 files changed, 21 insertions, 38 deletions
diff --git a/include/test/util/xrefreshable.hxx b/include/test/util/xrefreshable.hxx index 2ffab9946e4a..dd82303259ef 100644 --- a/include/test/util/xrefreshable.hxx +++ b/include/test/util/xrefreshable.hxx @@ -23,9 +23,7 @@ class OOO_DLLPUBLIC_TEST XRefreshable public: virtual css::uno::Reference<css::uno::XInterface> init() = 0; - void testAddRefreshListener(); - void testRefresh(); - void testRemoveRefreshListener(); + void testRefreshListener(); protected: ~XRefreshable() {} diff --git a/sc/CppunitTest_sc_ddelinkobj.mk b/sc/CppunitTest_sc_ddelinkobj.mk index 123e4cf3a021..c59cf6e96360 100644 --- a/sc/CppunitTest_sc_ddelinkobj.mk +++ b/sc/CppunitTest_sc_ddelinkobj.mk @@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ddelinkobj, \ subsequenttest \ test \ unotest \ + vcl \ )) $(eval $(call gb_CppunitTest_set_include,sc_ddelinkobj,\ diff --git a/sc/qa/extras/sccellfieldsobj.cxx b/sc/qa/extras/sccellfieldsobj.cxx index b015b96f99b0..f1626527b063 100644 --- a/sc/qa/extras/sccellfieldsobj.cxx +++ b/sc/qa/extras/sccellfieldsobj.cxx @@ -56,9 +56,7 @@ public: CPPUNIT_TEST(testCreateEnumeration); // XRefreshable - CPPUNIT_TEST(testAddRefreshListener); - CPPUNIT_TEST(testRefresh); - CPPUNIT_TEST(testRemoveRefreshListener); + CPPUNIT_TEST(testRefreshListener); CPPUNIT_TEST_SUITE_END(); diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx index 204c5b6f8ace..0aa2e968c58e 100644 --- a/sc/qa/extras/scddelinkobj.cxx +++ b/sc/qa/extras/scddelinkobj.cxx @@ -12,6 +12,8 @@ #include <test/sheet/xddelink.hxx> #include <test/util/xrefreshable.hxx> +#include <sfx2/app.hxx> + #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -55,9 +57,7 @@ public: CPPUNIT_TEST(testSetNameThrowsException); // XRefreshable - CPPUNIT_TEST(testAddRefreshListener); - CPPUNIT_TEST(testRefresh); - CPPUNIT_TEST(testRemoveRefreshListener); + CPPUNIT_TEST(testRefreshListener); CPPUNIT_TEST_SUITE_END(); @@ -67,7 +67,9 @@ private: ScDDELinkObj::ScDDELinkObj() : CalcUnoApiTest("/sc/qa/extras/testdocuments") - , XNamed("soffice|ScDDELinksObj.ods!Sheet.A1") + , XNamed("soffice|" + + m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods") + + "!Sheet1.A1") { } @@ -79,10 +81,13 @@ uno::Reference<uno::XInterface> ScDDELinkObj::init() uno::Reference<container::XIndexAccess> xIA(xSheets, UNO_QUERY_THROW); uno::Reference<sheet::XSpreadsheet> xSheet(xIA->getByIndex(0), UNO_QUERY_THROW); - xSheet->getCellByPosition(5, 5)->setFormula( - "=DDE(\"soffice\";\"ScDDELinksObj.ods\";\"Sheet.A1\""); - xSheet->getCellByPosition(1, 4)->setFormula( - "=DDE(\"soffice\";\"ScDDELinksObj.ods\";\"Sheet.A1\""); + const OUString testdoc + = m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods"); + + xSheet->getCellByPosition(5, 5)->setFormula("=DDE(\"soffice\";\"" + testdoc + + "\";\"Sheet1.A1\")"); + xSheet->getCellByPosition(1, 4)->setFormula("=DDE(\"soffice\";\"" + testdoc + + "\";\"Sheet1.A1\")"); uno::Reference<beans::XPropertySet> xPropSet(xDoc, UNO_QUERY_THROW); uno::Any aDDELinks = xPropSet->getPropertyValue("DDELinks"); @@ -94,6 +99,7 @@ uno::Reference<uno::XInterface> ScDDELinkObj::init() void ScDDELinkObj::setUp() { + Application::SetAppName("soffice"); // Enable DDE CalcUnoApiTest::setUp(); // create a calc document mxComponent = loadFromDesktop("private:factory/scalc"); diff --git a/test/source/sheet/xddelink.cxx b/test/source/sheet/xddelink.cxx index 403449452ba5..b166275d5367 100644 --- a/test/source/sheet/xddelink.cxx +++ b/test/source/sheet/xddelink.cxx @@ -30,15 +30,15 @@ void XDDELink::testGetItem() { uno::Reference<sheet::XDDELink> xLink(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", OUString("Sheet.A1"), + CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", OUString("Sheet1.A1"), xLink->getItem()); } void XDDELink::testGetTopic() { uno::Reference<sheet::XDDELink> xLink(init(), UNO_QUERY_THROW); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getTopic()", OUString("ScDDELinksObj.ods"), - xLink->getTopic()); + CPPUNIT_ASSERT_MESSAGE("Unable to execute getTopic()", + xLink->getTopic().endsWith("ScDDELinksObj.ods")); } } // namespace apitest diff --git a/test/source/util/xrefreshable.cxx b/test/source/util/xrefreshable.cxx index 174115e64289..19d1dc42acb0 100644 --- a/test/source/util/xrefreshable.cxx +++ b/test/source/util/xrefreshable.cxx @@ -41,27 +41,7 @@ public: virtual void SAL_CALL disposing(const lang::EventObject& /* xEventObj */) override {} }; -void XRefreshable::testAddRefreshListener() -{ - uno::Reference<util::XRefreshable> xRefreshable(init(), uno::UNO_QUERY_THROW); - - rtl::Reference<MockedRefreshListener> xListener = new MockedRefreshListener(); - xRefreshable->addRefreshListener(uno::Reference<util::XRefreshListener>(xListener.get())); -} - -void XRefreshable::testRefresh() -{ - uno::Reference<util::XRefreshable> xRefreshable(init(), uno::UNO_QUERY_THROW); - - rtl::Reference<MockedRefreshListener> xListener = new MockedRefreshListener(); - xRefreshable->addRefreshListener(uno::Reference<util::XRefreshListener>(xListener.get())); - - xRefreshable->refresh(); - - CPPUNIT_ASSERT(xListener->m_bListenerCalled); -} - -void XRefreshable::testRemoveRefreshListener() +void XRefreshable::testRefreshListener() { uno::Reference<util::XRefreshable> xRefreshable(init(), uno::UNO_QUERY_THROW); |