summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-07-13 11:47:27 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-07-13 11:47:27 +0200
commit85d71244eb8caf55aab8094b587dfee7fa1e97b2 (patch)
tree7485b858e2c598a4a38783d909ae716c5bb84b48 /basic
parentad4e4c7834c576189e2a4b230baa1f12207718ec (diff)
loplugin:oncevar: empty strings: basic
Change-Id: I4edf130e526c4004aa8913e6aafdcd1e2f4ac1ef
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sb.cxx3
-rw-r--r--basic/source/classes/sbunoobj.cxx6
-rw-r--r--basic/source/comp/exprtree.cxx6
-rw-r--r--basic/source/comp/parser.cxx3
-rw-r--r--basic/source/runtime/runtime.cxx3
-rw-r--r--basic/source/uno/namecont.cxx12
-rw-r--r--basic/source/uno/scriptcont.cxx6
7 files changed, 13 insertions, 26 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index e72136234e21..7367bba69051 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -849,8 +849,7 @@ void SbClassData::clear()
SbClassFactory::SbClassFactory()
{
- OUString aDummyName;
- xClassModules = new SbxObject( aDummyName );
+ xClassModules = new SbxObject( OUString() );
}
SbClassFactory::~SbClassFactory()
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 027caa17fd50..a5274f662c50 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -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
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 3039046f39bd..085476bb794a 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -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;
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 0347e0eccd62..d4a33465c122 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -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();
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 47903f72cadf..ce1e17f74872 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -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
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 4a31ce5b2709..5c8f0c29dda2 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -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 );
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 6f14015a0d9e..9cfea4d879b8 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -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,