summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
diff options
context:
space:
mode:
authorKai Sommerfeld <kso@openoffice.org>2001-05-08 11:58:41 +0000
committerKai Sommerfeld <kso@openoffice.org>2001-05-08 11:58:41 +0000
commit2238eb2cbe839d7804ba2a2505fe033ae52709a4 (patch)
tree8d3f19d11f5384b98369d493d2563ae481fc07b3 /ucb/source/ucp/hierarchy/hierarchyprovider.cxx
parent82e6ce3e704c04e8659193e44d5ed902d21aebcc (diff)
#86715# - Remove trailing slash from URL ( queryContent(...) ) .
Diffstat (limited to 'ucb/source/ucp/hierarchy/hierarchyprovider.cxx')
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyprovider.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
index b852170fb6d9..24904e6c835e 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: hierarchyprovider.cxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: kso $ $Date: 2001-04-05 09:48:49 $
+ * last change: $Author: kso $ $Date: 2001-05-08 12:58:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -180,6 +180,14 @@ Reference< XContent > SAL_CALL HierarchyContentProvider::queryContent(
HIERARCHY_ROOT_FOLDER_URL_LENGTH ) != 0 )
throw IllegalIdentifierException();
+ // Remove trailing slash, except from Root folder URL.
+ if ( aId.getLength() > HIERARCHY_ROOT_FOLDER_URL_LENGTH )
+ {
+ sal_Int32 nPos = aId.lastIndexOf( '/' );
+ if ( nPos == aId.getLength() - 1 )
+ aId = aId.copy( 0, aId.getLength() - 1 );
+ }
+
// Encode URL and create new Id. This may "correct" user-typed-in URL's.
Reference< XContentIdentifier > xCanonicId =
new ::ucb::ContentIdentifier( m_xSMgr, encodeURL( aId ) );