diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-01-28 17:53:30 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-01-28 17:56:18 +0100 |
commit | cead54b6e555fe907348943b4586e956771f6ad0 (patch) | |
tree | 509e515c969fa27449fd7f7674c252e742133aae /reportdesign | |
parent | ed874d2eab1a6b1146f411a5a83cc790d3226f10 (diff) |
Use vector::data
...in some places where it is obvious that it does not hurt that for an empty
vector the obtained pointer is not necessarily a nullptr.
Change-Id: Id5d66b1559ca8b8955d379bcdbfae6986ef46a51
Diffstat (limited to 'reportdesign')
5 files changed, 5 insertions, 8 deletions
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 ) |