[Libreoffice-commits] .: cppuhelper/source

Michael Meeks michael at kemper.freedesktop.org
Tue May 22 04:20:24 PDT 2012


 cppuhelper/source/defaultbootstrap.cxx |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

New commits:
commit b162aec6254ab535cc5eb990b249f46aa8e79153
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Tue May 22 11:34:15 2012 +0100

    bootstrapping should elide duplicate .rdb paths in the configuration

diff --git a/cppuhelper/source/defaultbootstrap.cxx b/cppuhelper/source/defaultbootstrap.cxx
index b211d19..c903c2b 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -1961,6 +1961,7 @@ css::uno::Reference< css::registry::XSimpleRegistry > createTypeRegistry(
             css::uno::Reference< css::registry::XRegistryKey >()),
         css::uno::UNO_QUERY_THROW);
     css::uno::Reference< css::registry::XSimpleRegistry > reg;
+    std::vector<rtl::OUString> loaded;
     for (sal_Int32 i = 0; i != -1;) {
         rtl::OUString uri(uris.getToken(0, ' ', i));
         if (uri.isEmpty()) {
@@ -1969,9 +1970,13 @@ css::uno::Reference< css::registry::XSimpleRegistry > createTypeRegistry(
         bool optional;
         bool directory;
         decodeRdbUri(&uri, &optional, &directory);
-        reg = directory
-            ? readTypeRdbDirectory(uri, optional, reg, simpleRegs, nestedRegs)
-            : readTypeRdbFile(uri, optional, reg, simpleRegs, nestedRegs);
+        if (::std::find (loaded.begin(), loaded.end(), uri) == loaded.end())
+        {
+            reg = directory
+                ? readTypeRdbDirectory(uri, optional, reg, simpleRegs, nestedRegs)
+                : readTypeRdbFile(uri, optional, reg, simpleRegs, nestedRegs);
+            loaded.push_back(uri);
+        }
     }
     return reg;
 }


More information about the Libreoffice-commits mailing list