diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-16 16:57:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 13:31:57 +0200 |
commit | 60bc26354763fa3461db49a3e827da552484150d (patch) | |
tree | 5c66cee43f76f556f9a086a67fa8a6e88750c5d5 /vbahelper | |
parent | 7867e1f1cdd726cb98a236245e3d08557cc3a313 (diff) |
new loplugin:conststringfield
Look for const string fields which can be static, and
mostly convert them to OUStringLiteral
And add a getLength() method to OUStringLiteral to make
the transition easier.
Remove dead code in XclExpRoot::GenerateDefaultEncryptionData,
default password is never empty.
Change-Id: Iae75514d9dbb87289fd5b016222f640abe755091
Reviewed-on: https://gerrit.libreoffice.org/59204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/vbahelper/vbaglobalbase.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/vbahelper/source/vbahelper/vbaglobalbase.cxx b/vbahelper/source/vbahelper/vbaglobalbase.cxx index cc0f22c107c5..6e56cc19fea1 100644 --- a/vbahelper/source/vbahelper/vbaglobalbase.cxx +++ b/vbahelper/source/vbahelper/vbaglobalbase.cxx @@ -31,13 +31,13 @@ using namespace ooo::vba; // special key to return the Application const char sAppService[] = "ooo.vba.Application"; +static const OUStringLiteral gsApplication( "Application" ); VbaGlobalsBase::VbaGlobalsBase( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCtxName ) : Globals_BASE( xParent, xContext ) , msDocCtxName( sDocCtxName ) - , msApplication( "Application" ) { // overwrite context with custom one ( that contains the application ) // wrap the service manager as we don't want the disposing context to tear down the 'normal' ServiceManager ( or at least that's what the code appears like it wants to do ) @@ -49,7 +49,7 @@ const uno::Reference< uno::XComponentContext >& xContext, const OUString& sDocCt ::cppu::ContextEntry_Init aHandlerContextInfo[] = { - ::cppu::ContextEntry_Init( msApplication, uno::Any() ), + ::cppu::ContextEntry_Init( gsApplication, uno::Any() ), ::cppu::ContextEntry_Init( sDocCtxName, uno::Any() ), ::cppu::ContextEntry_Init( "/singletons/com.sun.star.lang.theServiceManager" , uno::makeAny( aSrvMgr ) ) }; @@ -91,7 +91,7 @@ VbaGlobalsBase::~VbaGlobalsBase() // release document reference (we don't want the component context trying to dispose that) xNameContainer->removeByName( msDocCtxName ); // release application reference, as it is holding onto the context - xNameContainer->removeByName( msApplication ); + xNameContainer->removeByName( gsApplication ); } } catch ( const uno::Exception& ) @@ -106,9 +106,9 @@ VbaGlobalsBase::init( const uno::Sequence< beans::PropertyValue >& aInitArgs ) for ( sal_Int32 nIndex = 0; nIndex < nLen; ++nIndex ) { uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY_THROW ); - if ( aInitArgs[ nIndex ].Name == msApplication ) + if ( aInitArgs[ nIndex ].Name == gsApplication ) { - xNameContainer->replaceByName( msApplication, aInitArgs[ nIndex ].Value ); + xNameContainer->replaceByName( gsApplication, aInitArgs[ nIndex ].Value ); uno::Reference< XHelperInterface > xParent( aInitArgs[ nIndex ].Value, uno::UNO_QUERY ); mxParent = xParent; } @@ -125,7 +125,7 @@ VbaGlobalsBase::createInstance( const OUString& aServiceSpecifier ) { // try to extract the Application from the context uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY ); - xNameContainer->getByName( msApplication ) >>= xReturn; + xNameContainer->getByName( gsApplication ) >>= xReturn; } else if ( hasServiceName( aServiceSpecifier ) ) xReturn = mxContext->getServiceManager()->createInstanceWithContext( aServiceSpecifier, mxContext ); @@ -141,7 +141,7 @@ VbaGlobalsBase::createInstanceWithArguments( const OUString& aServiceSpecifier, { // try to extract the Application from the context uno::Reference< container::XNameContainer > xNameContainer( mxContext, uno::UNO_QUERY ); - xNameContainer->getByName( msApplication ) >>= xReturn; + xNameContainer->getByName( gsApplication ) >>= xReturn; } else if ( hasServiceName( aServiceSpecifier ) ) xReturn = mxContext->getServiceManager()->createInstanceWithArgumentsAndContext( aServiceSpecifier, Arguments, mxContext ); |