diff options
Diffstat (limited to 'test/source/container/xnamed.cxx')
-rw-r--r-- | test/source/container/xnamed.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/source/container/xnamed.cxx b/test/source/container/xnamed.cxx index c8234f6dde4f..3b8023b6bc95 100644 --- a/test/source/container/xnamed.cxx +++ b/test/source/container/xnamed.cxx @@ -8,6 +8,7 @@ */ #include <test/container/xnamed.hxx> +#include <rtl/ustring.hxx> #include <com/sun/star/container/XNamed.hpp> #include <com/sun/star/uno/RuntimeException.hpp> @@ -40,6 +41,19 @@ void XNamed::testSetName() CPPUNIT_ASSERT_EQUAL(m_aTestName, xNamed->getName()); } +void XNamed::testSetNameByScSheetLinkObj() +{ + uno::Reference<container::XNamed> xNamed(init(), uno::UNO_QUERY_THROW); + OUString aTestName(m_aTestName.replaceAll("ScSheetLinkObj", "NewScSheetLinkObj")); + + xNamed->setName(aTestName); + CPPUNIT_ASSERT_EQUAL(aTestName, xNamed->getName()); + + // restore old name + xNamed->setName(m_aTestName); + CPPUNIT_ASSERT_EQUAL(m_aTestName, xNamed->getName()); +} + void XNamed::testSetNameThrowsException() { uno::Reference<container::XNamed> xNamed(init(), uno::UNO_QUERY_THROW); |