From 25aec383f95fded43b3fe5fc588b4ebdc6d7d272 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 15 Nov 2015 12:22:28 +0200 Subject: use initialiser for Sequence 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 \1 { \2 };/g" Change-Id: I20ad0489da887a9712982531c3b127339bb8b3b9 Reviewed-on: https://gerrit.libreoffice.org/19969 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmloff/source/draw/ximpshap.cxx | 3 +-- xmloff/source/forms/elementimport.cxx | 3 +-- xmloff/source/text/XMLAutoTextEventExport.cxx | 6 ++---- xmloff/source/text/XMLAutoTextEventImport.cxx | 3 +-- 4 files changed, 5 insertions(+), 10 deletions(-) (limited to 'xmloff') diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index dee62a3312e0..bad7295224b5 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -521,8 +521,7 @@ void SdXMLShapeContext::AddShape(OUString const & serviceName) } catch(const uno::Exception& e) { - uno::Sequence aSeq( 1 ); - aSeq[0] = serviceName; + uno::Sequence aSeq { serviceName }; GetImport().SetError( XMLERROR_FLAG_ERROR | XMLERROR_API, aSeq, e.Message, nullptr ); } diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx index f3a40fa7dad8..1ecf02e38706 100644 --- a/xmloff/source/forms/elementimport.cxx +++ b/xmloff/source/forms/elementimport.cxx @@ -1661,8 +1661,7 @@ namespace xmloff // a listbox which has a list-source attribute must have a list-source-type of something // not equal to ValueList. // In this case, the list-source value is simply the one and only element of the ListSource property. - Sequence< OUString > aListSourcePropValue( 1 ); - aListSourcePropValue[0] = _rValue; + Sequence aListSourcePropValue { _rValue }; aListSource.Value <<= aListSourcePropValue; } diff --git a/xmloff/source/text/XMLAutoTextEventExport.cxx b/xmloff/source/text/XMLAutoTextEventExport.cxx index 1497327d0d80..69c793650e56 100644 --- a/xmloff/source/text/XMLAutoTextEventExport.cxx +++ b/xmloff/source/text/XMLAutoTextEventExport.cxx @@ -212,8 +212,7 @@ void XMLAutoTextEventExport::_ExportContent() {} Sequence< OUString > SAL_CALL XMLAutoTextEventExport_getSupportedServiceNames() throw() { - Sequence< OUString > aSeq( 1 ); - aSeq[0] = XMLAutoTextEventExport_getImplementationName(); + Sequence aSeq { XMLAutoTextEventExport_getImplementationName() }; return aSeq; } @@ -234,8 +233,7 @@ Reference< XInterface > SAL_CALL XMLAutoTextEventExport_createInstance( Sequence< OUString > SAL_CALL XMLAutoTextEventExportOOO_getSupportedServiceNames() throw() { - Sequence< OUString > aSeq( 1 ); - aSeq[0] = XMLAutoTextEventExportOOO_getImplementationName(); + Sequence aSeq { XMLAutoTextEventExportOOO_getImplementationName() }; return aSeq; } diff --git a/xmloff/source/text/XMLAutoTextEventImport.cxx b/xmloff/source/text/XMLAutoTextEventImport.cxx index 340b03ae5ef7..2f84a86708d4 100644 --- a/xmloff/source/text/XMLAutoTextEventImport.cxx +++ b/xmloff/source/text/XMLAutoTextEventImport.cxx @@ -108,8 +108,7 @@ Sequence< OUString > SAL_CALL XMLAutoTextEventImport_getSupportedServiceNames() throw() { - Sequence< OUString > aSeq( 1 ); - aSeq[0] = XMLAutoTextEventImport_getImplementationName(); + Sequence aSeq { XMLAutoTextEventImport_getImplementationName() }; return aSeq; } -- cgit