diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-11-15 13:17:00 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-11-15 12:20:39 +0000 |
commit | 96c26b0d9d10fa9bac3695222980d7145f0342d7 (patch) | |
tree | d2d2b4e60e8ec98ff4025abfad42be06d29b3c13 /sw | |
parent | 25aec383f95fded43b3fe5fc588b4ebdc6d7d272 (diff) |
use initialiser for Sequence<OUString>
using variations of:
git grep -lP 'Sequence.*OUString.*\(\s*1\s*\)' | xargs perl -0777 -pi -e "s/Sequence<OUString> (\w+)\(1\)\;
\s*OUString\* pArray.*;
.*\[0\]\s*=\s*(\S+)\;/Sequence<OUString> \1 { \2 };/g"
Change-Id: I03c64334ff30ee14dce0d17b67f5122a3893bbe3
Reviewed-on: https://gerrit.libreoffice.org/19971
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unocoll.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj2.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoparagraph.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoport.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unosett.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uno/unoatxt.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 4 |
13 files changed, 27 insertions, 81 deletions
diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index acc29c675099..107a1f1622c1 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1306,9 +1306,7 @@ sal_Bool SwXTextFrames::supportsService(const OUString& rServiceName) throw( Run Sequence< OUString > SwXTextFrames::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextFrames"; + Sequence<OUString> aRet { "com.sun.star.text.TextFrames" }; return aRet; } @@ -1333,9 +1331,7 @@ sal_Bool SwXTextGraphicObjects::supportsService(const OUString& rServiceName) th Sequence< OUString > SwXTextGraphicObjects::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextGraphicObjects"; + Sequence<OUString> aRet { "com.sun.star.text.TextGraphicObjects" }; return aRet; } @@ -1360,9 +1356,7 @@ sal_Bool SwXTextEmbeddedObjects::supportsService(const OUString& rServiceName) t Sequence< OUString > SwXTextEmbeddedObjects::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextEmbeddedObjects"; + Sequence<OUString> aRet { "com.sun.star.text.TextEmbeddedObjects" }; return aRet; } @@ -1387,9 +1381,7 @@ sal_Bool SwXTextSections::supportsService(const OUString& rServiceName) throw( R Sequence< OUString > SwXTextSections::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextSections"; + Sequence<OUString> aRet { "com.sun.star.text.TextSections" }; return aRet; } @@ -1782,9 +1774,7 @@ sal_Bool SwXFootnotes::supportsService(const OUString& rServiceName) throw( Runt Sequence< OUString > SwXFootnotes::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.Footnotes"; + Sequence<OUString> aRet { "com.sun.star.text.Footnotes" }; return aRet; } @@ -1882,9 +1872,7 @@ sal_Bool SwXReferenceMarks::supportsService(const OUString& rServiceName) throw( Sequence< OUString > SwXReferenceMarks::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.ReferenceMarks"; + Sequence<OUString> aRet { "com.sun.star.text.ReferenceMarks" }; return aRet; } diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index c2e8b5fe6726..11ce3dcead4d 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -458,9 +458,7 @@ sal_Bool SwXDrawPage::supportsService(const OUString& rServiceName) throw( uno:: uno::Sequence< OUString > SwXDrawPage::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.drawing.GenericDrawPage"; + uno::Sequence<OUString> aRet { "com.sun.star.drawing.GenericDrawPage" }; return aRet; } diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 258b4f1de1f1..cbf3d98d84b3 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2680,9 +2680,7 @@ sal_Bool SwXTextFieldMasters::supportsService(const OUString& rServiceName) thro uno::Sequence< OUString > SwXTextFieldMasters::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextFieldMasters"; + uno::Sequence<OUString> aRet { "com.sun.star.text.TextFieldMasters" }; return aRet; } @@ -2891,9 +2889,7 @@ sal_Bool SwXTextFieldTypes::supportsService(const OUString& rServiceName) throw( uno::Sequence< OUString > SwXTextFieldTypes::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextFields"; + uno::Sequence<OUString> aRet { "com.sun.star.text.TextFields" }; return aRet; } @@ -3004,9 +3000,7 @@ throw (uno::RuntimeException, std::exception) uno::Sequence< OUString > SAL_CALL SwXFieldEnumeration::getSupportedServiceNames() throw (uno::RuntimeException, std::exception) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.FieldEnumeration"; + uno::Sequence<OUString> aRet { "com.sun.star.text.FieldEnumeration" }; return aRet; } diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 76f85dc3d56a..24447de5ba87 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -2992,9 +2992,7 @@ sal_Bool SAL_CALL SwXTextCursor::hasElements() throw (uno::RuntimeException, std uno::Sequence< OUString > SAL_CALL SwXTextCursor::getAvailableServiceNames() throw (uno::RuntimeException, std::exception) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextContent"; + uno::Sequence<OUString> aRet { "com.sun.star.text.TextContent" }; return aRet; } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index a80c428477e0..5e35fa3e43c2 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1299,9 +1299,7 @@ sal_Bool SAL_CALL SwXTextRange::hasElements() throw (uno::RuntimeException, std: uno::Sequence< OUString > SAL_CALL SwXTextRange::getAvailableServiceNames() throw (uno::RuntimeException, std::exception) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextContent"; + uno::Sequence<OUString> aRet { "com.sun.star.text.TextContent" }; return aRet; } diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 6845a9a508be..c76943b61eb2 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -1442,9 +1442,7 @@ throw (uno::RuntimeException, std::exception) uno::Sequence< OUString > SAL_CALL SwXParagraph::getAvailableServiceNames() throw (uno::RuntimeException, std::exception) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextContent"; + uno::Sequence<OUString> aRet { "com.sun.star.text.TextContent" }; return aRet; } diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 6e1de3db7667..8af520380d4a 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -855,9 +855,7 @@ uno::Sequence< OUString > SwXTextPortion::getAvailableServiceNames() throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextContent"; + uno::Sequence<OUString> aRet { "com.sun.star.text.TextContent" }; return aRet; } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 890f4d50af80..cd6d41354dea 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -350,9 +350,7 @@ throw( RuntimeException, std::exception ) Sequence< OUString > SwXTextPortionEnumeration::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextPortionEnumeration"; + Sequence<OUString> aRet { "com.sun.star.text.TextPortionEnumeration" }; return aRet; } diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 903e47074ae3..e34c0d259635 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -269,9 +269,7 @@ sal_Bool SwXFootnoteProperties::supportsService(const OUString& rServiceName) th Sequence< OUString > SwXFootnoteProperties::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.FootnoteSettings"; + Sequence<OUString> aRet { "com.sun.star.text.FootnoteSettings" }; return aRet; } @@ -573,9 +571,7 @@ sal_Bool SwXEndnoteProperties::supportsService(const OUString& rServiceName) thr Sequence< OUString > SwXEndnoteProperties::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.FootnoteSettings"; + Sequence<OUString> aRet { "com.sun.star.text.FootnoteSettings" }; return aRet; } @@ -799,9 +795,7 @@ sal_Bool SwXLineNumberingProperties::supportsService(const OUString& rServiceNam Sequence< OUString > SwXLineNumberingProperties::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.LineNumberingProperties"; + Sequence<OUString> aRet { "com.sun.star.text.LineNumberingProperties" }; return aRet; } @@ -1095,9 +1089,7 @@ sal_Bool SwXNumberingRules::supportsService(const OUString& rServiceName) throw( Sequence< OUString > SwXNumberingRules::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.NumberingRules"; + Sequence<OUString> aRet { "com.sun.star.text.NumberingRules" }; return aRet; } @@ -2309,9 +2301,7 @@ sal_Bool SwXTextColumns::supportsService(const OUString& rServiceName) throw( Ru Sequence< OUString > SwXTextColumns::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.TextColumns"; + Sequence<OUString> aRet { "com.sun.star.text.TextColumns" }; return aRet; } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 16dfb092a078..7b284c339b51 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -158,9 +158,7 @@ sal_Bool SwXStyleFamilies::supportsService(const OUString& rServiceName) throw( uno::Sequence< OUString > SwXStyleFamilies::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.style.StyleFamilies"; + uno::Sequence<OUString> aRet { "com.sun.star.style.StyleFamilies" }; return aRet; } @@ -391,9 +389,7 @@ sal_Bool SwXStyleFamily::supportsService(const OUString& rServiceName) throw( un uno::Sequence< OUString > SwXStyleFamily::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.style.StyleFamily"; + uno::Sequence<OUString> aRet { "com.sun.star.style.StyleFamily" }; return aRet; } diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index ddba7056014b..e9d2fe53dc86 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -691,9 +691,7 @@ sal_Bool SwXAutoTextGroup::supportsService(const OUString& rServiceName) throw( uno::Sequence< OUString > SwXAutoTextGroup::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.AutoTextGroup"; + uno::Sequence<OUString> aRet { "com.sun.star.text.AutoTextGroup" }; return aRet; } @@ -974,9 +972,7 @@ sal_Bool SwXAutoTextEntry::supportsService(const OUString& rServiceName) throw( uno::Sequence< OUString > SwXAutoTextEntry::getSupportedServiceNames() throw( uno::RuntimeException, std::exception ) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.AutoTextEntry"; + uno::Sequence<OUString> aRet { "com.sun.star.text.AutoTextEntry" }; return aRet; } diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 31114c711d52..33281bab84e3 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -533,9 +533,7 @@ sal_Bool SwXPrintSettings::supportsService(const OUString& rServiceName) throw( Sequence< OUString > SwXPrintSettings::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.PrintSettings"; + Sequence<OUString> aRet { "com.sun.star.text.PrintSettings" }; return aRet; } @@ -997,9 +995,7 @@ sal_Bool SwXViewSettings::supportsService(const OUString& rServiceName) throw( R Sequence< OUString > SwXViewSettings::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.text.ViewSettings"; + Sequence<OUString> aRet { "com.sun.star.text.ViewSettings" }; return aRet; } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 094e374d0e16..546d3c40e0e5 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -4136,9 +4136,7 @@ sal_Bool SwXOutlineTarget::supportsService(const OUString& ServiceName) throw( R Sequence< OUString > SwXOutlineTarget::getSupportedServiceNames() throw( RuntimeException, std::exception ) { - Sequence < OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = "com.sun.star.document.LinkTarget"; + Sequence<OUString> aRet { "com.sun.star.document.LinkTarget" }; return aRet; } |