summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2015-11-15 12:17:19 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-15 11:31:23 +0000
commit54d22957bc241fc5867fa1c720cf1266133e4e90 (patch)
treea94c9008ccbe953226a479a875e01119d77d9402 /sw
parent8e234c5b7d5bae66c544e581bee5770f3f83dd81 (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 'sw')
-rw-r--r--sw/qa/extras/odfexport/odfexport.cxx3
-rw-r--r--sw/source/core/unocore/unoparagraph.cxx6
-rw-r--r--sw/source/ui/dbui/addresslistdialog.cxx3
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx3
-rw-r--r--sw/source/uibase/envelp/labelcfg.cxx3
5 files changed, 6 insertions, 12 deletions
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index cb91303a6ea7..addf9c5c0ba2 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -364,8 +364,7 @@ DECLARE_ODFEXPORT_TEST(testFdo79358, "fdo79358.odt")
uno::Reference<container::XIndexReplace> xLevels(
getProperty< uno::Reference<container::XIndexReplace> >(xTOCProps,
"LevelParagraphStyles"));
- uno::Sequence<OUString> seq(1);
- seq[0] = "Heading";
+ uno::Sequence<OUString> seq { "Heading" };
CPPUNIT_ASSERT_EQUAL(uno::makeAny(seq), xLevels->getByIndex(1));
CPPUNIT_ASSERT_EQUAL(uno::makeAny(uno::Sequence<OUString>()), xLevels->getByIndex(2));
}
diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx
index 91e8cf1b6838..6845a9a508be 100644
--- a/sw/source/core/unocore/unoparagraph.cxx
+++ b/sw/source/core/unocore/unoparagraph.cxx
@@ -368,8 +368,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- uno::Sequence<OUString> aPropertyNames(1);
- aPropertyNames.getArray()[0] = rPropertyName;
+ uno::Sequence<OUString> aPropertyNames { rPropertyName };
uno::Sequence<uno::Any> aValues(1);
aValues.getArray()[0] = rValue;
m_pImpl->SetPropertyValues_Impl( aPropertyNames, aValues );
@@ -381,8 +380,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException,
uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
- uno::Sequence<OUString> aPropertyNames(1);
- aPropertyNames.getArray()[0] = rPropertyName;
+ uno::Sequence<OUString> aPropertyNames { rPropertyName };
const uno::Sequence< uno::Any > aRet =
m_pImpl->GetPropertyValues_Impl(aPropertyNames);
return aRet.getConstArray()[0];
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 4a878f2dae79..b4d4cb537b1e 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -389,8 +389,7 @@ IMPL_LINK_TYPED(SwAddressListDialog, CreateHdl_Impl, Button*, pButton, void)
Any aAny(&sDBURL, cppu::UnoType<decltype(sDBURL)>::get());
xDataProperties->setPropertyValue("URL", aAny);
//set the filter to the file name without extension
- uno::Sequence<OUString> aFilters(1);
- aFilters[0] = sNewName;
+ uno::Sequence<OUString> aFilters { sNewName };
aAny <<= aFilters;
xDataProperties->setPropertyValue("TableFilter", aAny);
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 866c799bddee..af571d1e1f6d 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -1540,8 +1540,7 @@ void SwInsertDBColAutoPilot::ImplCommit()
pSourceProps[1] >>= sCommand;
if(sSource==aDBData.sDataSource && sCommand==aDBData.sCommand)
{
- Sequence<OUString> aElements(1);
- aElements.getArray()[0] = pNames[nNode];
+ Sequence<OUString> aElements { pNames[nNode] };
ClearNodeElements(OUString(), aElements);
}
}
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx
index bfa2220b407e..21bfbf52c16e 100644
--- a/sw/source/uibase/envelp/labelcfg.cxx
+++ b/sw/source/uibase/envelp/labelcfg.cxx
@@ -323,8 +323,7 @@ void SwLabelConfig::SaveLabel( const OUString& rManufacturer,
sPrefix += "/";
sPrefix += pLabels[nLabel];
sPrefix += "/";
- Sequence<OUString> aProperties(1);
- aProperties.getArray()[0] = sPrefix;
+ Sequence<OUString> aProperties { sPrefix };
aProperties.getArray()[0] += "Name";
Sequence<Any> aValues = GetProperties( aProperties );
const Any* pValues = aValues.getConstArray();