[Libreoffice-commits] core.git: writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Jul 9 01:04:15 PDT 2015


 writerfilter/source/dmapper/StyleSheetTable.cxx |   13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

New commits:
commit 6d657efa6b8d82fa7fa5f75776fb9da9b2f41901
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Jul 8 15:53:23 2015 +0200

    writerfilter: use std::transform in PropValVector::getValues()
    
    Change-Id: I26259b8aca75c1855f0abd98214ed23ce783571a
    Reviewed-on: https://gerrit.libreoffice.org/16878
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 4cd4d8f..635b198 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -906,16 +906,9 @@ uno::Sequence< uno::Any > PropValVector::getValues()
 }
 uno::Sequence< OUString > PropValVector::getNames()
 {
-    uno::Sequence< OUString > aRet( m_aValues.size() );
-    OUString* pNames = aRet.getArray();
-    sal_Int32 nVal = 0;
-    auto aIt = m_aValues.begin();
-    while (aIt != m_aValues.end())
-    {
-        pNames[nVal++] = aIt->Name;
-        ++aIt;
-    }
-    return aRet;
+    std::vector<OUString> aRet;
+    std::transform(m_aValues.begin(), m_aValues.end(), std::back_inserter(aRet), [](const beans::PropertyValue& rValue) { return rValue.Name; });
+    return comphelper::containerToSequence(aRet);
 }
 
 


More information about the Libreoffice-commits mailing list