summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connectivity/source/commontools/parameters.cxx6
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx3
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx3
-rw-r--r--connectivity/source/drivers/file/FCatalog.cxx3
-rw-r--r--connectivity/source/drivers/flat/EResultSet.cxx3
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx3
-rw-r--r--connectivity/source/drivers/hsqldb/HCatalog.cxx3
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx3
-rw-r--r--connectivity/source/drivers/mysql/YCatalog.cxx3
-rw-r--r--connectivity/source/drivers/mysql/YDriver.cxx3
-rw-r--r--connectivity/source/sdbcx/VCollection.cxx3
-rw-r--r--cppuhelper/source/tdmgr.cxx4
-rw-r--r--dbaccess/source/core/api/View.cxx3
-rw-r--r--dbaccess/source/core/api/table.cxx3
-rw-r--r--dbaccess/source/ui/browser/formadapter.cxx3
-rw-r--r--dbaccess/source/ui/dlg/adtabdlg.cxx3
-rw-r--r--dbaccess/source/ui/querydesign/TableWindowAccess.cxx3
-rw-r--r--extensions/source/propctrlr/formlinkdialog.cxx6
-rw-r--r--formula/source/core/api/FormulaCompiler.cxx3
-rw-r--r--i18npool/source/collator/gencoll_rule.cxx4
-rw-r--r--include/comphelper/sequence.hxx2
-rw-r--r--reportdesign/source/core/api/Section.cxx3
-rw-r--r--reportdesign/source/ui/inspection/DataProviderHandler.cxx2
-rw-r--r--reportdesign/source/ui/inspection/ReportComponentHandler.cxx2
-rw-r--r--reportdesign/source/ui/misc/FunctionHelper.cxx3
-rw-r--r--reportdesign/source/ui/report/propbrw.cxx3
-rw-r--r--stoc/source/security/permissions.cxx3
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx3
-rw-r--r--stoc/source/simpleregistry/simpleregistry.cxx9
-rw-r--r--unotools/source/config/eventcfg.cxx3
-rw-r--r--xmloff/source/forms/elementimport.cxx3
31 files changed, 37 insertions, 67 deletions
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index 4bc8b46bef7c..25c7da56dce8 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -324,10 +324,8 @@ namespace dbtools
if ( bNeedExchangeLinks )
{
- OUString *pFields = aStrippedMasterFields.empty() ? 0 : &aStrippedMasterFields[0];
- m_aMasterFields = Sequence< OUString >( pFields, aStrippedMasterFields.size() );
- pFields = aStrippedDetailFields.empty() ? 0 : &aStrippedDetailFields[0];
- m_aDetailFields = Sequence< OUString >( pFields, aStrippedDetailFields.size() );
+ m_aMasterFields = Sequence< OUString >( aStrippedMasterFields.data(), aStrippedMasterFields.size() );
+ m_aDetailFields = Sequence< OUString >( aStrippedDetailFields.data(), aStrippedDetailFields.size() );
}
}
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index fbf7e9400653..b7a4b29ef7fe 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -666,8 +666,7 @@ Sequence< Type > SAL_CALL OCalcTable::getTypes( ) throw(RuntimeException, std::
}
aOwnTypes.push_back(cppu::UnoType<com::sun::star::lang::XUnoTunnel>::get());
- const Type* pAttrs = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pAttrs, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 750be4f7f98d..8df0a2bd9d63 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -740,8 +740,7 @@ Sequence< Type > SAL_CALL ODbaseTable::getTypes( ) throw(RuntimeException, std:
}
}
aOwnTypes.push_back(cppu::UnoType<com::sun::star::lang::XUnoTunnel>::get());
- Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
diff --git a/connectivity/source/drivers/file/FCatalog.cxx b/connectivity/source/drivers/file/FCatalog.cxx
index 079f53b84fc6..24cc23086efd 100644
--- a/connectivity/source/drivers/file/FCatalog.cxx
+++ b/connectivity/source/drivers/file/FCatalog.cxx
@@ -96,8 +96,7 @@ Sequence< Type > SAL_CALL OFileCatalog::getTypes( ) throw(RuntimeException, std
aOwnTypes.push_back(*pBegin);
}
}
- const Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx
index a9a8bc54130e..84a3a078fe1f 100644
--- a/connectivity/source/drivers/flat/EResultSet.cxx
+++ b/connectivity/source/drivers/flat/EResultSet.cxx
@@ -88,8 +88,7 @@ Sequence< Type > SAL_CALL OFlatResultSet::getTypes( ) throw( RuntimeException,
aOwnTypes.push_back(*pBegin);
}
}
- Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- Sequence< Type > aRet(pTypes, aOwnTypes.size());
+ Sequence< Type > aRet(aOwnTypes.data(), aOwnTypes.size());
return ::comphelper::concatSequences(aRet,OFlatResultSet_BASE::getTypes());
}
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index df816fbc5fb3..b1335b91aa9c 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -539,8 +539,7 @@ Sequence< Type > SAL_CALL OFlatTable::getTypes( ) throw(RuntimeException, std::
aOwnTypes.push_back(*pBegin);
}
}
- Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
diff --git a/connectivity/source/drivers/hsqldb/HCatalog.cxx b/connectivity/source/drivers/hsqldb/HCatalog.cxx
index 975192d1406c..09e55a238e4a 100644
--- a/connectivity/source/drivers/hsqldb/HCatalog.cxx
+++ b/connectivity/source/drivers/hsqldb/HCatalog.cxx
@@ -147,8 +147,7 @@ Sequence< Type > SAL_CALL OHCatalog::getTypes( ) throw(RuntimeException, std::e
aOwnTypes.push_back(*pBegin);
}
}
- const Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index 31923db3579a..dc6a71146df9 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -356,8 +356,7 @@ Sequence< Type > SAL_CALL OHSQLTable::getTypes( ) throw(RuntimeException, std::
aOwnTypes.push_back(*pIter);
}
}
- Type *pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
return OTableHelper::getTypes();
}
diff --git a/connectivity/source/drivers/mysql/YCatalog.cxx b/connectivity/source/drivers/mysql/YCatalog.cxx
index cb071e05b4f5..78016434d66d 100644
--- a/connectivity/source/drivers/mysql/YCatalog.cxx
+++ b/connectivity/source/drivers/mysql/YCatalog.cxx
@@ -140,8 +140,7 @@ Sequence< Type > SAL_CALL OMySQLCatalog::getTypes( ) throw(RuntimeException, st
aOwnTypes.push_back(*pBegin);
}
}
- const Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
diff --git a/connectivity/source/drivers/mysql/YDriver.cxx b/connectivity/source/drivers/mysql/YDriver.cxx
index aa776a4234c9..63507adcab5a 100644
--- a/connectivity/source/drivers/mysql/YDriver.cxx
+++ b/connectivity/source/drivers/mysql/YDriver.cxx
@@ -218,8 +218,7 @@ namespace connectivity
,0
,makeAny(sal_True)
,PropertyState_DIRECT_VALUE) );
- PropertyValue* pProps = aProps.empty() ? 0 : &aProps[0];
- return Sequence< PropertyValue >(pProps, aProps.size());
+ return Sequence< PropertyValue >(aProps.data(), aProps.size());
}
}
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
index cc886dfd3584..c43cc185d92d 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -279,8 +279,7 @@ Sequence< Type > SAL_CALL OCollection::getTypes() throw (RuntimeException, std::
if ( *pBegin != aType )
aOwnTypes.push_back(*pBegin);
}
- Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes,aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
return OCollectionBase::getTypes( );
}
diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx
index abd2865dc722..4a454e616324 100644
--- a/cppuhelper/source/tdmgr.cxx
+++ b/cppuhelper/source/tdmgr.cxx
@@ -230,8 +230,8 @@ inline static typelib_TypeDescription * createCTD(
(typelib_TypeClass)xType->getTypeClass(),
aMemberTypeName.pData, // type name
xAttribute->isReadOnly(),
- getExc.size(), getExc.empty() ? 0 : &getExc[0],
- setExc.size(), setExc.empty() ? 0 : &setExc[0] );
+ getExc.size(), getExc.data(),
+ setExc.size(), setExc.data() );
}
return pRet;
}
diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx
index 547eab3cd8bd..cc8e77e05c20 100644
--- a/dbaccess/source/core/api/View.cxx
+++ b/dbaccess/source/core/api/View.cxx
@@ -107,8 +107,7 @@ namespace dbaccess
aOwnTypes.push_back(*pIter);
}
- Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
void SAL_CALL View::alterCommand( const OUString& _rNewCommand ) throw (SQLException, RuntimeException, std::exception)
diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx
index 07c40771fd42..6c2ac8e039ab 100644
--- a/dbaccess/source/core/api/table.cxx
+++ b/dbaccess/source/core/api/table.cxx
@@ -276,8 +276,7 @@ Sequence< Type > SAL_CALL ODBTable::getTypes( ) throw(RuntimeException, std::ex
aOwnTypes.push_back(*pIter);
}
- Type* pTypes = aOwnTypes.empty() ? 0 : &aOwnTypes[0];
- return Sequence< Type >(pTypes, aOwnTypes.size());
+ return Sequence< Type >(aOwnTypes.data(), aOwnTypes.size());
}
// XRename,
diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx
index 87d5e2fde797..0600bd3afb3e 100644
--- a/dbaccess/source/ui/browser/formadapter.cxx
+++ b/dbaccess/source/ui/browser/formadapter.cxx
@@ -1479,8 +1479,7 @@ Any SAL_CALL SbaXFormAdapter::getByName(const OUString& aName) throw( ::com::sun
Sequence< OUString > SAL_CALL SbaXFormAdapter::getElementNames() throw( RuntimeException, std::exception )
{
- OUString *pChildNames = m_aChildNames.empty() ? 0 : &m_aChildNames[0];
- return Sequence< OUString >(pChildNames, m_aChildNames.size());
+ return Sequence< OUString >(m_aChildNames.data(), m_aChildNames.size());
}
sal_Bool SAL_CALL SbaXFormAdapter::hasByName(const OUString& aName) throw( RuntimeException, std::exception )
diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx
index a6ca7ae16bd9..5e4cb63aa6f0 100644
--- a/dbaccess/source/ui/dlg/adtabdlg.cxx
+++ b/dbaccess/source/ui/dlg/adtabdlg.cxx
@@ -191,8 +191,7 @@ void TableListFacade::updateTableObjectList( bool _bAllowViews )
::comphelper::UStringMixEqual aEqualFunctor;
for(;pViewBegin != pViewEnd;++pViewBegin)
aTables.erase(::std::remove_if(aTables.begin(),aTables.end(),::std::bind2nd(aEqualFunctor,*pViewBegin)),aTables.end());
- OUString* pTables = aTables.empty() ? 0 : &aTables[0];
- sTables = Sequence< OUString>(pTables, aTables.size());
+ sTables = Sequence< OUString>(aTables.data(), aTables.size());
sViews = Sequence< OUString>();
}
diff --git a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
index f4ed8116345f..433e008e6e68 100644
--- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
+++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx
@@ -224,8 +224,7 @@ namespace dbaui
aRelations.push_back(xInterface);
}
- Reference<XInterface> *pRelations = aRelations.empty() ? 0 : &aRelations[0];
- Sequence< Reference<XInterface> > aSeq(pRelations, aRelations.size());
+ Sequence< Reference<XInterface> > aSeq(aRelations.data(), aRelations.size());
return AccessibleRelation(AccessibleRelationType::CONTROLLER_FOR,aSeq);
}
return AccessibleRelation();
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx
index e421a5b2c4ce..c7fda6ba8361 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -224,10 +224,8 @@ namespace pcr
Reference< XPropertySet > xDetailFormProps( m_xDetailForm, UNO_QUERY );
if ( xDetailFormProps.is() )
{
- OUString *pFields = aDetailFields.empty() ? 0 : &aDetailFields[0];
- xDetailFormProps->setPropertyValue( PROPERTY_DETAILFIELDS, makeAny( Sequence< OUString >( pFields, aDetailFields.size() ) ) );
- pFields = aMasterFields.empty() ? 0 : &aMasterFields[0];
- xDetailFormProps->setPropertyValue( PROPERTY_MASTERFIELDS, makeAny( Sequence< OUString >( pFields, aMasterFields.size() ) ) );
+ xDetailFormProps->setPropertyValue( PROPERTY_DETAILFIELDS, makeAny( Sequence< OUString >( aDetailFields.data(), aDetailFields.size() ) ) );
+ xDetailFormProps->setPropertyValue( PROPERTY_MASTERFIELDS, makeAny( Sequence< OUString >( aMasterFields.data(), aMasterFields.size() ) ) );
}
}
catch( const Exception& )
diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx
index 01095876702c..acfdc09467be 100644
--- a/formula/source/core/api/FormulaCompiler.cxx
+++ b/formula/source/core/api/FormulaCompiler.cxx
@@ -502,8 +502,7 @@ uno::Sequence< sheet::FormulaOpCodeMapEntry > FormulaCompiler::OpCodeMap::create
}
}
}
- const FormulaOpCodeMapEntry* pRet = aVec.empty() ? 0 : &aVec[0];
- return uno::Sequence< FormulaOpCodeMapEntry >( pRet, aVec.size());
+ return uno::Sequence< FormulaOpCodeMapEntry >(aVec.data(), aVec.size());
}
diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx
index 827f8127c100..8f71b7e14abe 100644
--- a/i18npool/source/collator/gencoll_rule.cxx
+++ b/i18npool/source/collator/gencoll_rule.cxx
@@ -120,10 +120,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if (status == U_BUFFER_OVERFLOW_ERROR) {
data.resize(len);
status = U_ZERO_ERROR;
- len = coll->cloneBinary(data.empty() ? 0 : &data[0], len, status);
+ len = coll->cloneBinary(data.data(), len, status);
}
if (U_SUCCESS(status))
- data_write(argv[2], argv[3], data.empty() ? 0 : &data[0], len);
+ data_write(argv[2], argv[3], data.data(), len);
else {
printf("Could not get rule data from collator\n");
}
diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 06390b05fade..471358285fd2 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -270,7 +270,7 @@ namespace comphelper
::std::vector<T> const& v )
{
return ::com::sun::star::uno::Sequence<T>(
- v.empty() ? 0 : &v[0], static_cast<sal_Int32>(v.size()) );
+ v.data(), static_cast<sal_Int32>(v.size()) );
}
diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx
index 71993ad8d5f5..9f68bc34433a 100644
--- a/reportdesign/source/core/api/Section.cxx
+++ b/reportdesign/source/core/api/Section.cxx
@@ -475,8 +475,7 @@ uno::Sequence< OUString > SAL_CALL OSection::getAvailableReportComponentNames(
::osl::MutexGuard aGuard(m_aMutex);
const ::std::vector< OUString >& aRet = lcl_getControlModelMap();
- const OUString* pRet = aRet.empty() ? 0 : &aRet[0];
- return uno::Sequence< OUString >(pRet, aRet.size());
+ return uno::Sequence< OUString >(aRet.data(), aRet.size());
}
// XChild
diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
index 1e2e243cd156..06858703be1b 100644
--- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx
+++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx
@@ -382,7 +382,7 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope
aNewProps.push_back(aValue);
}
}
- return aNewProps.empty() ? uno::Sequence< beans::Property > () : uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size());
+ return uno::Sequence< beans::Property >(aNewProps.data(), aNewProps.size());
}
uno::Sequence< OUString > SAL_CALL DataProviderHandler::getSupersededProperties() throw (uno::RuntimeException, std::exception)
diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
index c1202855a0b9..5f802c15dda3 100644
--- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
+++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx
@@ -175,7 +175,7 @@ uno::Sequence< beans::Property > SAL_CALL ReportComponentHandler::getSupportedPr
::std::vector< beans::Property > aNewProps;
rptui::OPropertyInfoService::getExcludeProperties( aNewProps, m_xFormComponentHandler );
- return aNewProps.empty() ? uno::Sequence< beans::Property > () : uno::Sequence< beans::Property > (&(*aNewProps.begin()),aNewProps.size());
+ return uno::Sequence< beans::Property >(aNewProps.data(), aNewProps.size());
}
uno::Sequence< OUString > SAL_CALL ReportComponentHandler::getSupersededProperties() throw (uno::RuntimeException, std::exception)
diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx
index 3f7d430090a8..ca7b5a2e3e40 100644
--- a/reportdesign/source/ui/misc/FunctionHelper.cxx
+++ b/reportdesign/source/ui/misc/FunctionHelper.cxx
@@ -179,8 +179,7 @@ OUString FunctionDescription::getFormula(const ::std::vector< OUString >& _aArgu
OUString sFormula;
try
{
- const OUString *pArguments = _aArguments.empty() ? 0 : &_aArguments[0];
- sFormula = m_xFunctionDescription->createFormula(uno::Sequence< OUString >(pArguments, _aArguments.size()));
+ sFormula = m_xFunctionDescription->createFormula(uno::Sequence< OUString >(_aArguments.data(), _aArguments.size()));
}
catch(const uno::Exception&)
{
diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx
index 05a8311985f1..0e8f7b6492c1 100644
--- a/reportdesign/source/ui/report/propbrw.cxx
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -305,8 +305,7 @@ uno::Sequence< Reference<uno::XInterface> > PropBrw::CreateCompPropSet(const Sdr
pCurrent = pGroupIterator.get() && pGroupIterator->IsMore() ? pGroupIterator->Next() : NULL;
}
}
- Reference<uno::XInterface> *pSets = aSets.empty() ? NULL : &aSets[0];
- return uno::Sequence< Reference<uno::XInterface> >(pSets, aSets.size());
+ return uno::Sequence< Reference<uno::XInterface> >(aSets.data(), aSets.size());
}
void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> >& _aObjects )
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx
index 28b207abc093..85f8e02c503e 100644
--- a/stoc/source/security/permissions.cxx
+++ b/stoc/source/security/permissions.cxx
@@ -528,8 +528,7 @@ Sequence< OUString > PermissionCollection::toStrings() const
{
strings.push_back( perm->toString() );
}
- return Sequence< OUString >(
- strings.empty() ? 0 : &strings[ 0 ], strings.size() );
+ return Sequence< OUString >( strings.data(), strings.size() );
}
#endif
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 06bb75753203..cdf92db26d77 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -1092,8 +1092,7 @@ Sequence< Reference< XInterface > > OServiceManager::queryServiceFactories(
vec.push_back( p.first->second );
++p.first;
}
- ret = Sequence< Reference< XInterface > >(
- vec.empty() ? 0 : &vec[ 0 ], vec.size() );
+ ret = Sequence< Reference< XInterface > >( vec.data(), vec.size() );
}
return ret;
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index 3a038f371b37..12faa50b1838 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -419,8 +419,7 @@ void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue)
list.push_back(seqValue[i]);
}
RegError err = key_.setLongListValue(
- OUString(), list.empty() ? 0 : &list[0],
- static_cast< sal_uInt32 >(list.size()));
+ OUString(), list.data(), static_cast< sal_uInt32 >(list.size()));
if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException(
(("com.sun.star.registry.SimpleRegistry key setLongListValue:"
@@ -608,8 +607,7 @@ void Key::setAsciiListValue(
list2.push_back(const_cast< char * >(i->getStr()));
}
RegError err = key_.setStringListValue(
- OUString(), list2.empty() ? 0 : &list2[0],
- static_cast< sal_uInt32 >(list2.size()));
+ OUString(), list2.data(), static_cast< sal_uInt32 >(list2.size()));
if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException(
(("com.sun.star.registry.SimpleRegistry key"
@@ -745,8 +743,7 @@ void Key::setStringListValue(
list.push_back(const_cast< sal_Unicode * >(seqValue[i].getStr()));
}
RegError err = key_.setUnicodeListValue(
- OUString(), list.empty() ? 0 : &list[0],
- static_cast< sal_uInt32 >(list.size()));
+ OUString(), list.data(), static_cast< sal_uInt32 >(list.size()));
if (err != REG_NO_ERROR) {
throw css::registry::InvalidRegistryException(
(("com.sun.star.registry.SimpleRegistry key"
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index e98cb00ffb2c..eaae708a8619 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -274,8 +274,7 @@ Any SAL_CALL GlobalEventConfig_Impl::getByName( const OUString& aName ) throw (c
Sequence< OUString > SAL_CALL GlobalEventConfig_Impl::getElementNames( ) throw (RuntimeException)
{
- const OUString* pRet = m_supportedEvents.empty() ? NULL : &m_supportedEvents[0];
- return uno::Sequence< OUString >(pRet, m_supportedEvents.size());
+ return uno::Sequence< OUString >(m_supportedEvents.data(), m_supportedEvents.size());
}
bool SAL_CALL GlobalEventConfig_Impl::hasByName( const OUString& aName ) throw (RuntimeException)
diff --git a/xmloff/source/forms/elementimport.cxx b/xmloff/source/forms/elementimport.cxx
index 14b09e342e94..4f501778d77b 100644
--- a/xmloff/source/forms/elementimport.cxx
+++ b/xmloff/source/forms/elementimport.cxx
@@ -2022,8 +2022,7 @@ namespace xmloff
}
while (nElementStart < nLength);
- OUString *pElements = aElements.empty() ? 0 : &aElements[0];
- aList = Sequence< OUString >(pElements, aElements.size());
+ aList = Sequence< OUString >(aElements.data(), aElements.size());
}
else
{