summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-04-05 09:38:11 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-04-05 11:30:24 +0200
commitb32c85d0beb219e9f4ba9f043ae712b5d3ce2c18 (patch)
treef29948fc2b78d264188eb882e155612bd06476cc /basic
parent2ad6a4b547bcb62567836fa1c05f88c0051ac729 (diff)
Move creation of case-insensitive variable name to a central place
SbxVariable::NameToCaseInsensitiveName might then be used wherever such names may be needed (see e.g. tdf#148358). Change-Id: I7749a12a05225398848cbf72700c6f0bc119bc22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132561 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sb.cxx5
-rw-r--r--basic/source/sbx/sbxvar.cxx8
2 files changed, 8 insertions, 5 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 902f7adfd91f..def34b3718d6 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -47,9 +47,6 @@
#include <memory>
#include <unordered_map>
-#include <global.hxx>
-#include <unotools/transliterationwrapper.hxx>
-
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
@@ -2079,7 +2076,7 @@ sal_Int32 BasicCollection::implGetIndexForName(const OUString& rName)
if (pVar->GetHashCode() == nNameHash)
{
if (aNameCI.isEmpty() && !rName.isEmpty())
- aNameCI = SbGlobal::GetTransliteration().transliterate(rName, 0, rName.getLength());
+ aNameCI = SbxVariable::NameToCaseInsensitiveName(rName);
if (aNameCI == pVar->GetName(SbxNameType::CaseInsensitive))
return i;
}
diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx
index a08122961b66..f0d99d7f3654 100644
--- a/basic/source/sbx/sbxvar.cxx
+++ b/basic/source/sbx/sbxvar.cxx
@@ -181,6 +181,12 @@ void SbxVariable::SetParameters( SbxArray* p )
// Name of the variables
+// static
+OUString SbxVariable::NameToCaseInsensitiveName(const OUString& rName)
+{
+ return SbGlobal::GetTransliteration().transliterate(rName, 0, rName.getLength());
+}
+
void SbxVariable::SetName( const OUString& rName )
{
maName = rName;
@@ -198,7 +204,7 @@ const OUString& SbxVariable::GetName( SbxNameType t ) const
if (t == SbxNameType::CaseInsensitive)
{
if (maNameCI.isEmpty() && !maName.isEmpty())
- maNameCI = SbGlobal::GetTransliteration().transliterate(maName, 0, maName.getLength());
+ maNameCI = NameToCaseInsensitiveName(maName);
return maNameCI;
}
// Request parameter-information (not for objects)