summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-03-30 11:13:47 +0200
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2021-04-09 09:40:38 +0200
commitaed1937e7efdf9a6d8c831edef73ec822832ea4e (patch)
treeecc0aa191dd00739fa31ca75f5ae7a906a6be905 /test
parent0b62ab983f99805d69c8a2c9d32a410d3daf0e9e (diff)
tdf#119457 - check for a valid range name and cell reference
Change-Id: If23eda52142ba5e59cfd354f2177b1ac1727efaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113341 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'test')
-rw-r--r--test/source/sheet/xnamedranges.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/source/sheet/xnamedranges.cxx b/test/source/sheet/xnamedranges.cxx
index 25726ca9e739..e07911f421ab 100644
--- a/test/source/sheet/xnamedranges.cxx
+++ b/test/source/sheet/xnamedranges.cxx
@@ -70,6 +70,13 @@ void XNamedRanges::testAddNewByName()
xNamedRanges->addNewByName(aName5, "D5", aBaseAddress, nType);
CPPUNIT_ASSERT_MESSAGE("Failed to create Namedrange Type ROW_HEADER",
xNamedRanges->hasByName(aName5));
+
+ // tdf#119457 - check for a valid range name
+ OUString aName6("type_INVALID_BAD_STRING.+:");
+ CPPUNIT_ASSERT_THROW(xNamedRanges->addNewByName(aName6, "D6", aBaseAddress, 0),
+ uno::RuntimeException);
+ CPPUNIT_ASSERT_MESSAGE("Created Namedrange with invalid name",
+ !xNamedRanges->hasByName(aName6));
}
void XNamedRanges::testAddNewFromTitles()