From ebb5068a43c3ac8362225c1762d2a8eb74cf0eba Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 10 Jul 2015 09:07:05 +0200 Subject: [PATCH] Use std::transform Change-Id: If3b361d4ba7155547316796265cbd3955a4b8071 --- writerfilter/source/dmapper/StyleSheetTable.cxx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 635b1982f8d8..bc6d88e886d3 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -891,19 +891,14 @@ void PropValVector::Insert(const beans::PropertyValue& rVal) } m_aValues.push_back(rVal); } + uno::Sequence< uno::Any > PropValVector::getValues() { - uno::Sequence< uno::Any > aRet( m_aValues.size() ); - uno::Any* pValues = aRet.getArray(); - sal_Int32 nVal = 0; - auto aIt = m_aValues.begin(); - while (aIt != m_aValues.end()) - { - pValues[nVal++] = aIt->Value; - ++aIt; - } - return aRet; + std::vector aRet; + std::transform(m_aValues.begin(), m_aValues.end(), std::back_inserter(aRet), [](const beans::PropertyValue& rValue) { return rValue.Value; }); + return comphelper::containerToSequence(aRet); } + uno::Sequence< OUString > PropValVector::getNames() { std::vector aRet; @@ -911,7 +906,6 @@ uno::Sequence< OUString > PropValVector::getNames() return comphelper::containerToSequence(aRet); } - void StyleSheetTable::ApplyStyleSheets( FontTablePtr rFontTable ) { try