diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-11-15 12:22:28 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-15 12:18:55 +0000 |
commit | 25aec383f95fded43b3fe5fc588b4ebdc6d7d272 (patch) | |
tree | 846cce228d7ff120abc40b7767b251c2e04b2a30 /comphelper | |
parent | loplugin:nullptr (diff) | |
download | core-25aec383f95fded43b3fe5fc588b4ebdc6d7d272.tar.gz core-25aec383f95fded43b3fe5fc588b4ebdc6d7d272.zip |
use initialiser for Sequence<OUString>
replaced using:
git grep -lP 'Sequence.*OUString.*\(\s*1\s*\)'
| xargs perl -0777 -pi -e
"s/Sequence<\s*OUString\s*> (\w+)\(\s*1\s*\);
.*\[0\] = (\S+);/Sequence<OUString> \1 { \2 };/g"
Change-Id: I20ad0489da887a9712982531c3b127339bb8b3b9
Reviewed-on: https://gerrit.libreoffice.org/19969
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'comphelper')
5 files changed, 5 insertions, 10 deletions
diff --git a/comphelper/source/misc/documentiologring.cxx b/comphelper/source/misc/documentiologring.cxx index b08beac8ceef..fea9257d17eb 100644 --- a/comphelper/source/misc/documentiologring.cxx +++ b/comphelper/source/misc/documentiologring.cxx @@ -49,8 +49,7 @@ OSimpleLogRing::~OSimpleLogRing() uno::Sequence< OUString > SAL_CALL OSimpleLogRing::getSupportedServiceNames_static() { - uno::Sequence< OUString > aResult( 1 ); - aResult[0] = getServiceName_static(); + uno::Sequence<OUString> aResult { getServiceName_static() }; return aResult; } diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx index bb58209209da..fe7b1590bf65 100644 --- a/comphelper/source/misc/officerestartmanager.cxx +++ b/comphelper/source/misc/officerestartmanager.cxx @@ -36,8 +36,7 @@ namespace comphelper uno::Sequence< OUString > SAL_CALL OOfficeRestartManager::getSupportedServiceNames_static() { - uno::Sequence< OUString > aResult( 1 ); - aResult[0] = getServiceName_static(); + uno::Sequence<OUString> aResult { getServiceName_static() }; return aResult; } diff --git a/comphelper/source/property/genericpropertyset.cxx b/comphelper/source/property/genericpropertyset.cxx index 383c26762c94..42b3a9f71b97 100644 --- a/comphelper/source/property/genericpropertyset.cxx +++ b/comphelper/source/property/genericpropertyset.cxx @@ -256,8 +256,7 @@ OUString SAL_CALL GenericPropertySet::getImplementationName() throw( RuntimeExce Sequence< OUString > SAL_CALL GenericPropertySet::getSupportedServiceNames( ) throw( RuntimeException, std::exception ) { - Sequence< OUString > aSNS( 1 ); - aSNS.getArray()[0] = "com.sun.star.beans.XPropertySet"; + Sequence<OUString> aSNS { "com.sun.star.beans.XPropertySet" }; return aSNS; } diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx index 306a5e68d283..f5b5f3bcb0d5 100644 --- a/comphelper/source/streaming/seqinputstreamserv.cxx +++ b/comphelper/source/streaming/seqinputstreamserv.cxx @@ -112,8 +112,7 @@ uno::Sequence< OUString > SAL_CALL SequenceInputStreamService::getSupportedServi uno::Sequence< OUString > SAL_CALL SequenceInputStreamService::getSupportedServiceNames_static() { - uno::Sequence< OUString > s( 1 ); - s[0] = "com.sun.star.io.SequenceInputStream"; + uno::Sequence<OUString> s { "com.sun.star.io.SequenceInputStream" }; return s; } diff --git a/comphelper/source/streaming/seqoutputstreamserv.cxx b/comphelper/source/streaming/seqoutputstreamserv.cxx index 65f2fa75b891..7340b5808f32 100644 --- a/comphelper/source/streaming/seqoutputstreamserv.cxx +++ b/comphelper/source/streaming/seqoutputstreamserv.cxx @@ -99,8 +99,7 @@ uno::Sequence< OUString > SAL_CALL SequenceOutputStreamService::getSupportedServ uno::Sequence< OUString > SAL_CALL SequenceOutputStreamService::getSupportedServiceNames_static() { - uno::Sequence< OUString > s( 1 ); - s[0] = "com.sun.star.io.SequenceOutputStream"; + uno::Sequence<OUString> s { "com.sun.star.io.SequenceOutputStream" }; return s; } |