diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-10-19 10:30:04 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-10-19 15:17:53 +0200 |
commit | 625705f10e765b6fa246c016acc9546cb0247301 (patch) | |
tree | f5e4bf2544bbebc77b58ab3fea58680deb650564 /basic/source | |
parent | 15b86648f031bb2b44b23a1826ad4ac2a00884b3 (diff) |
Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: basic
Change-Id: Ic82e02ff43db09174a74f4e584e2ce50e8983556
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158145
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/basmgr/basicmanagerrepository.cxx | 2 | ||||
-rw-r--r-- | basic/source/basmgr/basmgr.cxx | 12 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 4 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 12 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxform.cxx | 18 | ||||
-rw-r--r-- | basic/source/sbx/sbxscan.cxx | 2 | ||||
-rw-r--r-- | basic/source/uno/dlgcont.cxx | 4 |
8 files changed, 28 insertions, 28 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 7a2ed5efd20a..bf0c6ee53a46 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -382,7 +382,7 @@ namespace basic try { // ensure there's a standard library in the basic container - static constexpr OUStringLiteral aStdLibName( u"Standard" ); + static constexpr OUString aStdLibName( u"Standard"_ustr ); if ( !_rxBasicLibraries->hasByName( aStdLibName ) ) { _rxBasicLibraries->createLibrary( aStdLibName ); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 6e2ce76d37ae..c619bbf1fb6a 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -88,12 +88,12 @@ typedef WeakImplHelper< script::XStarBasicAccess > StarBasicAccessHelper; // Version 2 // + bool bReference -constexpr OUStringLiteral szStdLibName = u"Standard"; -constexpr OUStringLiteral szBasicStorage = u"StarBASIC"; -constexpr OUStringLiteral szOldManagerStream = u"BasicManager"; -constexpr OUStringLiteral szManagerStream = u"BasicManager2"; -constexpr OUStringLiteral szImbedded = u"LIBIMBEDDED"; -constexpr OStringLiteral szCryptingKey = "CryptedBasic"; +constexpr OUString szStdLibName = u"Standard"_ustr; +constexpr OUString szBasicStorage = u"StarBASIC"_ustr; +constexpr OUString szOldManagerStream = u"BasicManager"_ustr; +constexpr OUString szManagerStream = u"BasicManager2"_ustr; +constexpr OUString szImbedded = u"LIBIMBEDDED"_ustr; +constexpr OString szCryptingKey = "CryptedBasic"_ostr; const StreamMode eStreamReadMode = StreamMode::READ | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 94b1becd04a5..eeef54222647 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -55,7 +55,7 @@ using namespace ::com::sun::star::script; -constexpr OUStringLiteral SB_RTLNAME = u"@SBRTL"; +constexpr OUString SB_RTLNAME = u"@SBRTL"_ustr; // i#i68894# using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -1306,7 +1306,7 @@ SbxVariable* StarBASIC::Find( const OUString& rName, SbxClassType t ) } } } - static constexpr OUStringLiteral aMainStr(u"Main"); + static constexpr OUString aMainStr(u"Main"_ustr); if( !pRes && pNamed && ( t == SbxClassType::Method || t == SbxClassType::DontCare ) && !pNamed->GetName().equalsIgnoreAsciiCase( aMainStr ) ) { diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index b9db47dcd306..bf740aaafc0d 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -100,9 +100,9 @@ using namespace cppu; // Identifiers for creating the strings for dbg_Properties -constexpr OUStringLiteral ID_DBG_SUPPORTEDINTERFACES = u"Dbg_SupportedInterfaces"; -constexpr OUStringLiteral ID_DBG_PROPERTIES = u"Dbg_Properties"; -constexpr OUStringLiteral ID_DBG_METHODS = u"Dbg_Methods"; +constexpr OUString ID_DBG_SUPPORTEDINTERFACES = u"Dbg_SupportedInterfaces"_ustr; +constexpr OUString ID_DBG_PROPERTIES = u"Dbg_Properties"_ustr; +constexpr OUString ID_DBG_METHODS = u"Dbg_Methods"_ustr; char const aSeqLevelStr[] = "[]"; @@ -2743,15 +2743,15 @@ void SbUnoObject::implCreateDbgProperties() Property aProp; // Id == -1: display the implemented interfaces corresponding the ClassProvider - auto xVarRef = tools::make_ref<SbUnoProperty>( OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false ); + auto xVarRef = tools::make_ref<SbUnoProperty>( ID_DBG_SUPPORTEDINTERFACES, SbxSTRING, SbxSTRING, aProp, -1, false, false ); QuickInsert( xVarRef.get() ); // Id == -2: output the properties - xVarRef = tools::make_ref<SbUnoProperty>( OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false ); + xVarRef = tools::make_ref<SbUnoProperty>( ID_DBG_PROPERTIES, SbxSTRING, SbxSTRING, aProp, -2, false, false ); QuickInsert( xVarRef.get() ); // Id == -3: output the Methods - xVarRef = tools::make_ref<SbUnoProperty>( OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false ); + xVarRef = tools::make_ref<SbUnoProperty>( ID_DBG_METHODS, SbxSTRING, SbxSTRING, aProp, -3, false, false ); QuickInsert( xVarRef.get() ); } diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index abcee4bcc42d..bdde50944a1d 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1800,7 +1800,7 @@ void removeDimAsNewRecoverItem( SbxVariable* pVar ) // saving object variable // not-object variables will cause errors -constexpr OUStringLiteral pCollectionStr = u"Collection"; +constexpr OUString pCollectionStr = u"Collection"_ustr; void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp ) { diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index e616a1878910..84e5f22fd8da 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -62,15 +62,15 @@ COMMENT: Visual-Basic treats the following (invalid) format-strings #define FORMAT_SEPARATOR ';' // predefined formats for the Format$()-command: -constexpr OUStringLiteral BASICFORMAT_GENERALNUMBER = u"General Number"; -constexpr OUStringLiteral BASICFORMAT_CURRENCY = u"Currency"; -constexpr OUStringLiteral BASICFORMAT_FIXED = u"Fixed"; -constexpr OUStringLiteral BASICFORMAT_STANDARD = u"Standard"; -constexpr OUStringLiteral BASICFORMAT_PERCENT = u"Percent"; -constexpr OUStringLiteral BASICFORMAT_SCIENTIFIC = u"Scientific"; -constexpr OUStringLiteral BASICFORMAT_YESNO = u"Yes/No"; -constexpr OUStringLiteral BASICFORMAT_TRUEFALSE = u"True/False"; -constexpr OUStringLiteral BASICFORMAT_ONOFF = u"On/Off"; +constexpr OUString BASICFORMAT_GENERALNUMBER = u"General Number"_ustr; +constexpr OUString BASICFORMAT_CURRENCY = u"Currency"_ustr; +constexpr OUString BASICFORMAT_FIXED = u"Fixed"_ustr; +constexpr OUString BASICFORMAT_STANDARD = u"Standard"_ustr; +constexpr OUString BASICFORMAT_PERCENT = u"Percent"_ustr; +constexpr OUString BASICFORMAT_SCIENTIFIC = u"Scientific"_ustr; +constexpr OUString BASICFORMAT_YESNO = u"Yes/No"_ustr; +constexpr OUString BASICFORMAT_TRUEFALSE = u"True/False"_ustr; +constexpr OUString BASICFORMAT_ONOFF = u"On/Off"_ustr; // Comment: Visual-Basic has a maximum of 12 positions after the // decimal point for floating-point-numbers. diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index 6003734cc050..0d6949e913d6 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -488,7 +488,7 @@ const VbaFormatInfo* getFormatInfo( std::u16string_view rFmt ) constexpr OUStringLiteral VBAFORMAT_GENERALDATE = u"General Date"; constexpr OUStringLiteral VBAFORMAT_C = u"c"; constexpr OUStringLiteral VBAFORMAT_N = u"n"; -constexpr OUStringLiteral VBAFORMAT_NN = u"nn"; +constexpr OUString VBAFORMAT_NN = u"nn"_ustr; constexpr OUStringLiteral VBAFORMAT_W = u"w"; constexpr OUStringLiteral VBAFORMAT_Y = u"y"; constexpr OUStringLiteral VBAFORMAT_LOWERCASE = u"<"; diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 1ece724fe0c7..666b6d355a00 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -363,8 +363,8 @@ rtl::Reference<SfxLibraryContainer> SfxDialogLibraryContainer::createInstanceImp return new SfxDialogLibraryContainer(); } -constexpr OUStringLiteral aResourceFileNameBase = u"DialogStrings"; -constexpr OUStringLiteral aResourceFileCommentBase = u"# Strings for Dialog Library "; +constexpr OUString aResourceFileNameBase = u"DialogStrings"_ustr; +constexpr OUString aResourceFileCommentBase = u"# Strings for Dialog Library "_ustr; // Resource handling Reference< css::resource::XStringResourcePersistence > |