loplugin:oncevar: empty strings: basic

Change-Id: I4edf130e526c4004aa8913e6aafdcd1e2f4ac1ef
This commit is contained in:
Stephan Bergmann 2017-07-13 11:47:27 +02:00
parent ad4e4c7834
commit 85d71244eb
7 changed files with 13 additions and 26 deletions

View File

@ -849,8 +849,7 @@ void SbClassData::clear()
SbClassFactory::SbClassFactory()
{
OUString aDummyName;
xClassModules = new SbxObject( aDummyName );
xClassModules = new SbxObject( OUString() );
}
SbClassFactory::~SbClassFactory()

View File

@ -619,8 +619,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
aClassAny <<= xClass;
// instantiate SbUnoObject
OUString aName;
SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aClassAny );
SbUnoObject* pSbUnoObject = new SbUnoObject( OUString(), aClassAny );
SbxObjectRef xWrapper = static_cast<SbxObject*>(pSbUnoObject);
// If the object is invalid deliver null
@ -707,8 +706,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue )
}
}
// instantiate a SbUnoObject
OUString aName;
SbUnoObject* pSbUnoObject = new SbUnoObject( aName, aValue );
SbUnoObject* pSbUnoObject = new SbUnoObject( OUString(), aValue );
//If this is called externally e.g. from the scripting
//framework then there is no 'active' runtime the default property will not be set up
//only a vba object will have XDefaultProp set anyway so... this

View File

@ -606,8 +606,7 @@ SbiExprNode* SbiExpression::Unary()
pParser->Next();
SbiExprNode* pObjNode = Operand( true/*bUsedForTypeOf*/ );
pParser->TestToken( IS );
OUString aDummy;
SbiSymDef* pTypeDef = new SbiSymDef( aDummy );
SbiSymDef* pTypeDef = new SbiSymDef( OUString() );
pParser->TypeDecl( *pTypeDef, true );
pNd = new SbiExprNode( pObjNode, pTypeDef->GetTypeId() );
break;
@ -615,8 +614,7 @@ SbiExprNode* SbiExpression::Unary()
case NEW:
{
pParser->Next();
OUString aStr;
SbiSymDef* pTypeDef = new SbiSymDef( aStr );
SbiSymDef* pTypeDef = new SbiSymDef( OUString() );
pParser->TypeDecl( *pTypeDef, true );
pNd = new SbiExprNode( pTypeDef->GetTypeId() );
break;

View File

@ -590,8 +590,7 @@ void SbiParser::Set()
if( eTok == NEW )
{
Next();
OUString aStr;
SbiSymDef* pTypeDef = new SbiSymDef( aStr );
SbiSymDef* pTypeDef = new SbiSymDef( OUString() );
TypeDecl( *pTypeDef, true );
aLvalue.Gen();

View File

@ -3828,8 +3828,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem )
aAny <<= xRet;
// #67173 don't specify a name so that the real class name is entered
OUString aName;
SbxObjectRef xWrapper = static_cast<SbxObject*>(new SbUnoObject( aName, aAny ));
SbxObjectRef xWrapper = static_cast<SbxObject*>(new SbUnoObject( OUString(), aAny ));
pElem->PutObject( xWrapper.get() );
}
else

View File

@ -921,8 +921,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
// Link is already initialised in createLibraryLink()
if( !pImplLib->mbInitialised && (!bStorage || xLibraryStor.is()) )
{
OUString aIndexFileName;
bool bLoaded = implLoadLibraryIndexFile( pImplLib, rLib, xLibraryStor, aIndexFileName );
bool bLoaded = implLoadLibraryIndexFile( pImplLib, rLib, xLibraryStor, OUString() );
SAL_WARN_IF(
bLoaded && aLibName != rLib.aName, "basic",
("Different library names in library container and"
@ -1370,10 +1369,9 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
const OUString& aName,
const uno::Reference< embed::XStorage >& xStorage )
{
OUString aDummyLocation;
Reference< XSimpleFileAccess3 > xDummySFA;
Reference< XInteractionHandler > xDummyHandler;
implStoreLibrary( pLib, aName, xStorage, aDummyLocation, xDummySFA, xDummyHandler );
implStoreLibrary( pLib, aName, xStorage, OUString(), xDummySFA, xDummyHandler );
}
// New variant for library export
@ -1524,9 +1522,8 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
const ::xmlscript::LibDescriptor& rLib,
const uno::Reference< embed::XStorage >& xStorage )
{
OUString aDummyLocation;
Reference< XSimpleFileAccess3 > xDummySFA;
implStoreLibraryIndexFile( pLib, rLib, xStorage, aDummyLocation, xDummySFA );
implStoreLibraryIndexFile( pLib, rLib, xStorage, OUString(), xDummySFA );
}
// New variant for library export
@ -2199,10 +2196,9 @@ Reference< XNameAccess > SAL_CALL SfxLibraryContainer::createLibraryLink
pNewLib->maUnexpandedStorageURL = aUnexpandedStorageURL;
pNewLib->maOriginalStorageURL = StorageURL;
OUString aInitFileName;
uno::Reference< embed::XStorage > xDummyStor;
::xmlscript::LibDescriptor aLibDesc;
implLoadLibraryIndexFile( pNewLib, aLibDesc, xDummyStor, aInitFileName );
implLoadLibraryIndexFile( pNewLib, aLibDesc, xDummyStor, OUString() );
implImportLibDescriptor( pNewLib, aLibDesc );
Reference< XNameAccess > xRet = static_cast< XNameAccess* >( pNewLib );

View File

@ -135,9 +135,8 @@ SfxLibrary* SfxScriptLibraryContainer::implCreateLibraryLink( const OUString&,
Any SAL_CALL SfxScriptLibraryContainer::createEmptyLibraryElement()
{
OUString aMod;
Any aRetAny;
aRetAny <<= aMod;
aRetAny <<= OUString();
return aRetAny;
}
@ -553,9 +552,8 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib,
const uno::Reference< embed::XStorage >& xStorage,
const css::uno::Reference< css::task::XInteractionHandler >& xHandler )
{
OUString aDummyLocation;
Reference< XSimpleFileAccess3 > xDummySFA;
return implStorePasswordLibrary( pLib, aName, xStorage, aDummyLocation, xDummySFA, xHandler );
return implStorePasswordLibrary( pLib, aName, xStorage, OUString(), xDummySFA, xHandler );
}
bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, const OUString& aName,