summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2022-09-06 20:10:09 +0200
committerEike Rathke <erack@redhat.com>2022-09-07 00:21:34 +0200
commit55e7de171b666a87f29f072e0a4787480946c066 (patch)
treea9b657fa50a79654af1faeef2b13d4dd9cda8a18
parentbb571bb225a5a5f3fa81b7aaea6cd559ebf1a94b (diff)
Always enquote ColRowName (label) as SingleQuoted
It's anyway required by ODFF and also in UI prevents confusion between defined names and labels of the same name. Change-Id: Iba03f15f1f778132696101507e61cc0ef8de6c6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139533 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Jenkins
-rw-r--r--sc/source/core/tool/compiler.cxx15
1 files changed, 4 insertions, 11 deletions
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 550354d6b8f4..fd18ad624377 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -5355,18 +5355,11 @@ void ScCompiler::CreateStringFromSingleRef( OUStringBuffer& rBuffer, const Formu
if (rDoc.HasStringData(aAbs.Col(), aAbs.Row(), aAbs.Tab()))
{
OUString aStr = rDoc.GetString(aAbs, mpInterpreterContext);
-
- // If string contains only numeric characters or if it contains non-alphanumeric characters
- // -> quote characters contained within are escaped by ''.
- // -> put quotes around string
- sal_Int32 nType = ScGlobal::getCharClass().getStringType( aStr, 0, aStr.getLength() );
- if ( CharClass::isNumericType( nType )
- || !CharClass::isAlphaNumericType( nType ) )
- {
- aStr = aStr.replaceAll(u"'", u"''");
- aStr = "'" + aStr + "'";
- }
+ // Enquote to SingleQuoted.
+ aStr = aStr.replaceAll(u"'", u"''");
+ rBuffer.append('\'');
rBuffer.append(aStr);
+ rBuffer.append('\'');
}
else
{