[Libreoffice-commits] .: Branch 'distro/suse/suse-3.6' - configmgr/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Nov 7 02:21:29 PST 2012


 configmgr/source/components.cxx |   13 +++++--------
 configmgr/source/components.hxx |    7 ++-----
 2 files changed, 7 insertions(+), 13 deletions(-)

New commits:
commit fa0d70348ab16dfd8b2465dcf190ab760f61f678
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Nov 6 16:15:57 2012 +0100

    fdo#55138: Do not double-expand bootstrap variables
    
    For some reason that escapes me now, the old code double-expanded URLs in
    CONFIGURATION_LAYERS and in extension layer's configmgr.ini SCHEMA/DATA.  That
    produced wrong results when the pathnames represented by those URLs contain
    any "$" characters, as apparently routinely happens on Windows with roaming
    profiles.
    
    Change-Id: Iff149e7d8736cbcda579376cdc89e24cf99ccc97
    (cherry picked from commit 8246bdb500a6d83ea9b61f58fb74e051432e32d7)
    Reviewed-on: https://gerrit.libreoffice.org/994
    Reviewed-by: Michael Meeks <michael.meeks at suse.com>
    Tested-by: Michael Meeks <michael.meeks at suse.com>

diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 5b40d30..abc4045 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -539,7 +539,7 @@ Components::Components(
             n = conf.getLength();
         }
         rtl::OUString type(conf.copy(i, c - i));
-        rtl::OUString url(expand(conf.copy(c + 1, n - c - 1)));
+        rtl::OUString url(conf.copy(c + 1, n - c - 1));
         if ( type == "xcsxcu" ) {
             parseXcsXcuLayer(layer, url);
             layer += 2; //TODO: overflow
@@ -696,12 +696,11 @@ void Components::parseFiles(
 
 void Components::parseFileList(
     int layer, FileParser * parseFile, rtl::OUString const & urls,
-    rtl::Bootstrap const & ini, bool recordAdditions)
+    bool recordAdditions)
 {
     for (sal_Int32 i = 0;;) {
         rtl::OUString url(urls.getToken(0, ' ', i));
         if (!url.isEmpty()) {
-            ini.expandMacrosFrom(url); //TODO: detect failure
             Additions * adds = 0;
             if (recordAdditions) {
                 adds = data_.addExtensionXcuAdditions(url, layer);
@@ -831,9 +830,7 @@ void Components::parseXcsXcuIniLayer(
     // Check if ini file exists (otherwise .override would still read global
     // SCHEMA/DATA variables, which could interfere with unrelated environment
     // variables):
-    rtl::Bootstrap ini(url);
-    if (ini.getHandle() != 0)
-    {
+    if (rtl::Bootstrap(url).getHandle() != 0) {
         rtl::OUStringBuffer prefix("${.override:");
         for (sal_Int32 i = 0; i != url.getLength(); ++i) {
             sal_Unicode c = url[i];
@@ -852,13 +849,13 @@ void Components::parseXcsXcuIniLayer(
         rtl::Bootstrap::expandMacros(urls);
         if (!urls.isEmpty())
         {
-            parseFileList(layer, &parseXcsFile, urls, ini, false);
+            parseFileList(layer, &parseXcsFile, urls, false);
         }
         urls = prefix.makeStringAndClear() + rtl::OUString("DATA}");
         rtl::Bootstrap::expandMacros(urls);
         if (!urls.isEmpty())
         {
-            parseFileList(layer + 1, &parseXcuFile, urls, ini, recordAdditions);
+            parseFileList(layer + 1, &parseXcuFile, urls, recordAdditions);
         }
     }
 }
diff --git a/configmgr/source/components.hxx b/configmgr/source/components.hxx
index bc4c5d0..e1987c0 100644
--- a/configmgr/source/components.hxx
+++ b/configmgr/source/components.hxx
@@ -53,10 +53,7 @@ namespace com { namespace sun { namespace star {
         class XComponentContext;
     }
 } } }
-namespace rtl {
-    class Bootstrap;
-    class OUString;
-}
+namespace rtl { class OUString; }
 
 namespace configmgr {
 
@@ -142,7 +139,7 @@ private:
 
     void parseFileList(
         int layer, FileParser * parseFile, rtl::OUString const & urls,
-        rtl::Bootstrap const & ini, bool recordAdditions);
+        bool recordAdditions);
 
     void parseXcdFiles(int layer, rtl::OUString const & url);
 


More information about the Libreoffice-commits mailing list