diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-30 16:38:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-31 08:56:20 +0000 |
commit | 1c3e84d8192218befebcddae2ed9842d081dc6c7 (patch) | |
tree | f4fc5cddd181d6d49bf55f74e6d3d107b8ae8d18 /basic | |
parent | e1e6cdbb1e9ff37f0bb740a70045c66953bec50c (diff) |
teach lolugin:stringconstant about calling constructors
so we can remove unnecessary calls to the OUString(literal) constructor
when calling constructors like this:
Foo(OUString("xxx"), 1)
Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36
Reviewed-on: https://gerrit.libreoffice.org/33698
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/errobject.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 6 | ||||
-rw-r--r-- | basic/source/classes/sbunoobj.cxx | 12 | ||||
-rw-r--r-- | basic/source/runtime/runtime.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/stdobj1.cxx | 6 |
5 files changed, 14 insertions, 14 deletions
diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx index 7f90e16ce6b6..baad83868410 100644 --- a/basic/source/classes/errobject.cxx +++ b/basic/source/classes/errobject.cxx @@ -192,7 +192,7 @@ SbxErrObject::getUnoErrObject() SbxVariableRef const & SbxErrObject::getErrObject() { - static SbxVariableRef pGlobErr = new SbxErrObject( OUString("Err"), uno::makeAny( uno::Reference< vba::XErrObject >( new ErrObject() ) ) ); + static SbxVariableRef pGlobErr = new SbxErrObject( "Err", uno::makeAny( uno::Reference< vba::XErrObject >( new ErrObject() ) ) ); return pGlobErr; } diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 66c1a94e562b..168842bc74db 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -445,7 +445,7 @@ SbxObject* SbiFactory::CreateObject( const OUString& rClass ) } else if( rClass.equalsIgnoreAsciiCase( "Collection" ) ) { - return new BasicCollection( OUString("Collection")); + return new BasicCollection( "Collection" ); } else if( rClass.equalsIgnoreAsciiCase( "FileSystemObject" ) ) { @@ -915,7 +915,7 @@ SbModule* SbClassFactory::FindClass( const OUString& rClassName ) } StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic ) - : SbxObject( OUString("StarBASIC") ), bDocBasic( bIsDocBasic ) + : SbxObject("StarBASIC"), bDocBasic( bIsDocBasic ) { SetParent( p ); pLibInfo = nullptr; @@ -937,7 +937,7 @@ StarBASIC::StarBASIC( StarBASIC* p, bool bIsDocBasic ) GetSbData()->pUnoFac = new SbUnoFactory; AddFactory( GetSbData()->pUnoFac ); } - pRtl = new SbiStdObject(OUString(RTLNAME), this ); + pRtl = new SbiStdObject(RTLNAME, this ); // Search via StarBasic is always global SetFlag( SbxFlagBits::GlobalSearch ); pVBAGlobals = nullptr; diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index b85772631f74..dd3ea516a0f8 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -3051,7 +3051,7 @@ void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, bool Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() ); // Create a SbUnoObject out of it and return it - SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "ProcessServiceManager" ), Any(xFactory) ); + SbUnoObjectRef xUnoObj = new SbUnoObject( "ProcessServiceManager", Any(xFactory) ); refVar->PutObject( xUnoObj.get() ); } @@ -3759,7 +3759,7 @@ SbUnoSingleton* findUnoSingleton( const OUString& rName ) SbUnoSingleton::SbUnoSingleton( const OUString& aName_ ) : SbxObject( aName_ ) { - SbxVariableRef xGetMethodRef = new SbxMethod( OUString( "get" ), SbxOBJECT ); + SbxVariableRef xGetMethodRef = new SbxMethod( "get", SbxOBJECT ); QuickInsert( xGetMethodRef.get() ); } @@ -4130,7 +4130,7 @@ void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, bool bWrite Any aContextAny( comphelper::getProcessComponentContext() ); - SbUnoObjectRef xUnoObj = new SbUnoObject( OUString( "DefaultContext" ), aContextAny ); + SbUnoObjectRef xUnoObj = new SbUnoObject( "DefaultContext", aContextAny ); refVar->PutObject( xUnoObj.get() ); } @@ -4775,15 +4775,15 @@ void SbUnoStructRefObject::implCreateDbgProperties() Property aProp; // Id == -1: display the implemented interfaces corresponding the ClassProvider - SbxVariableRef xVarRef = new SbUnoProperty( OUString(ID_DBG_SUPPORTEDINTERFACES), SbxSTRING, SbxSTRING, aProp, -1, false, false ); + SbxVariableRef xVarRef = new SbUnoProperty( ID_DBG_SUPPORTEDINTERFACES, SbxSTRING, SbxSTRING, aProp, -1, false, false ); QuickInsert( xVarRef.get() ); // Id == -2: output the properties - xVarRef = new SbUnoProperty( OUString(ID_DBG_PROPERTIES), SbxSTRING, SbxSTRING, aProp, -2, false, false ); + xVarRef = new SbUnoProperty( ID_DBG_PROPERTIES, SbxSTRING, SbxSTRING, aProp, -2, false, false ); QuickInsert( xVarRef.get() ); // Id == -3: output the Methods - xVarRef = new SbUnoProperty( OUString(ID_DBG_METHODS), SbxSTRING, SbxSTRING, aProp, -3, false, false ); + xVarRef = new 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 e4febca102ea..139d154828f4 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -1924,7 +1924,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b } else if( rItem.m_aObjClass.equalsIgnoreAsciiCase( pCollectionStr ) ) { - BasicCollection* pNewCollection = new BasicCollection( OUString(pCollectionStr) ); + BasicCollection* pNewCollection = new BasicCollection( pCollectionStr ); pNewCollection->SetName( rItem.m_aObjName ); pNewCollection->SetParent( rItem.m_pObjParent ); refVar->PutObject( pNewCollection ); diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx index 3635a47e3bc4..8284a1acf7ed 100644 --- a/basic/source/runtime/stdobj1.cxx +++ b/basic/source/runtime/stdobj1.cxx @@ -108,7 +108,7 @@ void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, bool bWrite ) SbStdPicture::SbStdPicture() : - SbxObject( OUString("Picture")) + SbxObject( "Picture" ) { // Properties SbxVariable* p = Make( "Type", SbxClassType::Property, SbxVARIANT ); @@ -212,7 +212,7 @@ void SbStdFont::PropName( SbxVariable* pVar, SbxArray*, bool bWrite ) SbStdFont::SbStdFont() - : SbxObject( OUString("Font") ) + : SbxObject( "Font" ) , bBold(false) , bItalic(false) , bStrikeThrough(false) @@ -370,7 +370,7 @@ void SbStdClipboard::MethSetText( SbxVariable* pVar, SbxArray* pPar_, bool ) SbStdClipboard::SbStdClipboard() : - SbxObject( OUString("Clipboard") ) + SbxObject( "Clipboard" ) { SbxVariable* p = Find( "Name", SbxClassType::Property ); assert(p && "No Name Property"); |