From 2e01c8727ac2652563dd4f0c45be4aa957136be8 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 6 Dec 2013 16:52:27 +0100 Subject: [PATCH 044/109] 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 Tested-by: Eike Rathke --- configmgr/source/access.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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(); -- 1.8.4.2