From 6c80a8fe89fadf9a2c7260a09c037a09462f53d1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 6 Nov 2015 09:23:33 +0200 Subject: new loplugin: oncevar Change-Id: If57390510dde4d166be3141b9f658a7453755d3f Reviewed-on: https://gerrit.libreoffice.org/19815 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/draw/animationimport.cxx | 4 +--- xmloff/source/draw/sdxmlexp.cxx | 4 +--- xmloff/source/draw/sdxmlimp.cxx | 6 ++---- xmloff/source/draw/shapeexport.cxx | 3 +-- 4 files changed, 5 insertions(+), 12 deletions(-) (limited to 'xmloff/source/draw') diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx index becd54016286..a012696d3238 100644 --- a/xmloff/source/draw/animationimport.cxx +++ b/xmloff/source/draw/animationimport.cxx @@ -90,9 +90,7 @@ using ::com::sun::star::lang::XInitialization; Sequence< OUString > SAL_CALL AnimationsImport_getSupportedServiceNames() throw() { - const OUString aServiceName( "com.sun.star.comp.Xmloff.AnimationsImport" ); - const Sequence< OUString > aSeq( &aServiceName, 1 ); - return aSeq; + return Sequence< OUString > { "com.sun.star.comp.Xmloff.AnimationsImport" }; } OUString SAL_CALL AnimationsImport_getImplementationName() throw() diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 51d536f5d3c3..9283b168fc10 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -2729,9 +2729,7 @@ void SdXMLExport::exportAnnotations( const Reference& xDrawPage ) #define SERVICE( classname, servicename, implementationname, draw, flags )\ uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\ {\ - const OUString aServiceName( servicename );\ - const uno::Sequence< OUString > aSeq( &aServiceName, 1 );\ - return aSeq;\ + return uno::Sequence< OUString > { servicename };\ }\ OUString SAL_CALL classname##_getImplementationName() throw()\ {\ diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index afc5130e15fc..88d036da02f9 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -254,13 +254,11 @@ SvXMLImportContext *SdXMLFlatDocContext_Impl::CreateChildContext( #define SERVICE(classname,servicename,implementationname,draw,flags)\ uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\ {\ - const OUString aServiceName( servicename );\ - const uno::Sequence< OUString > aSeq( &aServiceName, 1 );\ - return aSeq;\ + return uno::Sequence< OUString > { servicename };\ }\ OUString SAL_CALL classname##_getImplementationName() throw()\ {\ - return OUString( implementationname );\ + return OUString( implementationname );\ }\ uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )\ {\ diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index de47927b9331..676e5a670883 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -4205,8 +4205,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean if ( aGeoPropSet >>= aGeoPropSeq ) { bool bCoordinates = false; - const OUString sCustomShapeType( "non-primitive" ); - OUString aCustomShapeType( sCustomShapeType ); + OUString aCustomShapeType( "non-primitive" ); sal_Int32 j, nGeoPropCount = aGeoPropSeq.getLength(); for ( j = 0; j < nGeoPropCount; j++ ) -- cgit