diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-11-15 12:17:19 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-15 11:31:23 +0000 |
commit | 54d22957bc241fc5867fa1c720cf1266133e4e90 (patch) | |
tree | a94c9008ccbe953226a479a875e01119d77d9402 /xmloff | |
parent | 8e234c5b7d5bae66c544e581bee5770f3f83dd81 (diff) |
use initialiser for Sequence<OUString>
performed using:
git grep -lP 'Sequence.*OUString.*\(1\)'
| xargs perl -0777 -pi -e
"s/Sequence<OUString> (\w+)\(1\);
.*\[0\] = (\S+);/Sequence<OUString> \1 { \2 };/g"
Change-Id: I4da56c80fa09bfc1e8f868794001e9921431e09f
Reviewed-on: https://gerrit.libreoffice.org/19968
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/core/DomBuilderContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/draw/XMLShapeStyleContext.cxx | 3 | ||||
-rw-r--r-- | xmloff/source/style/xmlimppr.cxx | 15 | ||||
-rw-r--r-- | xmloff/source/text/XMLIndexTOCContext.cxx | 3 |
5 files changed, 13 insertions, 26 deletions
diff --git a/xmloff/source/core/DomBuilderContext.cxx b/xmloff/source/core/DomBuilderContext.cxx index 75131e6c12a4..2aa6935027aa 100644 --- a/xmloff/source/core/DomBuilderContext.cxx +++ b/xmloff/source/core/DomBuilderContext.cxx @@ -219,8 +219,7 @@ static Reference<XNode> lcl_createElement( SvXMLImport& rImport, // both cases are illegal; raise warning (and use only local name) xElement = xDocument->createElement( rLocalName ); { - Sequence<OUString> aSeq(1); - aSeq[0] = rLocalName; + Sequence<OUString> aSeq { rLocalName }; rImport.SetError( XMLERROR_FLAG_WARNING | XMLERROR_NAMESPACE_TROUBLE, aSeq ); } diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index a2b8ee1b40de..877afda091e2 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2255,14 +2255,12 @@ void SvXMLExport::StartElement(const OUString& rName, } catch (const SAXInvalidCharacterException& e) { - Sequence<OUString> aPars(1); - aPars[0] = rName; + Sequence<OUString> aPars { rName }; SetError( XMLERROR_SAX|XMLERROR_FLAG_WARNING, aPars, e.Message, nullptr ); } catch (const SAXException& e) { - Sequence<OUString> aPars(1); - aPars[0] = rName; + Sequence<OUString> aPars { rName }; SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE, aPars, e.Message, nullptr ); } @@ -2281,14 +2279,12 @@ void SvXMLExport::Characters(const OUString& rChars) } catch (const SAXInvalidCharacterException& e) { - Sequence<OUString> aPars(1); - aPars[0] = rChars; + Sequence<OUString> aPars { rChars }; SetError( XMLERROR_SAX|XMLERROR_FLAG_WARNING, aPars, e.Message, nullptr ); } catch (const SAXException& e) { - Sequence<OUString> aPars(1); - aPars[0] = rChars; + Sequence<OUString> aPars { rChars }; SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE, aPars, e.Message, nullptr ); } @@ -2328,8 +2324,7 @@ void SvXMLExport::EndElement(const OUString& rName, } catch (const SAXException& e) { - Sequence<OUString> aPars(1); - aPars[0] = rName; + Sequence<OUString> aPars { rName }; SetError( XMLERROR_SAX|XMLERROR_FLAG_ERROR|XMLERROR_FLAG_SEVERE, aPars, e.Message, nullptr ); } diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx index f7e97373a66e..2a80b436737a 100644 --- a/xmloff/source/draw/XMLShapeStyleContext.cxx +++ b/xmloff/source/draw/XMLShapeStyleContext.cxx @@ -264,8 +264,7 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet } catch ( const ::com::sun::star::lang::IllegalArgumentException& e ) { - Sequence<OUString> aSeq(1); - aSeq[0] = sStyleName; + Sequence<OUString> aSeq { sStyleName }; GetImport().SetError( XMLERROR_STYLE_PROP_VALUE | XMLERROR_FLAG_WARNING, aSeq, e.Message, nullptr ); diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index 5bb140a976bf..3dc9de47a54b 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -492,8 +492,7 @@ bool SvXMLImportPropertyMapper::_FillPropertySet( // allowed to throw this exception if ( 0 == ( nPropFlags & MID_FLAG_PROPERTY_MAY_THROW ) ) { - Sequence<OUString> aSeq(1); - aSeq[0] = rPropName; + Sequence<OUString> aSeq { rPropName }; rImport.SetError( XMLERROR_STYLE_PROP_VALUE | XMLERROR_FLAG_ERROR, aSeq, e.Message, nullptr ); @@ -502,8 +501,7 @@ bool SvXMLImportPropertyMapper::_FillPropertySet( catch ( const UnknownPropertyException& e ) { // unknown property: This is always an error! - Sequence<OUString> aSeq(1); - aSeq[0] = rPropName; + Sequence<OUString> aSeq { rPropName }; rImport.SetError( XMLERROR_STYLE_PROP_UNKNOWN | XMLERROR_FLAG_ERROR, aSeq, e.Message, nullptr ); @@ -511,8 +509,7 @@ bool SvXMLImportPropertyMapper::_FillPropertySet( catch ( const PropertyVetoException& e ) { // property veto: this shouldn't happen - Sequence<OUString> aSeq(1); - aSeq[0] = rPropName; + Sequence<OUString> aSeq { rPropName }; rImport.SetError( XMLERROR_STYLE_PROP_OTHER | XMLERROR_FLAG_ERROR, aSeq, e.Message, nullptr ); @@ -520,8 +517,7 @@ bool SvXMLImportPropertyMapper::_FillPropertySet( catch ( const WrappedTargetException& e ) { // wrapped target: this shouldn't happen either - Sequence<OUString> aSeq(1); - aSeq[0] = rPropName; + Sequence<OUString> aSeq { rPropName }; rImport.SetError( XMLERROR_STYLE_PROP_OTHER | XMLERROR_FLAG_ERROR, aSeq, e.Message, nullptr ); @@ -709,8 +705,7 @@ bool SvXMLImportPropertyMapper::_FillTolerantMultiPropertySet( sal_Int32 nCount(aResults.getLength()); for( sal_Int32 i = 0; i < nCount; ++i) { - Sequence<OUString> aSeq(1); - aSeq[0] = aResults[i].Name; + Sequence<OUString> aSeq { aResults[i].Name }; OUString sMessage; switch (aResults[i].Result) { diff --git a/xmloff/source/text/XMLIndexTOCContext.cxx b/xmloff/source/text/XMLIndexTOCContext.cxx index bdadb2d28155..c51bf801ac5f 100644 --- a/xmloff/source/text/XMLIndexTOCContext.cxx +++ b/xmloff/source/text/XMLIndexTOCContext.cxx @@ -212,8 +212,7 @@ void XMLIndexTOCContext::StartElement( catch(const IllegalArgumentException& e) { // illegal argument? Then we can't accept indices here! - Sequence<OUString> aSeq(1); - aSeq[0] = GetLocalName(); + Sequence<OUString> aSeq { GetLocalName() }; GetImport().SetError( XMLERROR_FLAG_ERROR | XMLERROR_NO_INDEX_ALLOWED_HERE, aSeq, e.Message, nullptr ); |