[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - configmgr/source

Stephan Bergmann sbergman at redhat.com
Fri Dec 6 15:17:57 PST 2013


 configmgr/source/access.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 2e01c8727ac2652563dd4f0c45be4aa957136be8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Dec 6 16:52:27 2013 +0100

    Do not create paths starting "//" when root is just "/"
    
    (cherry picked from commit bd8b3be0c7535e74ca8b63969be5c2bece0d3a3b)
    Conflicts:
    	configmgr/source/access.cxx
    
    Change-Id: If0b413a4fdd93465074548c7ea5451288c1d12aa
    Reviewed-on: https://gerrit.libreoffice.org/6961
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index 9f18e8f..aa04a94 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -565,14 +565,15 @@ OUString Access::getHierarchicalName() throw (css::uno::RuntimeException) {
     checkLocalizedPropertyAccess();
     // For backwards compatibility, return an absolute path representation where
     // available:
-    OUStringBuffer path;
+    OUString rootPath;
     rtl::Reference< RootAccess > root(getRootAccess());
     if (root.is()) {
-        path.append(root->getAbsolutePathRepresentation());
+        rootPath = root->getAbsolutePathRepresentation();
     }
     OUString rel(getRelativePathRepresentation());
-    if (path.getLength() != 0 && !rel.isEmpty()) {
-        path.append(sal_Unicode('/'));
+    OUStringBuffer path(rootPath);
+    if (!rootPath.isEmpty() && rootPath != "/" && !rel.isEmpty()) {
+        path.append('/');
     }
     path.append(rel);
     return path.makeStringAndClear();


More information about the Libreoffice-commits mailing list