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

Noel Grandin noel.grandin at collabora.co.uk
Wed Mar 7 10:59:22 UTC 2018


 desktop/source/migration/migration.cxx |   20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)

New commits:
commit b75632f3086b2f7af0606ef17d6535c514528644
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Mar 7 10:43:34 2018 +0200

    use comphelper::containerToSequence
    
    Change-Id: Ib1cd28c8cabf8899c43701cb638d1191c593dad0
    Reviewed-on: https://gerrit.libreoffice.org/50872
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
index 7f5b52a74b02..a42602bc7204 100644
--- a/desktop/source/migration/migration.cxx
+++ b/desktop/source/migration/migration.cxx
@@ -681,21 +681,6 @@ bool getComponent(OUString const & path, OUString * component)
     return true;
 }
 
-uno::Sequence< OUString > setToSeq(std::set< OUString > const & set)
-{
-    std::set< OUString >::size_type n = set.size();
-    if (n > SAL_MAX_INT32) {
-        throw std::bad_alloc();
-    }
-    uno::Sequence< OUString > seq(static_cast< sal_Int32 >(n));
-    sal_Int32 i = 0;
-    for (auto const& elem : set)
-    {
-        seq[i++] = elem;
-    }
-    return seq;
-}
-
 }
 
 void MigrationImpl::copyConfig()
@@ -756,8 +741,9 @@ void MigrationImpl::copyConfig()
             configuration::Update::get(
                 comphelper::getProcessComponentContext())->
             insertModificationXcuFile(
-                regFilePath, setToSeq(comp.second.includedPaths),
-                setToSeq(comp.second.excludedPaths));
+                regFilePath,
+                comphelper::containerToSequence(comp.second.includedPaths),
+                comphelper::containerToSequence(comp.second.excludedPaths));
         } else {
             SAL_INFO( "desktop.migration", "configuration migration component " << comp.first << " ignored (only excludes, no includes)" );
         }


More information about the Libreoffice-commits mailing list