summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-23 13:16:31 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-26 14:51:15 +0100
commita3d0091d185f39eddabf4d372ebe0ac3061dbb89 (patch)
tree4d70cedc274972ccc21b6b8e7105f042090cf5d6 /basic
parentaf791fb775e35c11ad01c42a7085dd121ab9c7a6 (diff)
New loplugin:stringliteralvar
See the comment at the top of compilerplugins/clang/stringliteralvar.cxx for details. (Turned some affected variables in included files into inline variables, to avoid GCC warnings about unused variables.) Change-Id: Ie77219e6adfdaaceaa8b4e590b08971f2f04c83a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/basmgr/basmgr.cxx12
-rw-r--r--basic/source/classes/sbunoobj.cxx6
-rw-r--r--basic/source/runtime/runtime.cxx2
-rw-r--r--basic/source/uno/dlgcont.cxx4
4 files changed, 12 insertions, 12 deletions
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 77f5939cd9d0..a3cf5b9e3ccf 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -84,12 +84,12 @@ typedef WeakImplHelper< script::XStarBasicAccess > StarBasicAccessHelper;
// Version 2
// + bool bReference
-const char szStdLibName[] = "Standard";
-const char szBasicStorage[] = "StarBASIC";
-const char szOldManagerStream[] = "BasicManager";
-const char szManagerStream[] = "BasicManager2";
-const char szImbedded[] = "LIBIMBEDDED";
-const char szCryptingKey[] = "CryptedBasic";
+const OUStringLiteral szStdLibName = u"Standard";
+const OUStringLiteral szBasicStorage = u"StarBASIC";
+const OUStringLiteral szOldManagerStream = u"BasicManager";
+const OUStringLiteral szManagerStream = u"BasicManager2";
+const OUStringLiteral szImbedded = u"LIBIMBEDDED";
+const OStringLiteral szCryptingKey = "CryptedBasic";
const StreamMode eStreamReadMode = StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL;
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 3816d351302c..82ffb8c11699 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -99,9 +99,9 @@ using namespace cppu;
// Identifiers for creating the strings for dbg_Properties
-char16_t constexpr ID_DBG_SUPPORTEDINTERFACES[] = u"Dbg_SupportedInterfaces";
-char const ID_DBG_PROPERTIES[] = "Dbg_Properties";
-char const ID_DBG_METHODS[] = "Dbg_Methods";
+OUStringLiteral constexpr ID_DBG_SUPPORTEDINTERFACES = u"Dbg_SupportedInterfaces";
+OUStringLiteral const ID_DBG_PROPERTIES = u"Dbg_Properties";
+OUStringLiteral const ID_DBG_METHODS = u"Dbg_Methods";
char const aSeqLevelStr[] = "[]";
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 5a64166b63a1..3ceaf38cafc7 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -1786,7 +1786,7 @@ void removeDimAsNewRecoverItem( SbxVariable* pVar )
// saving object variable
// not-object variables will cause errors
-const char pCollectionStr[] = "Collection";
+const OUStringLiteral pCollectionStr = u"Collection";
void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp )
{
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index b303349fa009..a8e124616910 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -342,8 +342,8 @@ SfxLibraryContainer* SfxDialogLibraryContainer::createInstanceImpl()
return new SfxDialogLibraryContainer();
}
-const char aResourceFileNameBase[] = "DialogStrings";
-const char aResourceFileCommentBase[] = "# Strings for Dialog Library ";
+const OUStringLiteral aResourceFileNameBase = u"DialogStrings";
+const OUStringLiteral aResourceFileCommentBase = u"# Strings for Dialog Library ";
// Resource handling
Reference< css::resource::XStringResourcePersistence >